:root {
    --accent: #2563eb;
    --accent-soft: #eff4ff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f8fafc;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(37,99,235,.35);
}

main { flex: 1 0 auto; }

/* Header */
.site-header {
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.navbar { padding-top: .85rem; padding-bottom: .85rem; }
.brand-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.brand-dot {
    width: 12px; height: 12px; border-radius: 4px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 0 12px rgba(56,189,248,.6);
}
.navbar .nav-link { color: var(--muted); font-weight: 500; }
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--accent); }
.navbar .nav-link.active { position: relative; }
.navbar .nav-link.active::after { content: ''; position: absolute; bottom: -2px; left: .5rem; right: .5rem; height: 2px; background: var(--accent); border-radius: 1px; }

/* Footer */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 1.25rem 0;
    color: var(--muted);
    font-size: .9rem;
    margin-top: 2rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #ffffff 0%, #eff4ff 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(37,99,235,.06);
}
.hero h1 {
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: -.02em;
}
.hero .lead { color: var(--muted); max-width: 640px; margin: 1rem auto 0; }

/* Cards */
.card-template {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    height: 100%;
}
.card-template:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(37,99,235,.12);
    border-color: #c7d6f5;
}
.card-template .thumb {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.card-template .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-template .thumb .ph { color: var(--muted); font-size: 2.5rem; }
.card-template .body { padding: 1rem 1.1rem; }
.card-template .title { font-weight: 600; font-size: 1.05rem; }
.card-template .cat { font-size: .78rem; color: var(--accent); font-weight: 600; }
.card-template .price { color: var(--ink); font-weight: 700; }

.category-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .35rem 1rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--muted);
    background: #fff;
    text-decoration: none;
    transition: all .15s ease;
}
.category-chip:hover, .category-chip.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.5rem;
}

.section-title {
    font-weight: 700;
    letter-spacing: -.01em;
    margin-bottom: 1.25rem;
}

.badge-paid { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-failed { background: #fee2e2; color: #991b1b; }

.qr-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}
.qr-box img { width: 220px; height: 220px; }

.card-template .body .price { color: var(--ink); font-weight: 700; }

/* Category Showcase Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.1rem; }
}
@media (min-width: 992px) {
    .category-grid { grid-template-columns: repeat(7, 1fr); }
}

.category-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    background: var(--cat-bg);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}
.category-card::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--cat-accent);
    opacity: .08;
    transition: all .2s ease;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    border-color: var(--cat-accent);
}
.category-card:hover::after {
    opacity: .15;
    width: 80px; height: 80px;
    top: -30px; right: -30px;
}

.category-card-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--cat-accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
    transition: transform .2s ease;
}
.category-card-icon svg {
    width: 20px; height: 20px;
    stroke: #fff;
}
.category-card:hover .category-card-icon {
    transform: scale(1.1);
}

.category-card-info {
    min-width: 0;
}
.category-card-name {
    font-weight: 600;
    font-size: .92rem;
    color: var(--cat-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.category-card-count {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 2px;
}

/* Change Password Modal */
.pwd-modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
    overflow: hidden;
}
.pwd-modal-header {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.pwd-modal-title-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pwd-modal-header .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}
.pwd-modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: .7;
}
.pwd-modal-header .btn-close:hover { opacity: 1; }

.pwd-modal-body {
    padding: 1.5rem;
    background: #fff;
}

.pwd-alert {
    padding: .75rem 1rem;
    border-radius: 12px;
    font-size: .88rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.pwd-alert.pwd-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.pwd-alert.pwd-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.pwd-field-group {
    margin-bottom: 1.15rem;
}
.pwd-field-group:last-child { margin-bottom: 0; }

.pwd-label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink);
    margin-bottom: .35rem;
}

.pwd-input-wrap {
    position: relative;
}
.pwd-input {
    width: 100%;
    padding: .65rem .65rem .65rem 1rem;
    padding-right: 2.8rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: .95rem;
    background: var(--bg);
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.pwd-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pwd-input::placeholder {
    color: #94a3b8;
}

.pwd-eye-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}
.pwd-eye-btn:hover { color: var(--accent); }

