/* 快剪 - 主样式 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --accent-soft: rgba(6, 182, 212, 0.12);
    --vip: #ef4444;
    --free: #10b981;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #f8fafc;
    --text: #334155;
    --text-light: #64748b;
    --text-white: #f1f5f9;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 40px -12px rgb(15 23 42 / 0.15);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg-light);
    line-height: 1.6;
}

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

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ========== Header - 彩虹源码网风格 ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.page-inner .site-header {
    position: sticky;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.page-home .site-header.header-overlay {
    background: transparent;
}

.page-home .site-header.header-overlay.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.logo-icon.logo-icon-img {
    object-fit: contain;
    background: none;
    box-shadow: none;
    padding: 2px;
}

.logo-name {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.page-home .header-overlay:not(.is-scrolled) .logo-name {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.page-home .header-overlay.is-scrolled .logo-name {
    color: #1e293b;
    text-shadow: none;
}

.header-nav-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav > li { position: relative; }

.main-nav > li > a {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.page-home .header-overlay:not(.is-scrolled) .main-nav > li > a {
    color: rgba(255, 255, 255, 0.92);
}

.page-home .header-overlay:not(.is-scrolled) .main-nav > li > a:hover,
.page-home .header-overlay:not(.is-scrolled) .main-nav > li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.page-inner .main-nav > li > a:hover,
.page-inner .main-nav > li.active > a,
.page-home .header-overlay.is-scrolled .main-nav > li > a:hover,
.page-home .header-overlay.is-scrolled .main-nav > li.active > a {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-arrow { opacity: 0.6; transition: transform 0.2s; }
.main-nav > li.has-dropdown:hover .nav-arrow { transform: rotate(180deg); }

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    padding: 8px;
    list-style: none;
    z-index: 100;
}

.main-nav > li.has-dropdown:hover .dropdown-menu {
    display: block;
    animation: dropdownIn 0.2s ease;
}

.dropdown-menu a {
    display: block;
    padding: 9px 14px;
    color: #475569;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
}

.dropdown-menu a:hover { background: #f1f5f9; color: var(--primary); }

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    background: rgba(241, 245, 249, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.page-home .header-overlay:not(.is-scrolled) .tool-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.page-home .header-overlay:not(.is-scrolled) .tool-btn:hover,
.tool-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.page-home .header-overlay:not(.is-scrolled) .tool-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.tool-vip {
    width: auto;
    padding: 0 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    color: #fff !important;
}

.tool-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.avatar-has-photo .avatar-fallback {
    display: none;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.flash-wrap { padding-top: 16px; }
.page-home .flash-wrap { padding-top: 80px; }

/* ========== Homepage ========== */
.home-hero {
    position: relative;
    padding: 120px 0 64px;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
}

.home-hero__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #312e81 100%);
    z-index: 0;
}

.home-hero__mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.35), transparent 50%),
        radial-gradient(ellipse 60% 50% at 85% 30%, rgba(6, 182, 212, 0.2), transparent 45%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(139, 92, 246, 0.25), transparent 50%);
}

.home-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.home-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.home-hero__orb--1 { width: 360px; height: 360px; background: #6366f1; top: -80px; right: 10%; }
.home-hero__orb--2 { width: 280px; height: 280px; background: #06b6d4; bottom: -60px; left: 5%; opacity: 0.35; }

.home-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
}

.home-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

.home-hero__badge svg { color: #fbbf24; flex-shrink: 0; }

.home-hero__title {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.home-hero__subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.home-hero__search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 24px;
    padding: 6px 6px 6px 18px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-hero__search-icon {
    color: #94a3b8;
    flex-shrink: 0;
}

.home-hero__search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: #1e293b;
    background: transparent;
    min-width: 0;
}

.home-hero__search input::placeholder { color: #94a3b8; }

.home-hero__search button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.home-hero__search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}

.home-hero__search button:focus-visible {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

.home-hero__tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.home-hero__tags-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin-right: 4px;
}

.home-hero__tag {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
}

.home-hero__tag:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Highlights */
.home-highlights {
    margin-top: -32px;
    position: relative;
    z-index: 2;
    padding-bottom: 48px;
}

.home-highlights__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.home-highlight-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.home-highlight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -12px rgba(99, 102, 241, 0.2);
    border-color: #c7d2fe;
}

.home-highlight-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
    color: #fff;
}

