/* ============================================
 * 校园新闻发布系统 - 前台样式表
 * 设计风格：简洁校园风，蓝白配色
 * 支持响应式布局（手机/平板/PC）
 * ============================================ */

/* ============================================
 * 1. CSS变量与基础重置
 * ============================================ */
:root {
    /* 主色调 - 校园蓝 */
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;

    /* 辅助色 */
    --success: #0d904f;
    --danger: #d93025;
    --warning: #f59f00;
    --info: #1c7ed6;

    /* 中性色 */
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --text-muted: #a0aec0;
    --border: #e0e0e0;
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --profile-accent: #e8f0fe;

    /* 尺寸 */
    --container-width: 1200px;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

ul, ol {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
 * 2. 顶部工具栏
 * ============================================ */
.top-bar {
    background: #1A1A2E;
    color: #B8C8E0;
    font-size: 13px;
    line-height: 36px;
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-links a {
    color: #B8C8E0;
    margin-left: 15px;
}
.top-bar-links a:hover {
    color: #fff;
}
.top-bar-links span {
    margin-right: 5px;
}

/* ============================================
 * 3. 网站头部
 * ============================================ */
.site-header {
    background: var(--bg-white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-logo h1 {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
}
.site-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}
.header-search {
    display: flex;
    border: 2px solid var(--primary);
    border-radius: 25px;
    overflow: hidden;
}
.header-search input {
    border: none;
    outline: none;
    padding: 10px 20px;
    width: 280px;
    font-size: 14px;
}
.header-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
.header-search button:hover {
    background: var(--primary-dark);
}

/* ============================================
 * 4. 主导航
 * ============================================ */
.main-nav {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: visible;
}
.main-nav .container { overflow: visible; }
.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
}
.main-nav ul li a {
    display: block;
    color: #ffffff;
    padding: 14px 22px;
    font-size: 15px;
    transition: var(--transition);
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
    background: rgba(255,255,255,0.15);
}

/* 多级导航下拉菜单 */
li.has-submenu { position: relative; }
li.has-submenu > a { padding-right: 28px !important; }
.sub-arrow { font-size: 10px; margin-left: 4px; opacity: 0.7; }
li.has-submenu .submenu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%; left: 0;
    min-width: 100%;
    background: #1557b0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 9999;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin: 0; padding: 0;
}
li.has-submenu .submenu li { display: block; margin: 0; }
li.has-submenu .submenu li a {
    display: block;
    padding: 11px 18px;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    box-sizing: border-box;
    width: 100%;
}
li.has-submenu .submenu li:last-child a { border-bottom: none; }
li.has-submenu .submenu li a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
li.has-submenu:hover .submenu,
li.has-submenu:focus-within .submenu {
    visibility: visible;
    opacity: 1;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 14px 15px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

/* ============================================
 * 5. 首页轮播大图（原生JS实现）
 * ============================================ */
.banner-carousel {
    position: relative;
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 24px;
    background: #e8eaed;
    user-select: none;
}

.banner-track {
    display: flex;
    will-change: transform;
}

.banner-slide {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
}
.banner-slide img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}
.banner-slide a {
    display: block;
}

/* 轮播文字覆盖层 */
.banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    padding: 60px 30px 25px;
}
.banner-caption h3 {
    font-size: 22px;
    margin-bottom: 6px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.banner-caption p {
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 左右切换按钮 */
.banner-prev, .banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: none;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-prev:hover, .banner-next:hover {
    background: rgba(0,0,0,0.6);
}
.banner-prev {
    left: 15px;
}
.banner-next {
    right: 15px;
}

/* 轮播指示器 */
.banner-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.banner-dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.banner-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* ============================================
 * 6. 通用区块
 * ============================================ */
.section {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}
.section-more {
    font-size: 14px;
    color: var(--text-light);
}
.section-more:hover {
    color: var(--primary);
}

/* ============================================
 * 7. 置顶新闻（4张小卡片左右循环切换）
 * ============================================ */
.top-news-section { position: relative; }
.top-news-nav { display: flex; gap: 4px; }
.top-news-arrow {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-white);
    cursor: pointer; font-size: 12px; color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.top-news-arrow:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.top-news-carousel { overflow: hidden; }
.top-news-track {
    display: flex; gap: 12px;
    will-change: transform;
}
.top-news-card {
    flex: 0 0 calc(25% - 9px); /* 4张并排 */
    min-width: calc(25% - 9px);
}
.top-news-card a {
    display: block; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: var(--transition);
    background: var(--bg-white);
}
.top-news-card a:hover { border-color: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.08); transform: translateY(-2px); }
.top-news-card-img { height: 100px; overflow: hidden; }
.top-news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.top-news-card a:hover .top-news-card-img img { transform: scale(1.05); }
.top-news-card-body { padding: 10px 12px; }
.top-news-card-body h4 {
    font-size: 13px; color: var(--text); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4;
}

/* ============================================
 * 8. 新闻卡片网格
 * ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.news-grid .news-card:nth-child(n+5) { display: none; }
.news-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.news-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.news-card-img {
    height: 170px;
    overflow: hidden;
}
.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.news-card:hover .news-card-img img {
    transform: scale(1.05);
}
.news-card-body {
    padding: 14px;
}
.news-card-body h3 {
    font-size: 15px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

/* ============================================
 * 9. 新闻列表项
 * ============================================ */
.news-list-item {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: relative;
}
.news-list-item:last-child {
    border-bottom: none;
}
.news-list-item a {
    display: flex;
    gap: 16px;
}
.news-list-img {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}
.news-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-list-info {
    flex: 1;
    min-width: 0;
}
.news-list-info h3 {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 8px;
}

/* 新闻元信息 */
.news-summary {
    font-size: 14px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
.news-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-lighter);
    flex-wrap: wrap;
}
.news-category {
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 3px;
}

/* ============================================
 * 10. 新闻详情页
 * ============================================ */
.news-detail {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
}
.detail-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 16px;
}
.detail-meta {
    color: var(--text-lighter);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.detail-meta .detail-category a {
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 3px;
}
.detail-actions {
    margin: 16px 0;
}

/* 【重要】新闻正文 - 直接渲染富文本HTML，不做二次转义 */
.detail-content {
    font-size: 16px;
    line-height: 2;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}
.detail-content img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 16px auto;
    border-radius: 4px;
}
.detail-content p {
    margin-bottom: 16px;
    text-indent: 2em;
}
.detail-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}
.detail-content table td,
.detail-content table th {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
}
.detail-content table th {
    background: #f8f9fa;
    font-weight: 600;
}
.detail-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 12px 20px;
    margin: 16px 0;
    color: #555;
}
.detail-content iframe,
.detail-content video,
.detail-content .data-report,
.detail-content .data-report div[id^="chartPub"] {
    max-width: 100% !important;
    overflow: hidden !important;
}
.detail-content iframe,
.detail-content video {
    border-radius: 6px;
    margin: 16px auto;
    display: block;
}
.data-report { word-wrap: break-word; overflow-wrap: break-word; }
/* 数据报告全宽模式 */
.data-report-full { margin: 0 -15px; }
body.has-data-report .main-layout { display: block; }
body.has-data-report .main-left { max-width: none; }
body.has-data-report .main-right { display: none; }
@media (max-width: 768px) {
    .detail-content .data-report div[id^="chartPub"] { height: 250px !important; }
    .data-report-full { margin: 0; }
}
.detail-content h1, .detail-content h2, .detail-content h3,
.detail-content h4, .detail-content h5, .detail-content h6 {
    margin: 20px 0 12px;
    font-weight: 600;
}
.detail-content ul, .detail-content ol {
    margin-left: 2em;
    margin-bottom: 16px;
}
.detail-content ul li {
    list-style: disc;
}
.detail-content ol li {
    list-style: decimal;
}
.detail-cover {
    margin: 20px 0;
    text-align: center;
}
.detail-cover img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.detail-declare {
    margin-top: 20px;
    padding: 12px 16px;
    background: #e8f0fe;
    border-left: 4px solid var(--primary);
    color: var(--text-light);
    font-size: 13px;
}