.pwd-modal-footer {
    border-top: 1px solid var(--line);
    padding: 1rem 1.5rem;
    background: #fff;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}
.pwd-submit-btn {
    min-width: 120px;
    border-radius: 12px;
    font-weight: 600;
    transition: all .15s ease;
}
.pwd-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.pwd-submit-spinner svg {
    animation: pwd-spin .8s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes pwd-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dropdown-item svg {
    vertical-align: -2px;
}

/* ========== 资讯中心 ========== */

/* 页面标题区 */
.news-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #38bdf8 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(37,99,235,.18);
    position: relative;
    overflow: hidden;
}
.news-hero::after {
    content: '';
    position: absolute;
    bottom: -40px; right: -30px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.news-hero-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.news-hero-title {
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: -.01em;
    margin: 0;
    color: #fff;
}
.news-hero-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.75);
    margin: .2rem 0 0;
}

/* 左右布局 */
.news-layout {
    display: flex;
    gap: 1.5rem;
}
@media (max-width: 767px) {
    .news-layout { flex-direction: column; }
}

/* 左侧栏目 */
.news-sidebar {
    width: 220px;
    flex-shrink: 0;
}
@media (max-width: 767px) {
    .news-sidebar { width: 100%; }
}
.news-sidebar-inner {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.news-sidebar-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1.1rem;
    background: linear-gradient(135deg, #eff4ff, #e0f2fe);
    font-weight: 600;
    font-size: .92rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}
.news-sidebar-head svg {
    color: var(--accent);
}

.news-sidebar-list {
    display: flex;
    flex-direction: column;
    padding: .5rem 0;
}
@media (max-width: 767px) {
    .news-sidebar-list {
        flex-direction: row;
        flex-wrap: wrap;
        padding: .5rem .5rem;
        gap: .4rem;
    }
}

.news-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1.1rem;
    text-decoration: none;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 500;
    transition: all .15s ease;
    border-left: 3px solid transparent;
}
@media (max-width: 767px) {
    .news-sidebar-item {
        padding: .35rem .75rem;
        border-radius: 999px;
        border: 1px solid var(--line);
        border-left: none;
        font-size: .85rem;
    }
}
.news-sidebar-item:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
}
@media (max-width: 767px) {
    .news-sidebar-item:hover {
        border-left-color: transparent;
        border-color: var(--accent);
        background: var(--accent-soft);
    }
}
.news-sidebar-item.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}
@media (max-width: 767px) {
    .news-sidebar-item.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }
    .news-sidebar-item.active .news-sidebar-badge {
        color: rgba(255,255,255,.8);
    }
}

.news-sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-sidebar-badge {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    padding: .1rem .5rem;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

/* 右侧文章列表 */
.news-main {
    flex: 1;
    min-width: 0;
}
.news-main-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.news-main-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}
.news-main-count {
    font-size: .85rem;
    color: var(--muted);
}

/* 文章卡片 */
.news-article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-article-card {
    display: flex;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    text-decoration: none;
    color: var(--ink);
    transition: all .2s ease;
    overflow: hidden;
}
.news-article-card:hover {
    border-color: #c7d6f5;
    box-shadow: 0 8px 28px rgba(37,99,235,.1);
    transform: translateY(-2px);
}

.news-article-cover {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}
@media (max-width: 576px) {
    .news-article-cover { width: 100px; height: 70px; }
}

.news-article-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.news-article-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .35rem;
}
.news-article-column {
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: .15rem .5rem;
    border-radius: 6px;
}
.news-article-date {
    font-size: .78rem;
    color: var(--muted);
}

.news-article-title {
    font-weight: 600;
    font-size: 1.08rem;
    margin: 0 0 .3rem;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .15s;
}
.news-article-card:hover .news-article-title {
    color: var(--accent);
}

.news-article-summary {
    font-size: .88rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 空状态 */
.news-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.news-empty p {
    margin: .5rem 0 0;
    font-weight: 500;
}