.home-highlight-card__icon--1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.home-highlight-card__icon--2 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.home-highlight-card__icon--3 { background: linear-gradient(135deg, #10b981, #059669); }
.home-highlight-card__icon--4 { background: linear-gradient(135deg, #f59e0b, #d97706); }

.home-highlight-card__body { flex: 1; min-width: 0; }

.home-highlight-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.home-highlight-card__title strong {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.home-highlight-card__badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #ef4444;
    color: #fff;
}

.home-highlight-card__body p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-highlight-card__arrow {
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.home-highlight-card:hover .home-highlight-card__arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* Categories */
.home-categories {
    padding: 56px 0;
    background: #fff;
}

.home-section-head { margin-bottom: 28px; }
.home-section-head h2 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.home-section-head p {
    font-size: 15px;
    color: var(--text-light);
    margin: 0;
}
.home-section-head--center { text-align: center; }
.home-section-head--inline h2 { font-size: 24px; }

.home-categories__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.home-category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.home-category-card:hover {
    background: #fff;
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.home-category-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.home-category-card__icon--1 { background: linear-gradient(135deg, #6366f1, #818cf8); }
.home-category-card__icon--2 { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.home-category-card__icon--3 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.home-category-card__icon--4 { background: linear-gradient(135deg, #10b981, #34d399); }
.home-category-card__icon--5 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.home-category-card__icon--6 { background: linear-gradient(135deg, #ec4899, #f472b6); }

.home-category-card__name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.home-category-card__count {
    font-size: 12px;
    color: var(--text-light);
}

/* Resources */
.home-resources {
    padding: 56px 0 64px;
    background: var(--bg-light);
}

.home-resources__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.home-sort-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.home-sort-tab {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.home-sort-tab:hover {
    color: var(--primary);
    background: #f8fafc;
}

.home-sort-tab.is-active {
    background: var(--primary);
    color: #fff;
}

.home-resources__more {
    text-align: center;
    margin-top: 36px;
}

/* Trust */
.home-trust {
    padding: 64px 0 72px;
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
}

.home-trust__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.home-trust-card {
    padding: 28px 24px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-trust-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.home-trust-card__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: #0891b2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-trust-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.home-trust-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.home-trust__cta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
    .home-highlight-card:hover,
    .home-trust-card:hover,
    .home-category-card:hover,
    .resource-card:hover {
        transform: none;
    }
}

/* Legacy hero (kept for compatibility) */
.hero-banner {
    position: relative;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 24px 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 35%, #4c1d95 65%, #581c87 100%);
    z-index: 0;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.shape-1 { width: 400px; height: 400px; background: #818cf8; top: -100px; right: -50px; }
.shape-2 { width: 300px; height: 300px; background: #c084fc; bottom: 50px; left: -80px; }
.shape-3 { width: 200px; height: 200px; background: #6366f1; top: 40%; left: 50%; }

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

.hero-search {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 6px 6px 6px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 560px;
    margin: 0 auto 20px;
}

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #334155;
    background: transparent;
    min-width: 0;
}

.hero-search input::placeholder { color: #94a3b8; }

.hero-search button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-search button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.hero-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-tags-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.hero-tag {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
}

.hero-tag:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* 毛玻璃特色卡片 */
.hero-cards {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: auto;
    padding-bottom: 40px;
    width: 100%;
}

.hero-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.25s;
}

.hero-card:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.hero-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.hero-card-body { min-width: 0; }

.hero-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.hero-card-title strong {
    color: #fff;
    font-size: 15px;
}

.hero-card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #ef4444;
    color: #fff;
}

.hero-card-body p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 最新发布列表 ========== */
.section-latest { background: #fff; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.section-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.section-head-sort { align-items: flex-end; }

.section-desc {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

.sort-dropdown {
    position: relative;
}

.sort-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    padding: 10px 16px;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.sort-dropdown-btn:hover {
    border-color: #c7d2fe;
    background: #fafbff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.sort-dropdown.open .sort-dropdown-btn {
    border-color: var(--primary);
    background: #fafbff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.sort-dropdown-btn h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.sort-arrow {
    width: 20px;
    height: 20px;
    padding: 3px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}

.sort-dropdown-btn:hover .sort-arrow {
    background: rgba(99, 102, 241, 0.18);
}

.sort-dropdown.open .sort-arrow {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
    border: 1px solid #f1f5f9;
    padding: 6px;
    list-style: none;
    z-index: 50;
}

.sort-dropdown.open .sort-dropdown-menu {
    display: block;
    animation: dropdownIn 0.15s ease;
}

.sort-dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
}

.sort-dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary);
}

.sort-dropdown-menu a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    font-weight: 600;
}

.sort-dropdown-menu a svg {
    color: var(--primary);
}

.section-tabs { display: flex; gap: 16px; align-items: center; }

.section-tabs .tab {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: none;
}

.section-tabs .tab.active { color: var(--primary); font-weight: 600; }

.article-list { display: flex; flex-direction: column; gap: 0; }

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.article-item:hover { background: #fafbfc; margin: 0 -16px; padding: 20px 16px; border-radius: 12px; }

.article-thumb {
    width: 140px;
    height: 90px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    text-decoration: none;
}

.article-thumb-icon { font-size: 36px; }

.article-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.article-badge.vip { background: #ef4444; }
.article-badge.free { background: #10b981; }

.article-body { flex: 1; min-width: 0; }

.article-body h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-body h3 a { color: #1e293b; text-decoration: none; }
.article-body h3 a:hover { color: var(--primary); }

.article-body p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #94a3b8;
}

.section-featured { background: var(--bg-light); }
.section-advantages { background: #fff; }

@keyframes dropdownIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 兼容旧类名 */
.search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 12px;
    gap: 6px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-vip { 
    background: linear-gradient(135deg, #f59e0b, #ef4444); 
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.btn-vip:hover { 
    opacity: 0.95; 
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-lg { padding: 12px 32px; font-size: 16px; }

/* Carousel */
.hero-carousel {
    position: relative;
    height: 420px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca);
}

.carousel-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s;
    padding: 0 60px;
}

.carousel-slide.active { opacity: 1; }

.carousel-content { max-width: 600px; color: #fff; }

.carousel-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.carousel-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.carousel-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.carousel-dot.active { background: #fff; width: 28px; border-radius: 5px; }

/* Section */
.section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 28px; color: var(--text); margin-bottom: 8px; }
.section-title p { color: var(--text-light); font-size: 16px; }

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.resource-grid--home {
    grid-template-columns: repeat(4, 1fr);
}

.resource-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #c7d2fe;
}

.resource-card-thumb {
    height: 168px;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.resource-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.resource-card:hover .resource-card-thumb img {
    transform: scale(1.04);
}

.resource-card-placeholder {
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-card-thumb .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    z-index: 1;
}

.badge-vip { background: var(--vip); color: #fff; }
.badge-free { background: var(--free); color: #fff; }

.resource-card-body { padding: 18px 20px 20px; }

.resource-card-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card-body p {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: var(--text-light);
}

.resource-card-version {
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-weight: 600;
    color: #475569;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-item {
    text-align: center;
    padding: 32px 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.feature-item h4 { font-size: 18px; margin-bottom: 8px; }
.feature-item p { color: var(--text-light); font-size: 14px; }

/* VIP Page */
.vip-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.vip-plan {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.vip-plan.popular {
    border-color: var(--accent);
    transform: scale(1.05);
}

.vip-plan.popular::before {
    content: '75%的人选择该套餐';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
}

.vip-plan h3 { font-size: 20px; margin-bottom: 16px; }

.vip-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.vip-price span { font-size: 16px; font-weight: 400; color: var(--text-light); }

.vip-original {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
}

.vip-duration { color: var(--text-light); margin-bottom: 24px; }

.vip-activities {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.vip-activities h3 { margin-bottom: 16px; }

.activity-list { list-style: none; max-height: 300px; overflow: hidden; }

.activity-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
}

.activity-list li::before { content: '• '; color: var(--primary); }

/* Resource Detail */
.resource-detail {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.resource-preview {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    overflow: visible;
}

.resource-preview img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 6px;
}

.resource-cover,
.resource-media-gallery {
    margin: 0 0 24px;
}

.resource-cover img,
.resource-media-image {
    display: block;
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
}

.resource-media-carousel {
    position: relative;
    padding: 16px 44px 36px;
}

.resource-media-carousel__track {
    position: relative;
    height: 360px;
    overflow: hidden;
}

.resource-media-carousel__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.resource-media-carousel__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.resource-media-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s, border-color 0.2s;
}

.resource-media-carousel__nav:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

.resource-media-carousel__nav--prev { left: 8px; }
.resource-media-carousel__nav--next { right: 8px; }

.resource-media-carousel__dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.resource-media-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s;
}

.resource-media-carousel__dot.is-active {
    width: 22px;
    border-radius: 4px;
    background: var(--primary);
}

.resource-media-videos {
    margin-bottom: 24px;
}

.resource-media-video {
    width: 100%;
    max-height: 360px;
    border-radius: var(--radius);
    display: block;
    margin-bottom: 16px;
    background: #000;
}

.resource-detail h1 { font-size: 28px; margin-bottom: 16px; }

.resource-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
}

.resource-content { line-height: 1.8; overflow: hidden; }
.resource-content img {
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    display: block;
    margin: 16px auto;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
}
.resource-content table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}
.resource-content h2 { font-size: 20px; margin: 24px 0 12px; }
.resource-content ul { padding-left: 24px; margin: 12px 0; }
.resource-content li { margin: 6px 0; }

.download-box {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 32px;
    text-align: center;
}

.download-box .price-tag {
    font-size: 18px;
    margin-bottom: 16px;
}

.download-box .price-tag.vip-only { color: var(--vip); font-weight: 600; }
.download-box .price-tag.free-tag { color: var(--free); font-weight: 600; }

.email-download-box {
    text-align: left;
    max-width: 420px;
    margin: 0 auto 16px;
}

.email-download-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.email-download-box input {
    width: 100%;
    margin-bottom: 16px;
}

.admin-card--section {
    margin-bottom: 24px;
}

.admin-card--section h3 {
    margin-bottom: 16px;
}

.list-row__main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* Auth Forms */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
    background: #fff;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.auth-container h2 { text-align: center; margin-bottom: 32px; font-size: 24px; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.captcha-group { display: flex; gap: 12px; align-items: center; }
.captcha-group input { flex: 1; }
.captcha-group img { height: 40px; border-radius: 6px; cursor: pointer; }

.form-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }

.agree-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    line-height: 1.6;
    cursor: pointer;
}

.agree-label input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
    flex-shrink: 0;
}

.agree-label span {
    flex: 1;
    font-size: 14px;
}

/* 社交登录 */
.social-login { margin-top: 28px; }

.social-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #94a3b8;
    font-size: 13px;
}

.social-login-divider::before,
.social-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.social-login-btns {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    background: var(--social-color);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.social-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.social-btn:hover {
    opacity: 0.92;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.social-login-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
}

/* User Center */
.user-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 40px 0; }

.user-sidebar {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.user-sidebar .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.user-sidebar .username { text-align: center; font-weight: 600; margin-bottom: 4px; }
.user-sidebar .vip-badge { text-align: center; margin-bottom: 20px; }

.user-menu { list-style: none; padding: 0; margin: 0; }
.user-menu li { margin: 0; padding: 0; }
.user-menu li a,
.user-menu .user-menu__link {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
}

.user-menu li a:hover,
.user-menu li a.active,
.user-menu .user-menu__link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.user-menu .logout-form {
    margin: 0;
    padding: 0;
    display: block;
}

.user-menu .logout-form__btn {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    outline: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.user-content {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 14px; color: var(--text-light); margin-top: 4px; }

/* Messages */
.message-form { margin-bottom: 32px; }

.message-board {
    padding: 20px;
}

.message-board__empty {
    color: #64748b;
    text-align: center;
    padding: 28px 20px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.message-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.message-card.is-expanded {
    border-color: #a5b4fc;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
}

.message-card__toggle {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.message-card__toggle:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
}

.message-card__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.message-card__summary {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-card__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.message-card__author {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.message-card__count {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.message-card__time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.message-card__preview {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__latest {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    position: relative;
    transition: transform 0.2s, background 0.2s;
}

.message-card__chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translate(-60%, -70%) rotate(-45deg);
    transition: border-color 0.2s;
}

.message-card.is-expanded .message-card__chevron {
    transform: rotate(180deg);
    background: rgba(99, 102, 241, 0.12);
}

.message-card.is-expanded .message-card__chevron::before {
    border-color: var(--primary);
}

.message-card__detail {
    padding: 0 20px 20px;
    border-top: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.message-card__detail[hidden] {
    display: none !important;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
}

.message-thread__entry {
    padding: 14px 16px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.message-thread__entry--user {
    border-left: 4px solid #0ea5e9;
    background: #f8fafc;
}

.message-thread__entry--admin {
    border-left: 4px solid var(--primary);
    background: #f5f3ff;
}

.message-thread__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.message-thread__author {
    font-weight: 600;
    color: var(--text);
}

.message-thread__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

.message-thread__time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-light);
}

.message-thread__content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}

.message-thread--admin {
    margin-top: 12px;
}

.message-followup-form {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.message-followup-form .form-group:last-of-type {
    margin-bottom: 12px;
}

.message-followup-form textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.message-followup-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.message-followup-form .captcha-group input {
    width: auto;
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

/* Footer */
.site-footer {
    background: var(--bg);
    color: var(--text-white);
    padding: 48px 0 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-grid h4 { margin-bottom: 16px; font-size: 16px; }
.footer-grid p, .footer-grid a { color: #94a3b8; font-size: 14px; line-height: 2; }
.footer-grid a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    color: var(--text);
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Admin */
.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    padding: 24px;
}

.admin-login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.admin-login-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px;
    color: #0f172a;
}

.admin-login-desc {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
}

.admin-login-form .form-group {
    margin-bottom: 16px;
}

.admin-login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.admin-login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.admin-login-form .btn-block {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
}

.admin-login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
}

.admin-login-footer a {
    color: #64748b;
}

.admin-sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 12px;
    background: #1e293b;
    border-radius: 8px;
    font-size: 13px;
}

.admin-sidebar-user__name {
    color: #e2e8f0;
    font-weight: 600;
}

.admin-sidebar-user__logout {
    color: #94a3b8;
    font-size: 12px;
}

.admin-sidebar-user__logout-form {
    margin: 0;
    display: inline;
}

.admin-sidebar-user__logout-form .admin-sidebar-user__logout {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.admin-sidebar-user__logout:hover {
    color: #fff;
}

.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--bg);
    color: #fff;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar h2 { font-size: 18px; margin-bottom: 20px; color: var(--primary); padding: 0 8px; }
.admin-menu { list-style: none; }
.admin-menu a {
    display: block;
    padding: 10px 14px;
    color: #94a3b8;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}
.admin-menu a:hover, .admin-menu a.active { background: #334155; color: #fff; }
.admin-content {
    padding: 28px 32px 40px;
    background: #f1f5f9;
    min-width: 0;
}

.admin-page-header { margin-bottom: 20px; }
.admin-page-header h2 { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.admin-page-desc { font-size: 14px; color: #64748b; margin: 0; }

.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.admin-card .admin-table { box-shadow: none; border-radius: 0; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.admin-table th { background: #f8fafc; font-weight: 600; color: #475569; font-size: 13px; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table--compact td, .admin-table--compact th { padding: 10px 14px; }
.admin-col-actions { width: 88px; white-space: nowrap; }

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.admin-badge-vip-0 { background: #f1f5f9; color: #64748b; }
.admin-badge-vip-1 { background: #dbeafe; color: #1d4ed8; }
.admin-badge-vip-2 { background: #ede9fe; color: #6d28d9; }
.admin-badge-vip-3 { background: #fef3c7; color: #b45309; }

.admin-users-table .admin-device-cell { max-width: 200px; }
.admin-device-text { display: block; font-size: 12px; color: #64748b; line-height: 1.4; word-break: break-all; }

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.admin-tab {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-tab:hover { border-color: #cbd5e1; color: #334155; }
.admin-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.admin-tab-panel { margin-bottom: 0; }
.admin-tab-panel[hidden] { display: none !important; }

.admin-settings-form .form-group { margin-bottom: 18px; }
.admin-settings-form .form-group:last-child { margin-bottom: 0; }
.admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.admin-form-hint { font-size: 12px; color: #94a3b8; margin-top: 6px; line-height: 1.5; }
.admin-form-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, #f1f5f9 24%);
    padding: 16px 0 0;
    margin-top: 8px;
}
.admin-textarea-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }

.admin-modal[hidden] { display: none !important; }
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.admin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}
.admin-modal__panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}
.admin-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.admin-modal__header h3 { font-size: 17px; margin: 0; color: #0f172a; }
.admin-modal__close {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
}
.admin-modal__close:hover { color: #334155; }
.admin-modal__body { padding: 20px; }
.admin-modal__meta { font-size: 13px; color: #64748b; margin-bottom: 16px; }
.admin-modal__section {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}
.admin-modal__section:last-child { border-bottom: none; padding-bottom: 0; }
.admin-modal__section h4 { font-size: 14px; font-weight: 600; color: #334155; margin-bottom: 12px; }
.admin-modal__section--danger h4 { color: #dc2626; }
.admin-modal-open { overflow: hidden; }

.admin-message-list { display: flex; flex-direction: column; gap: 12px; }
.admin-message-item {
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.admin-message-item__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}
.admin-message-item__author { font-weight: 600; color: #0f172a; }
.admin-message-item__time { color: #94a3b8; font-size: 13px; white-space: nowrap; }
.admin-message-item__body { font-size: 14px; color: #334155; line-height: 1.6; }
.admin-message-item__user-reply {
    margin-top: 12px;
    padding: 10px 12px;
    background: #ecfeff;
    border-radius: 8px;
    font-size: 13px;
    color: #0f766e;
}
.admin-message-item__reply {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
}
.admin-message-reply-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.admin-message-reply-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.admin-code,
.admin-code-inline {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #334155;
}

.admin-software-cell { max-width: 180px; }
.admin-software-tags { font-size: 12px; color: #475569; line-height: 1.5; }
.admin-checkbox-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.admin-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
}

.admin-modal__panel--wide { max-width: 620px; }
.admin-software-settings { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 16px; }
.admin-software-setting {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
}
.admin-software-setting__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}
.admin-software-setting__vip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-left: 24px;
}
.admin-software-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 4px;
}
.admin-software-line:last-child { margin-bottom: 0; }

.admin-page-header--actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-page-header--actions .admin-page-header { margin-bottom: 0; flex: 1; }

.btn-xs {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.2;
}

.btn-danger-text {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-danger-text:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.admin-thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.admin-thumb-empty {
    color: #94a3b8;
    font-size: 12px;
}

.thumbnail-upload {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.thumbnail-preview {
    width: 96px;
    height: 72px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thumbnail-preview.is-marked-remove {
    opacity: 0.55;
    border-color: #fca5a5;
    background: #fef2f2;
}

.thumbnail-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.thumbnail-placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.thumbnail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
}

.thumbnail-actions small {
    color: #64748b;
    font-size: 12px;
}

.remove-thumbnail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.media-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.media-upload-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, opacity 0.2s;
}

.media-upload-item.is-marked-remove {
    opacity: 0.55;
    border-color: #fca5a5;
    background: #fef2f2;
}

.media-upload-item--pending {
    border-style: dashed;
}

.media-upload-item__preview {
    position: relative;
    height: 72px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-upload-item__preview img,
.media-upload-item__preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.media-upload-item__type {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
}

.media-upload-item__meta {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.media-sort-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.media-sort-input {
    width: 56px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
}

.media-pending-label {
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

.remove-media {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

.remove-media input {
    margin: 0;
}

.media-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.media-upload-actions small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

/* Floating buttons */
.float-buttons {
    position: fixed;
    right: 24px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.float-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.float-btn:hover { transform: scale(1.1); }
.float-btn-vip { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.float-btn-top { background: var(--primary); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

/* Scan login */
.scan-login-page { text-align: center; }
.scan-login-desc { color: var(--text-light); margin-bottom: 24px; line-height: 1.6; }
.scan-qrcode-wrap {
    width: 240px;
    height: 240px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
}
.scan-qrcode-wrap img { border-radius: 8px; }
.scan-loading, .scan-qrcode-fallback { color: var(--text-light); font-size: 14px; padding: 16px; }
.scan-status { min-height: 22px; margin-bottom: 12px; color: var(--text-light); }
.scan-status-success { color: #07c160; font-weight: 600; }
.scan-status-error { color: #fa5151; }
.scan-device-hint { font-size: 13px; margin-bottom: 16px; }
.scan-refresh-btn { margin-top: 8px; }

/* Responsive */
@media (max-width: 1100px) {
    .home-highlights__grid { grid-template-columns: repeat(2, 1fr); }
    .home-categories__grid { grid-template-columns: repeat(2, 1fr); }
    .home-trust__grid { grid-template-columns: repeat(2, 1fr); }
    .resource-grid--home { grid-template-columns: repeat(2, 1fr); }
    .hero-cards { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 40px; }
    .main-nav > li > a { padding: 8px 10px; font-size: 14px; }
    .header-nav-wrap { display: none; }
}

@media (max-width: 768px) {
    .home-hero { padding: 100px 0 48px; min-height: auto; }
    .home-hero__search { flex-wrap: wrap; padding: 12px; border-radius: 12px; }
    .home-hero__search input { width: 100%; order: 1; padding: 4px 0; }
    .home-hero__search-icon { order: 0; }
    .home-hero__search button { width: 100%; order: 2; margin-top: 4px; }
    .home-highlights { margin-top: -20px; }
    .home-highlights__grid { grid-template-columns: 1fr; }
    .home-categories__grid { grid-template-columns: 1fr; }
    .home-resources__head { flex-direction: column; align-items: flex-start; }
    .home-trust__grid { grid-template-columns: 1fr; }
    .resource-grid--home { grid-template-columns: 1fr; }
    .home-trust__cta { flex-direction: column; }
    .home-trust__cta .btn { width: 100%; text-align: center; }
    .hero-banner { min-height: 520px; padding-top: 80px; }
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 15px; }
    .hero-cards { grid-template-columns: 1fr; gap: 12px; }
    .hero-card { padding: 14px 16px; }
    .article-item { flex-direction: column; }
    .article-thumb { width: 100%; height: 120px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .vip-plans { grid-template-columns: 1fr; }
    .vip-plan.popular { transform: none; }
    .user-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .admin-content { padding: 16px; }
    .admin-form-row { grid-template-columns: 1fr; }
}