/* 上下篇导航 */
.prev-next-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.prev-news, .next-news {
    flex: 1;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.prev-news:hover, .next-news:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.prev-news { text-align: left; }
.next-news { text-align: right; }
.prev-news.disabled, .next-news.disabled {
    color: var(--text-lighter);
    pointer-events: none;
}
.pn-label {
    font-size: 13px;
    color: var(--text-lighter);
    display: block;
}
.pn-title {
    font-size: 15px;
    color: var(--text);
}

/* ============================================
 * 11. 评论区域
 * ============================================ */
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}
.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.comment-tip {
    font-size: 13px;
    color: var(--text-lighter);
}
.comment-login-tip {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: 6px;
}
.comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.comment-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-placeholder {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}
.comment-user {
    font-weight: 600;
    margin-bottom: 4px;
}
.comment-time {
    font-size: 12px;
    color: var(--text-lighter);
    margin-left: 8px;
    font-weight: 400;
}
.comment-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

/* ============================================
 * 12. 侧边栏
 * ============================================ */
.main-layout {
    display: flex;
    gap: 24px;
}
.main-left {
    flex: 1;
    min-width: 0;
}
.main-right {
    width: 320px;
    flex-shrink: 0;
}
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 70px;
}
.widget-title {
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    margin-bottom: 12px;
}
.hot-news-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    perspective: 600px;
}
.hot-news-list li:last-child {
    border-bottom: none;
}
.hot-rank {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.hot-rank.top {
    background: var(--danger);
    color: #fff;
}
.hot-news-list li a {
    flex: 1;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}
.hot-news-list li a:hover {
    color: var(--primary);
    animation: textFlip 0.5s ease;
}
.hot-views {
    font-size: 12px;
    color: var(--text-lighter);
    flex-shrink: 0;
}
@keyframes textFlip {
    0% { transform: rotateX(0deg); }
    40% { transform: rotateX(90deg); opacity: 0.3; }
    60% { transform: rotateX(90deg); opacity: 0.3; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

/* 子分类 Tab 切换 */
.subcat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
}
.subcat-tab {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-white);
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.subcat-tab:hover, .subcat-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================
 * 13. 分页组件
 * ============================================ */
.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.pagination ul {
    display: flex;
    gap: 4px;
}
.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
}
.pagination li a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination li.active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination li.disabled span {
    color: var(--text-lighter);
    cursor: not-allowed;
}
.pagination .ellipsis span {
    border: none;
}
.pagination-info {
    font-size: 13px;
    color: var(--text-lighter);
}

/* ============================================
 * 14. 按钮样式
 * ============================================ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    background: var(--bg-white);
    color: var(--text);
    transition: var(--transition);
    line-height: 1.5;
}
.btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26,115,232,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d7ff2 0%, #1356a8 100%);
    color: #fff;
    border-color: transparent;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #c62828;
    color: #fff;
}
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-default {
    background: var(--bg-white);
    color: var(--text);
}
.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 4px;
}
.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}
.btn-block {
    display: block;
    width: 100%;
}
.btn-favorite {
    transition: var(--transition);
}
.btn-favorite.favorited {
    color: var(--danger);
    border-color: var(--danger);
}

/* ============================================
 * 15. 表单样式
 * ============================================ */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}
.required {
    color: var(--danger);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-group input[type="checkbox"] {
    margin-right: 6px;
}
.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.form-hint {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 4px;
    display: block;
}
.form-row {
    margin-bottom: 16px;
}
.form-row-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.form-input-lg {
    font-size: 16px !important;
    padding: 12px 16px !important;
}
.cover-upload-row {
    display: flex;
    gap: 8px;
}
.cover-upload-row input {
    flex: 1;
}
.cover-preview {
    margin-top: 10px;
}
.cover-preview img {
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ============================================
 * 16. 提示消息
 * ============================================ */
.alert {
    position: relative;
    padding: 14px 40px 14px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #e6f7e6; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger  { background: #fdeded; color: #c62828; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff9e6; color: #e65100; border: 1px solid #ffe082; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }
.alert-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
}
.alert-close:hover { opacity: 1; }

/* ============================================
 * 17. 面包屑
 * ============================================ */
.breadcrumb {
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-lighter);
}
.breadcrumb a {
    color: var(--text-light);
}
.breadcrumb a:hover {
    color: var(--primary);
}

/* ============================================
 * 18. 用户认证页面
 * ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
    background: linear-gradient(135deg, #0d47a1 0%, #1a73e8 40%, #4a90d9 100%);
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255,255,255,0.04) 0%, transparent 50%);
    pointer-events: none;
}
.auth-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.1);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 16px rgba(26,115,232,0.3);
}
.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-header p {
    color: #666;
    font-size: 14px;
    margin-top: 6px;
}
.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.auth-sep { color: #ccc; }
/* 带图标的输入框 */
.input-with-icon { position: relative; }
.input-with-icon .input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}
.input-with-icon input {
    padding-left: 42px !important;
}

/* ============================================
 * 19. 个人中心
 * ============================================ */
.profile-page {
    display: flex;
    gap: 24px;
}
.profile-sidebar {
    width: 240px;
    flex-shrink: 0;
}
.profile-content {
    flex: 1;
    min-width: 0;
}

/* 头像卡片 - 蓝色顶部装饰条 */
.profile-avatar-box {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0 20px 24px;
    text-align: center;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
}
.profile-avatar-box::before {
    content: '';
    display: block;
    height: 64px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    margin: 0 -20px 0;
    border-radius: var(--radius) var(--radius) 0 0;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -40px auto 10px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
    position: relative;
    border: 4px solid var(--bg-white);
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
    z-index: 1;
}
.profile-avatar:hover { opacity: 0.9; transform: scale(1.08); }
.profile-avatar-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.profile-role {
    font-size: 13px;
    color: var(--primary);
    margin-top: 4px;
    display: inline-block;
    background: var(--profile-accent);
    padding: 2px 12px;
    border-radius: 12px;
}

/* 头像裁剪弹窗 */
.crop-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.crop-modal-overlay.active { display: flex; }

.crop-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 540px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.crop-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}
.crop-modal-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.crop-container {
    flex: 1;
    max-height: 400px;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 8px;
}
.crop-container img {
    display: block;
    max-width: 100%;
    /* Cropper.js 需要 img 可见才能正确计算 */
}
.crop-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100px;
    flex-shrink: 0;
}
.crop-preview-label {
    font-size: 12px;
    color: #999;
}
.crop-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e0e0e0;
    background: #f5f5f5;
}
.crop-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}
.crop-actions .btn {
    min-width: 100px;
}
.crop-actions .btn-cancel {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}
.crop-actions .btn-cancel:hover {
    background: #e0e0e0;
}
.crop-actions .btn-confirm {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    border: none;
}

/* 头像上传中状态 */
.avatar-uploading {
    opacity: 0.6;
    pointer-events: none;
}
.avatar-uploading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 24px; height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 侧边菜单 - 增强选中态 */
.profile-menu {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.profile-menu li a {
    display: block;
    padding: 13px 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.profile-menu li a:hover {
    background: var(--profile-accent);
    color: var(--primary);
    border-left-color: var(--primary);
}
.profile-menu li a.active {
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}
.profile-menu li:last-child a {
    border-bottom: none;
}

/* ============================================
 * 20. 表格
 * ============================================ */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table thead {
    background: #f8f9fa;
}
.table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover {
    background: #fafbfc;
}
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.status-draft     { background: #e0e0e0; color: #555; }
.status-pending   { background: #fff3cd; color: #856404; }
.status-published { background: #d4edda; color: #155724; }
.status-rejected  { background: #f8d7da; color: #721c24; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.badge-success { background: #d4edda; color: #155724; }

/* ============================================
 * 21. 搜索页面
 * ============================================ */
.search-form-inline {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.search-form-inline input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
}
.search-form-inline input:focus {
    border-color: var(--primary);
    outline: none;
}
.search-form-inline button {
    padding: 12px 32px;
    font-size: 15px;
}
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-lighter);
}
.empty-state ul {
    margin-top: 12px;
    text-align: left;
    display: inline-block;
}
.empty-state li {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 4px;
}
.empty-tip {
    text-align: center;
    padding: 30px;
    color: var(--text-lighter);
    font-size: 14px;
}
.category-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg);
    border-radius: 4px;
}
.favorite-remove-form {
    position: absolute;
    top: 16px;
    right: 0;
}

/* ============================================
 * 22. 页脚
 * ============================================ */
.site-footer {
    background: #1A1A2E;
    color: #B8C8E0;
    padding: 40px 0 0;
    margin-top: 50px;
    position: relative;
    overflow: hidden;
}
.footer-links { text-align: center; margin-bottom: 10px; }
.footer-links a {
    color: #B8C8E0;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-links .footer-sep { color: #B8C8E0; margin: 0 8px; }
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
.footer-section h3 {
    color: #D5D5D5;
    font-size: 16px;
    margin-bottom: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 10px;
}
.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.footer-section p, .footer-section li {
    font-size: 14px;
    line-height: 2;
    color: #B8C8E0;
}
.footer-section ul { list-style: none; padding: 0; }
.footer-section a {
    color: #B8C8E0;
    transition: color 0.2s;
}
.footer-section a:hover {
    color: #fff;
    text-decoration: none;
}
.footer-bottom {
    text-align: center;
    padding: 18px 0;
    border-top: none;
    font-size: 13px;
    color: #B8C8E0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.footer-bottom p { margin: 0; }
.footer-bottom a {
    color: #B8C8E0;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-bottom a:hover {
    color: #fff;
}
.footer-bottom .footer-sep {
    color: rgba(255,255,255,0.15);
}

/* ============================================
 * 23. 响应式布局
 * ============================================ */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }
    .main-right {
        width: 100%;
    }
    .sidebar-widget {
        position: static;
    }
    .profile-page {
        flex-direction: column;
    }
    .profile-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* 顶部工具栏移动端适配：全部一行，不换行 */
    .top-bar {
        font-size: 11px;
        line-height: 32px;
        padding: 0 6px;
    }
    .top-bar .container {
        flex-wrap: nowrap;
        gap: 4px;
    }
    .top-bar-welcome {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1 1 auto;
        min-width: 0;
    }
    .top-bar-links {
        white-space: nowrap;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 2px;
    }
    .top-bar-links a {
        margin-left: 0;
        padding: 0 3px;
    }
    .top-bar-links span {
        margin-right: 2px;
    }
    .theme-toggle {
        font-size: 11px;
        padding: 0 3px;
    }

    .header-search input {
        width: 160px;
    }
    .nav-toggle {
        display: block;
    }
    .main-nav ul {
        display: none;
        flex-direction: column;
    }
    .main-nav ul.show {
        display: flex;
    }
    /* 移动端子菜单 */
    li.has-submenu .submenu {
        display: block;
        visibility: visible;
        opacity: 1;
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,0.15);
    }
    li.has-submenu .submenu li a { padding-left: 36px; font-size: 13px; }
    li.has-submenu > a { display: flex; justify-content: space-between; align-items: center; }
    .sub-arrow { transition: transform 0.3s; }
    li.has-submenu.open > a .sub-arrow { transform: rotate(180deg); }
    li.has-submenu.open .submenu { display: block; }
    li.has-submenu:not(.open) .submenu { display: none; }

    .news-list-item a { flex-direction: column; }
    .news-list-img { width: 100%; height: 180px; }

    /* 置顶轮播移动端：2张并排 */
    .top-news-card { flex: 0 0 calc(50% - 6px); min-width: calc(50% - 6px); }
    .top-news-card-img { height: 80px; }
    .top-news-card-body { padding: 6px 8px; }
    .top-news-card-body h4 { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* 子分类Tab移动端 */
    .subcat-tabs { gap: 4px; padding: 8px 10px; }
    .subcat-tab { padding: 6px 12px; font-size: 12px; }

    /* 移动端页脚链接不换行 */
    .footer-links { white-space: nowrap; font-size: 12px; }
    .footer-links .footer-sep { margin: 0 4px; }

    /* 移动端：分类卡片最多2张 */
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid .news-card:nth-child(n+3) { display: none; }

    /* 移动端：最新新闻最多5条 */
    .news-list .news-list-item:nth-child(n+6) { display: none; }
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .banner-carousel,
    .banner-slide img {
        max-height: 240px;
        height: 240px;
    }
    .banner-caption h3 {
        font-size: 16px;
    }
    .banner-caption p {
        display: none;
    }
    .banner-prev, .banner-next {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .news-detail {
        padding: 16px;
    }
    .detail-header h1 {
        font-size: 20px;
    }
    .detail-meta {
        gap: 10px;
    }
    .form-row-3col {
        grid-template-columns: 1fr;
    }
    .header-search {
        display: none;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .news-grid .news-card:nth-child(n+3) { display: none; }
    .news-list .news-list-item:nth-child(n+6) { display: none; }
    .footer-links { font-size: 11px; }
    .footer-links .footer-sep { margin: 0 2px; }
    .top-news-card-img { height: 65px; }
    .top-news-card-body h4 { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .banner-carousel,
    .banner-slide img {
        max-height: 180px;
        height: 180px;
    }
    .site-logo h1 {
        font-size: 20px;
    }
}

/* ============================================
 * 24. 阅读进度条
 * ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1001;
    background: transparent;
}
.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #42a5f5);
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(26,115,232,0.5);
}

/* ============================================
 * 25. 文章目录 TOC
 * ============================================ */
.article-toc {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
}
.article-toc h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary);
}
.article-toc ol {
    margin: 0;
    padding-left: 20px;
}
.article-toc ol li {
    margin-bottom: 6px;
    list-style: decimal;
}
.article-toc ol li a {
    color: var(--text);
    text-decoration: none;
}
.article-toc ol li a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.article-toc ol ol {
    padding-left: 16px;
}
.article-toc ol ol li {
    list-style: circle;
    font-size: 13px;
}

/* ============================================
 * 26. 社交分享按钮
 * ============================================ */
.share-buttons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.share-label {
    font-size: 13px;
    color: var(--text-lighter);
    margin-right: 4px;
}
.share-btn {
    font-size: 12px !important;
    padding: 4px 10px !important;
    border-radius: 4px;
}
.share-weibo { background: #e6162d; color: #fff; border-color: #e6162d; }
.share-weibo:hover { background: #c41426; color: #fff; }
.share-qq { background: #12b7f5; color: #fff; border-color: #12b7f5; }
.share-qq:hover { background: #0e9fd6; color: #fff; }
.share-wechat { background: #07c160; color: #fff; border-color: #07c160; }
.share-wechat:hover { background: #06a050; color: #fff; }

/* 微信二维码弹窗 */
.wechat-qr-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wechat-qr-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 300px;
}
.wechat-qr-box canvas {
    margin: 12px 0;
}
.wechat-qr-box button {
    margin-top: 8px;
}

/* ============================================
 * 27. 字体大小控制
 * ============================================ */
.font-size-controls {
    display: inline-flex;
    gap: 2px;
    margin-left: 8px;
}
.font-size-btn {
    font-weight: 700;
    min-width: 36px;
}
.font-size-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.detail-content.font-sm { font-size: 14px; }
.detail-content.font-md { font-size: 16px; }
.detail-content.font-lg { font-size: 18px; }

/* ============================================
 * 28. 评论回复 + 嵌套
 * ============================================ */
.comment-reply {
    margin-left: 52px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px 14px;
    border-left: 3px solid var(--primary-light);
}
.comment-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
}
.comment-avatar-sm .avatar-placeholder {
    font-size: 13px;
}
.btn-reply {
    margin-top: 6px;
    font-size: 12px !important;
    padding: 2px 8px !important;
    color: var(--text-lighter);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}
.btn-reply:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
 * 29. 点赞按钮
 * ============================================ */
.btn-like {
    transition: var(--transition);
}
.btn-like.liked {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
 * 30. 通知列表
 * ============================================ */
.notification-list {
    border-top: 1px solid var(--border);
}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.notification-item.unread {
    background: var(--primary-light);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}
.notification-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.notification-body {
    flex: 1;
    min-width: 0;
}
.notification-title {
    font-weight: 500;
    margin-bottom: 4px;
}
.notification-title a {
    color: var(--text);
}
.notification-title a:hover {
    color: var(--primary);
}
.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.notification-content {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 2px;
}
.notification-time {
    font-size: 12px;
    color: var(--text-lighter);
}
.notification-mark-read {
    flex-shrink: 0;
}
/* 顶部通知角标 */
.notify-badge {
    position: relative;
}
.notify-badge .badge-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ============================================
 * 31. 标签云
 * ============================================ */
.tag-cloud {
    padding: 20px 0;
    text-align: center;
    line-height: 2.4;
}
.tag-item {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px;
    color: var(--primary);
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    transition: var(--transition);
    animation: tagFloat 3s ease-in-out infinite;
}
.tag-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
}
.tag-count {
    font-size: 0.7em;
    color: var(--text-lighter);
    margin-left: 2px;
}
.tag-item:hover .tag-count {
    color: rgba(255,255,255,0.7);
}
@keyframes tagFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* 子分类 Tab 切换 */
.subcat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
}
.subcat-tab {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-white);
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.subcat-tab:hover, .subcat-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 新闻详情页标签 */
.detail-tags {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.detail-tags .detail-tags-label {
    color: var(--text-lighter);
    margin-right: 8px;
}
.detail-tags a {
    display: inline-block;
    padding: 2px 10px;
    margin: 2px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
}
.detail-tags a:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================
 * 32. 搜索建议下拉
 * ============================================ */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.search-suggestions .suggest-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.search-suggestions .suggest-item:last-child {
    border-bottom: none;
}
.search-suggestions .suggest-item:hover {
    background: var(--primary-light);
}

/* ============================================
 * 33. 暗色模式 (data-theme="dark")
 * ============================================ */
[data-theme="dark"] {
    --primary: #5c9ce6;
    --primary-dark: #4a8ad4;
    --primary-light: #1e2a3a;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --text-lighter: #888888;
    --border: #3a3a4a;
    --bg: #1a1a2e;
    --bg-white: #22223a;
}
[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}
[data-theme="dark"] .site-header,
[data-theme="dark"] .section,
[data-theme="dark"] .news-detail,
[data-theme="dark"] .sidebar-widget,
[data-theme="dark"] .profile-avatar-box,
[data-theme="dark"] .profile-menu,
[data-theme="dark"] .auth-container,
[data-theme="dark"] .admin-card {
    background: var(--bg-white);
}
[data-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #0a1628 0%, #0f1f3d 40%, #162a4a 100%);
}
[data-theme="dark"] .auth-container {
    background: #1a2332;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
[data-theme="dark"] .auth-header h1 {
    background: linear-gradient(135deg, #5b9cf5, #7ab5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .auth-header p { color: #94a3b8; }
[data-theme="dark"] .auth-icon {
    background: linear-gradient(135deg, #5b9cf5, #3b7dd8);
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}
[data-theme="dark"] .auth-sep { color: #475569; }
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #5b9cf5 0%, #3b7dd8 100%);
    box-shadow: 0 2px 8px rgba(91,156,245,0.3);
}
[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #7ab5ff 0%, #5b9cf5 100%);
}

/* 主题切换按钮 */
.theme-toggle-btn {
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, opacity 0.2s;
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}
[data-theme="dark"] .theme-toggle-btn {
    border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
}
[data-theme="dark"] .top-bar {
    background: #1A1A2E;
    color: #8AA0C0;
}
[data-theme="dark"] .main-nav {
    background: #1a1a2e;
}
[data-theme="dark"] li.has-submenu .submenu {
    background: #222240;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] li.has-submenu .submenu li a {
    border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .top-bar-links a { color: #8AA0C0; }
[data-theme="dark"] .top-bar-links a:hover { color: #fff; }
[data-theme="dark"] .site-footer {
    background: #22223A;
    border-top: 2px solid rgba(255,255,255,0.08);
}
[data-theme="dark"] .footer-links a { color: #8AA0C0; }
[data-theme="dark"] .footer-links a:hover { color: #fff; }
[data-theme="dark"] .footer-section h3::after {
    background: #3b82f6;
}
[data-theme="dark"] .footer-section p,
[data-theme="dark"] .footer-section li { color: #8AA0C0; }
[data-theme="dark"] .footer-section a { color: #8AA0C0; }
[data-theme="dark"] .footer-bottom { color: #8AA0C0; }
[data-theme="dark"] .footer-bottom a { color: #8AA0C0; }
[data-theme="dark"] .news-list-item a h3,
[data-theme="dark"] .news-card-body h3,
[data-theme="dark"] .top-news-info h3 {
    color: var(--text);
}
[data-theme="dark"] .table thead {
    background: var(--primary-light);
}
[data-theme="dark"] .table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .header-search input {
    background: var(--bg);
    color: var(--text);
}
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .detail-content {
    color: var(--text);
}
[data-theme="dark"] .search-suggestions {
    background: var(--bg-white);
}
/* 暗色模式切换按钮 */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
}

/* ============================================
 * 20. 登录/注册模态框
 * ============================================ */
.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.auth-modal-overlay.closing {
    animation: fadeOut 0.2s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.auth-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 9999;
    animation: slideUp 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.auth-modal-overlay.closing .auth-modal {
    animation: slideDown 0.2s ease forwards;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.96); }
}

/* 模态框顶部装饰条 */
.auth-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, #1a73e8, #4a90d9, #6db3f8);
}

/* 关闭按钮 */
.auth-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    border: none;
    background: #f1f3f4;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    z-index: 2;
    line-height: 1;
}
.auth-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* 模态框头部 */
.auth-modal-header {
    text-align: center;
    padding: 32px 32px 0;
}
.auth-modal-icon {
    width: 64px; height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 20px rgba(26,115,232,0.3);
}
.auth-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.auth-modal-header p {
    color: #888;
    font-size: 13px;
}

/* Tab 切换按钮 */
.auth-modal-tabs {
    display: flex;
    margin: 24px 32px 0;
    background: #f1f3f4;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.auth-tab-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: all 0.25s;
    position: relative;
}
.auth-tab-btn.active {
    background: #fff;
    color: #1a73e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.auth-tab-btn:not(.active):hover {
    color: #333;
}

/* 表单面板 */
.auth-modal-panels {
    position: relative;
    overflow: hidden;
}
.auth-modal-panel {
    display: none;
    padding: 24px 32px 32px;
    animation: panelFadeIn 0.3s ease;
}
.auth-modal-panel.active {
    display: block;
}
@keyframes panelFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 模态框内的表单样式 */
.auth-modal .form-group {
    margin-bottom: 18px;
}
.auth-modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.auth-modal .form-group label .required {
    color: #d93025;
}
.auth-modal .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.25s;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
}
.auth-modal .form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26,115,232,0.08);
}
.auth-modal .form-group input::placeholder {
    color: #bbb;
}
.auth-modal .btn-block {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 2px;
    margin-top: 6px;
}
.auth-modal .btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26,115,232,0.35);
}
.auth-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26,115,232,0.45);
}
.auth-modal .btn-primary:active {
    transform: translateY(0);
}

/* 忘记密码链接 */
.auth-modal-forgot {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 0;
}
.forgot-password-link {
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-password-link:hover {
    color: #1a73e8;
    text-decoration: underline;
}
[data-theme="dark"] .forgot-password-link {
    color: #64748b;
}
[data-theme="dark"] .forgot-password-link:hover {
    color: #5b9cf5;
}

/* 模态框内消息提示 */
.auth-modal-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin: 0 32px 0;
    font-size: 14px;
    display: none;
    text-align: center;
    animation: panelFadeIn 0.3s ease;
}
.auth-modal-message.show {
    display: block;
}
.auth-modal-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.auth-modal-message.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* 模态框底部链接 */
.auth-modal-footer {
    text-align: center;
    padding: 0 32px 28px;
    font-size: 13px;
    color: #999;
}
.auth-modal-footer a {
    color: #1a73e8;
    cursor: pointer;
    font-weight: 500;
}
.auth-modal-footer a:hover {
    color: #0d47a1;
    text-decoration: underline;
}
.auth-modal-footer .auth-sep {
    margin: 0 8px;
    color: #ddd;
}

/* 带图标的输入框(模态框内) */
.auth-modal .input-with-icon {
    position: relative;
}
.auth-modal .input-with-icon .input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}
.auth-modal .input-with-icon input {
    padding-left: 42px;
}

/* 模态框滚动条美化 */
.auth-modal::-webkit-scrollbar {
    width: 6px;
}
.auth-modal::-webkit-scrollbar-track {
    background: transparent;
}
.auth-modal::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}
.auth-modal::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
 * 21. 暗色模式 - 模态框
 * ============================================ */
[data-theme="dark"] .auth-modal-overlay {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
[data-theme="dark"] .auth-modal {
    background: #1a2332;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3);
}
[data-theme="dark"] .auth-modal::before {
    background: linear-gradient(90deg, #5b9cf5, #7ab5ff, #93c5fd);
}
[data-theme="dark"] .auth-modal-close {
    background: #2a3344;
    color: #94a3b8;
}
[data-theme="dark"] .auth-modal-close:hover {
    background: #3a4454;
    color: #e2e8f0;
}
[data-theme="dark"] .auth-modal-icon {
    background: linear-gradient(135deg, #5b9cf5, #3b7dd8);
    box-shadow: 0 4px 20px rgba(59,130,246,0.4);
}
[data-theme="dark"] .auth-modal-header h2 {
    background: linear-gradient(135deg, #5b9cf5, #7ab5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .auth-modal-header p {
    color: #94a3b8;
}
[data-theme="dark"] .auth-modal-tabs {
    background: #243044;
}
[data-theme="dark"] .auth-tab-btn {
    color: #94a3b8;
}
[data-theme="dark"] .auth-tab-btn.active {
    background: #1a2332;
    color: #5b9cf5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .auth-tab-btn:not(.active):hover {
    color: #e2e8f0;
}
[data-theme="dark"] .auth-modal .form-group label {
    color: #94a3b8;
}
[data-theme="dark"] .auth-modal .form-group input {
    background: #243044;
    border-color: #3a4454;
    color: #e2e8f0;
}
[data-theme="dark"] .auth-modal .form-group input:focus {
    border-color: #5b9cf5;
    background: #1a2332;
    box-shadow: 0 0 0 4px rgba(91,156,245,0.12);
}
[data-theme="dark"] .auth-modal .form-group input::placeholder {
    color: #64748b;
}
[data-theme="dark"] .auth-modal .btn-primary {
    background: linear-gradient(135deg, #5b9cf5 0%, #3b7dd8 100%);
    box-shadow: 0 4px 16px rgba(91,156,245,0.35);
}
[data-theme="dark"] .auth-modal .btn-primary:hover {
    box-shadow: 0 6px 24px rgba(91,156,245,0.5);
}
[data-theme="dark"] .auth-modal-message.error {
    background: rgba(185,28,28,0.15);
    color: #fca5a5;
    border-color: rgba(185,28,28,0.3);
}
[data-theme="dark"] .auth-modal-message.success {
    background: rgba(21,128,61,0.15);
    color: #86efac;
    border-color: rgba(21,128,61,0.3);
}
[data-theme="dark"] .auth-modal-footer {
    color: #64748b;
}
[data-theme="dark"] .auth-modal-footer a {
    color: #5b9cf5;
}
[data-theme="dark"] .auth-modal-footer a:hover {
    color: #7ab5ff;
}
[data-theme="dark"] .auth-modal-footer .auth-sep {
    color: #475569;
}
[data-theme="dark"] .auth-modal::-webkit-scrollbar-thumb {
    background: #3a4454;
}
[data-theme="dark"] .auth-modal::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}

/* 移动端适配 */
@media (max-width: 520px) {
    .auth-modal {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 16px;
    }
    .auth-modal::before {
        border-radius: 16px 16px 0 0;
    }
    .auth-modal-header {
        padding: 20px 16px 0;
    }
    .auth-modal-icon {
        font-size: 36px;
    }
    .auth-modal-header h2 {
        font-size: 18px;
    }
    .auth-modal-header p {
        font-size: 12px;
    }
    .auth-modal-tabs {
        margin: 16px 16px 0;
    }
    .auth-modal-tabs a {
        padding: 8px 12px;
        font-size: 13px;
    }
    .auth-modal-panel {
        padding: 16px 16px 20px;
    }
    .auth-modal .form-group {
        margin-bottom: 12px;
    }
    .auth-modal .form-group label {
        font-size: 13px;
    }
    .auth-modal .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }
    .auth-modal .input-with-icon .input-icon {
        font-size: 16px;
        left: 10px;
    }
    .auth-modal .input-with-icon input {
        padding-left: 34px;
    }
    .auth-modal .btn-block {
        padding: 11px;
        font-size: 14px;
    }
    .auth-modal-footer {
        padding: 0 16px 20px;
        font-size: 12px;
    }
    .auth-modal-message {
        margin: 0 16px 0;
        font-size: 12px;
        padding: 8px 12px;
    }
    .auth-modal-forgot {
        font-size: 12px;
    }
    .auth-modal-close {
        top: 10px;
        right: 12px;
        font-size: 18px;
    }
}
