/* ========== CSS Variables & Reset ========== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
    --max-width: 1280px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }

/* ========== Header ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    flex-shrink: 0;
}
.logo-icon { color: var(--primary); font-size: 1.4rem; }
.logo-highlight { color: var(--primary); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

.nav-dropdown { position: relative; }
.nav-more { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.nav-more-arrow { font-size: 0.7rem; transition: transform 0.2s; }
.nav-dropdown:hover .nav-more-arrow { transform: rotate(180deg); }
.nav-more-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    display: none;
    z-index: 100;
}
.nav-more-menu.show { display: flex; flex-direction: column; }
.nav-more-menu .dropdown-item {
    padding: 8px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-more-menu .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-more-menu .dropdown-item.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    transition: border-color var(--transition);
}
.header-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-input {
    border: none;
    background: none;
    padding: 8px 16px;
    width: 180px;
    outline: none;
    font-size: 0.875rem;
}
.search-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.search-btn:hover { color: var(--primary); }

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    transition: all var(--transition);
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
.user-name { font-size: 0.875rem; font-weight: 500; color: var(--text); }

.user-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 4px;
    z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    transition: all var(--transition);
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-toggle span {
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-sm { padding: 6px 16px; font-size: 0.825rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-secondary {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border-light); color: var(--text); }

/* ========== Messages ========== */
.messages-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}
.message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}
.message-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.message-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.message-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.message-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.message-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    margin-left: auto;
    padding: 0 4px;
}
.message-close:hover { opacity: 1; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Main Content ========== */
.main-content { flex: 1; }

/* ========== Container ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Hero Section ========== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e3a5f 100%);
    color: #fff;
    padding: 64px 0 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(37,99,235,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(124,58,237,0.1) 0%, transparent 50%);
}
.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    line-height: 1.3;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 32px;
    position: relative;
}
.hero-search {
    display: flex;
    align-items: center;
    max-width: 560px;
    margin: 0 auto;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 32px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    position: relative;
}
.hero-search input {
    flex: 1;
    background: none;
    border: none;
    padding: 14px 24px;
    color: #fff;
    font-size: 1rem;
    outline: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.5); }
.hero-search button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition);
}
.hero-search button:hover { background: var(--primary-dark); }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
    position: relative;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 700; }
.hero-stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* ========== Section ========== */
.section { padding: 48px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    width: 4px; height: 24px;
    background: var(--primary);
    border-radius: 2px;
}
.section-more {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition);
}
.section-more:hover { color: var(--primary); }

/* ========== Category Tabs on Home ========== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.cat-tab {
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: all var(--transition);
}
.cat-tab:hover, .cat-tab.active { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ========== Source Card Grid ========== */
.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ========== Source Card ========== */
.source-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}
.source-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.card-cover {
    height: 160px;
    background: linear-gradient(135deg, #e0e7ff, #f0f9ff, #f0fdf4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}
.card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-cover-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 20px 18px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
    position: relative;
}
.card-cover.premium { background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706); }
.card-cover.discount { background: linear-gradient(135deg, #34d399, #10b981, #059669); }
.card-cover.normal { background: linear-gradient(135deg, #818cf8, #6366f1, #4f46e5); }
.card-quality-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.badge-premium { background: rgba(245,158,11,0.9); color: #fff; }
.badge-discount { background: rgba(16,185,129,0.9); color: #fff; }
.badge-normal { display: none; }

.card-body { padding: 16px; }
.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.card-title a { transition: color var(--transition); }
.card-title a:hover { color: var(--primary); }

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.card-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}
.card-tag-sub {
    background: var(--border-light);
    color: var(--text-secondary);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--danger);
}
.card-price.free { color: var(--success); }
.card-views {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== Category Page ========== */
.category-header {
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    padding: 36px 0 20px;
    border-bottom: 1px solid var(--border);
}
.category-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.category-title {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sub-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sub-cat-link {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
    background: #fff;
}
.sub-cat-link:hover, .sub-cat-link.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}
.sort-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 4px;
    transition: all var(--transition);
}
.sort-link:hover, .sort-link.active { color: var(--primary); font-weight: 600; }

/* ========== Detail Page ========== */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}
.detail-main { min-width: 0; }

.detail-header {
    margin-bottom: 24px;
}
.detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.detail-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.detail-breadcrumb a { color: var(--text-secondary); }
.detail-breadcrumb a:hover { color: var(--primary); }
.detail-cover {
    background: linear-gradient(135deg, #e0e7ff, #f0f9ff);
    border-radius: var(--radius);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    margin-bottom: 24px;
}
.detail-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
}
.detail-content h2, .detail-content h3 { margin: 24px 0 12px; }
.detail-content p { margin-bottom: 12px; }
.detail-content pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 12px 0;
}

/* ========== Detail Sidebar ========== */
.detail-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}
.sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.sidebar-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--danger);
    margin-bottom: 16px;
}
.sidebar-price .unit { font-size: 0.9rem; font-weight: 500; }
.sidebar-btn { width: 100%; margin-bottom: 8px; }
.sidebar-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.sidebar-info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.sidebar-info-item strong { color: var(--text); }

.related-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.related-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition);
}
.related-item:hover { padding-left: 4px; }
.related-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-thumb {
    width: 48px; height: 36px;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.related-info { min-width: 0; }
.related-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.related-name a:hover { color: var(--primary); }
.related-price { font-size: 0.8rem; color: var(--danger); font-weight: 600; }

/* ========== Detail Gallery ========== */
.detail-gallery {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}
.gallery-main {
    width: 100%;
    background: linear-gradient(135deg, #1e293b, #334155);
    position: relative;
    overflow: hidden;
    /* 固定 16:9 比例容器 */
    aspect-ratio: 16 / 9;
    max-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.2s;
}
.gallery-main img:hover {
    opacity: 0.92;
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--border);
}
.gallery-thumb {
    width: 80px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: all var(--transition);
    background: var(--bg);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumb:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

/* 画廊左右箭头 */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 5;
    line-height: 1;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-arrow:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}
.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 14px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    z-index: 5;
    pointer-events: none;
}

/* ========== Lightbox ========== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    border-radius: 4px;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-overlay.active img {
    transform: scale(1);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.25);
}

/* 灯箱左右箭头 */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10001;
    line-height: 1;
}
.lightbox-arrow:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-50%) scale(1.12);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 14px;
    z-index: 10001;
    pointer-events: none;
}

@media (max-width: 768px) {
    .lightbox-arrow { width: 38px; height: 38px; font-size: 16px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

/* ========== Auth Pages ========== */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition);
    background: #fff;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input.error { border-color: var(--danger); }
.form-btn { width: 100%; margin-top: 8px; padding: 12px; }
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 36px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-title { font-size: 1.2rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 0.9rem; }

/* ========== Admin Panel ========== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}
.admin-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 20px 12px;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: var(--primary-light); color: var(--primary); }
.admin-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}
.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }
.admin-page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-card-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Admin Table */
.admin-table-container {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }

.admin-actions { display: flex; gap: 6px; }
.table-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Admin Form */
.admin-form {
    max-width: 640px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-check label { font-size: 0.875rem; cursor: pointer; }
select.form-input { cursor: pointer; appearance: auto; }

/* Utility classes */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.btn-lg { padding: 12px 32px; font-size: 1rem; font-weight: 700; border-radius: var(--radius); }
.admin-page-header { margin-bottom: 24px; }
.admin-page-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }

/* Site Settings Form */
.site-settings-form { max-width: 800px; }
.form-fieldset {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.form-fieldset legend {
    font-size: 1rem;
    font-weight: 700;
    padding: 0 8px;
    color: var(--primary);
}
.form-fieldset .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.form-fieldset .form-group small {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-fieldset .form-group { margin-bottom: 16px; }
.form-fieldset .form-group:last-child { margin-bottom: 0; }
.form-fieldset .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
}
textarea.form-input { min-height: 120px; resize: vertical; }

/* Image row (admin source form) */
.image-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.image-row .form-input { flex: 1; min-width: 180px; }
.image-row .btn-sm { flex-shrink: 0; }

/* ========== Footer ========== */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 0;
    margin-top: auto;
}
.footer-container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
}
.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}
.footer-desc { font-size: 0.85rem; line-height: 1.7; }
.footer-links h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}
.footer-links a {
    display: block;
    font-size: 0.85rem;
    padding: 4px 0;
    color: rgba(255,255,255,0.6);
    transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }
.footer-contact h4 { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-contact p { font-size: 0.85rem; margin-bottom: 4px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .detail-container { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px 16px;
        box-shadow: var(--shadow-lg);
    }
    .main-nav.open { display: flex; }
    .nav-link { width: 100%; }
    .mobile-menu-toggle { display: flex; }
    .header-search { width: 140px; }
    .hero-title { font-size: 1.6rem; }
    .hero-stats { gap: 24px; }
    .hero-stat-num { font-size: 1.2rem; }
    .hero-stat-label { font-size: 0.75rem; }
    .source-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 12px; border-right: none; border-bottom: 1px solid var(--border); }
    .admin-nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .admin-nav-item.active { border-left: none; border-bottom-color: var(--primary); }
    .admin-main { padding: 20px 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .form-row { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .category-header .container { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .admin-stats { grid-template-columns: 1fr; }
    .source-grid { grid-template-columns: 1fr; }
}

/* ========== Static Pages (免责声明 / 联系我们) ========== */
.static-page {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 48px 56px;
    margin-bottom: 48px;
}
.static-page-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.static-page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
}
.static-page-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.static-page-content p {
    font-size: 0.95rem;
    line-height: 2;
    color: var(--text);
    margin-bottom: 16px;
}
.static-page-content p:first-letter {
    font-weight: 600;
}
.static-page-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.static-page-footer a {
    color: var(--primary);
    text-decoration: none;
}
.static-page-footer a:hover {
    text-decoration: underline;
}

/* --- Contact Cards --- */
.contact-section {
    margin-bottom: 36px;
}
.contact-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}
.contact-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
    text-decoration: none;
    color: inherit;
}
.contact-card-link {
    cursor: pointer;
}
.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.contact-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}
.contact-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.contact-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    word-break: break-all;
}
.contact-card-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.contact-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

/* ---- 微信二维码卡片 ---- */
.wechat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    justify-items: center;
}
.wechat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px;
    background: linear-gradient(160deg, #f0fdf4, #ecfdf5);
    border: 1px solid #d1fae5;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
    width: 100%;
    max-width: 280px;
}
.wechat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.wechat-qr-wrap {
    width: 180px;
    height: 180px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wechat-qr-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wechat-qr-placeholder {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.wechat-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.wechat-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 6px;
    word-break: break-all;
}
.wechat-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- 公众号二维码 ---- */
.official-qr-area {
    display: flex;
    justify-content: center;
}
.official-qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    background: linear-gradient(160deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}
.official-qr-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.official-qr-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    border: 4px solid #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}
.official-qr-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.official-qr-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .static-page { padding: 32px 24px; }
    .static-page-title { font-size: 1.5rem; }
    .contact-cards { grid-template-columns: 1fr; }
    .wechat-grid { grid-template-columns: 1fr; }
    .wechat-qr-wrap { width: 150px; height: 150px; }
    .official-qr-img { width: 160px; height: 160px; }
}

/* ========== 教学课堂（academy）—— 结构样式，视觉精修交前端 ========== */
.academy-hero {
    background: var(--surface, #fff);
    border-bottom: 1px solid var(--border, #eee);
    padding: 48px 0 32px;
    text-align: center;
}
.academy-hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.academy-hero-sub { color: var(--text-muted, #666); font-size: 1.05rem; }
.academy-hero-sub strong { color: var(--primary, #6366f1); }

.direction-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding-top: 36px;
    padding-bottom: 12px;
}
.direction-card {
    display: block;
    border: 1px solid var(--border, #eee);
    border-radius: 16px;
    padding: 32px 28px;
    text-decoration: none;
    color: var(--text, #222);
    background: var(--surface, #fff);
    transition: transform .2s ease, box-shadow .2s ease;
}
.direction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
}
.direction-name {
    display: inline-block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary, #6366f1);
    letter-spacing: .05em;
}
.direction-tagline { font-size: 1.5rem; margin: 10px 0; }
.direction-desc { color: var(--text-muted, #666); line-height: 1.6; min-height: 48px; }
.direction-cta {
    display: inline-block;
    margin-top: 16px;
    font-weight: 600;
    color: var(--primary, #6366f1);
}
.direction-empty { color: var(--text-muted, #666); }

.academy-section { padding-top: 28px; padding-bottom: 40px; }
.academy-list-header { padding-top: 36px; padding-bottom: 8px; }
.academy-list-header h1 { font-size: 1.9rem; margin: 8px 0; }
.academy-list-sub { color: var(--text-muted, #666); }
.academy-empty, .direction-empty { color: var(--text-muted, #666); padding: 24px 0; }

/* --- 方向详情页 --- */
.direction-detail-body { padding-bottom: 48px; max-width: 860px; }
.direction-intro-card {
    background: rgba(99,102,241,.06); border-left: 4px solid var(--primary, #6366f1);
    padding: 20px 24px; border-radius: 6px; margin-bottom: 28px;
    font-size: 1.05rem; line-height: 1.7;
}
.direction-block { margin-bottom: 28px; }
.direction-block h2 { font-size: 1.2rem; margin-bottom: 12px; color: var(--text, #222); }
.direction-learn-list { padding-left: 20px; line-height: 2; color: var(--text, #333); }
.direction-learn-list li::marker { color: var(--primary, #6366f1); }
.direction-highlight {
    background: rgba(245,158,11,.08); border-radius: 8px; padding: 20px 24px;
}
.direction-highlight h2 { color: #d97706; }
.direction-cta-block { text-align: center; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border, #eee); }
.direction-cta-text { font-size: 1.1rem; color: var(--text-muted, #666); margin-bottom: 16px; }

.back-link { color: var(--primary, #6366f1); text-decoration: none; font-size: .9rem; }
.back-link:hover { text-decoration: underline; }

.course-detail { padding: 32px 0 48px; max-width: 860px; }
.course-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border, #eee);
    padding-bottom: 24px;
    margin-bottom: 24px;
}
.course-head h1 { font-size: 1.9rem; margin-bottom: 12px; }
.course-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.course-tag {
    font-size: .8rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2, #f3f4f6);
    color: var(--text-muted, #555);
}
.course-tag.free { color: var(--success, #10b981); background: rgba(16,185,129,.12); }
.course-tag.price { color: var(--primary, #6366f1); background: rgba(99,102,241,.12); font-weight: 700; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0; }
.pagination a {
    padding: 8px 16px; border-radius: 8px; text-decoration: none;
    background: var(--surface, #fff); border: 1px solid var(--border, #eee); color: var(--text, #222);
    transition: all .2s;
}
.pagination a:hover { border-color: var(--primary, #6366f1); color: var(--primary, #6366f1); }
.pagination span { color: var(--text-muted, #666); font-size: 0.9rem; }
.course-audience { color: var(--text-muted, #666); }
.course-cta-box { text-align: right; min-width: 200px; }
.btn-enroll {
    display: inline-block;
    background: var(--primary, #6366f1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}
.btn-enroll:hover { opacity: .92; }
.enroll-badge { display: inline-block; color: var(--success, #10b981); font-weight: 600; }
.course-views { display: block; margin-top: 10px; color: var(--text-muted, #888); font-size: .85rem; }
.course-block { margin-bottom: 28px; }
.course-block h2 { font-size: 1.2rem; margin-bottom: 10px; border-left: 3px solid var(--primary, #6366f1); padding-left: 10px; }
.course-rich, .course-block p { line-height: 1.75; color: var(--text, #333); }

@media (max-width: 640px) {
    .direction-split { grid-template-columns: 1fr; }
    .course-cta-box { text-align: left; min-width: 0; }
}

/* 个人中心 - 我的课程（结构样式） */
.course-list-mini { display: flex; flex-direction: column; gap: 10px; }
.course-mini-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border: 1px solid var(--border, #eee);
    border-radius: 10px; text-decoration: none; color: var(--text, #222);
    transition: border-color .2s, background .2s;
}
.course-mini-item:hover { border-color: var(--primary, #6366f1); background: rgba(99,102,241,.04); }
.course-mini-title { font-weight: 600; }
.course-mini-dir { font-size: .8rem; color: var(--text-muted, #666); }

/* ================================================================
 * 质感增强层（原版基础上叠加，不改动已有规则）
 * 原则：同配色(蓝#2563eb)、同布局、只加层次/阴影/过渡/微交互
 * ================================================================ */

/* --- 全局：更丝滑的过渡曲线（覆盖默认 0.2s ease）--- */
.btn,
.source-card,
.direction-card,
.auth-card,
.nav-link,
.course-card,
.course-mini-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ═══════════ 卡片深度增强 ═══════════ */

/* 源码卡片：默认增加微妙多层阴影（原版只有边框无阴影） */
.source-card {
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 12px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.03);
}
/* 源码卡片悬停：更深阴影 + 蓝色光晕边框 */
.source-card:hover {
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.06),
        0 12px 28px rgba(15, 23, 42, 0.08),
        0 20px 48px rgba(37, 99, 235, 0.10);
}

/* 教学课堂方向卡：对齐主色蓝 + 默认阴影 + 悬停提升 */
.direction-card {
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 16px rgba(15, 23, 42, 0.05);
    border-color: rgba(226, 232, 240, 0.85);
}
.direction-name { color: var(--primary); }
.direction-cta { color: var(--primary); }
.direction-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.direction-card:hover {
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.08),
        0 16px 40px rgba(37, 99, 235, 0.07);
    border-color: rgba(37, 99, 235, 0.22);
}

/* 课程卡片（复用源码卡片质感） */
.course-card {
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 12px rgba(15, 23, 42, 0.04);
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.06),
        0 12px 28px rgba(15, 23, 42, 0.08),
        0 20px 48px rgba(37, 99, 235, 0.10);
}

/* 认证卡片（登录/注册）：更柔和的深度 + 微妙内发光 */
.auth-card {
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 8px 30px rgba(15, 23, 42, 0.06),
        0 16px 48px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.55);
}

/* 个人中心课程小条目悬停 */
.course-mini-item:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.03);
    transform: translateX(2px);
}

/* ═══════════ 按钮质感增强 ═══════════ */

/* 危险/成功按钮补齐悬停动效 */
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}
.btn-outline:hover {
    transform: translateY(-1px);
}
.btn-secondary:hover {
    transform: translateY(-1px);
}

/* 主按钮悬停微调：更柔和的光晕 */
.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(37, 99, 235, 0.15);
}

/* Hero 内搜索按钮悬停 */
.hero-search button:hover {
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

/* ═══════════ 区块标题装饰 ═══════════ */

.section-title {
    position: relative;
    padding-left: 18px;
    letter-spacing: 0.02em;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 65%;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

/* ═══════════ Hero 区域微调 ═══════════ */

/* Hero 底部柔和过渡到内容区（消除硬切） */
.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}

/* ═══════════ 页头滚动态 ═══════════ */

.site-header.scrolled {
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.07), 0 2px 16px rgba(15, 23, 42, 0.03);
}

/* ═══════════ 表单输入框聚焦环 ═══════════ */

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* ═══════════ 分页质感 ═══════════ */

.pagination a,
.pagination span {
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pagination a:hover:not(.active) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* ═══════════ 全局细节 ═══════════ */

/* 选中文本颜色 */
::selection {
    background: rgba(37, 99, 235, 0.18);
    color: inherit;
}

/* ═══════════ 进阶质感（同色系内进一步提档，不改变布局/配色）═══════════ */

/* 主按钮：同色系微渐变，比纯色更显高级 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
}

/* 键盘聚焦可见性（高级感细节 + 无障碍） */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* WebKit 滚动条美化 */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.30);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.45);
}

/* ========== 教学课堂（academy）—— premium 视觉精修 ========== */
/* ---- Landing hero ---- */
.academy-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 420px at 50% -12%, rgba(99,102,241,.28), transparent 60%),
        linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
    color: #fff;
    padding: 72px 0 56px;
    text-align: center;
}
.academy-hero-glow {
    position: absolute;
    left: 50%; top: -160px;
    width: 520px; height: 520px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
    pointer-events: none;
}
.academy-hero-inner { position: relative; }
.academy-hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    font-size: .82rem;
    letter-spacing: .08em;
    margin-bottom: 18px;
    backdrop-filter: blur(4px);
}
.academy-hero-title {
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -.01em;
}
.academy-hero-sub {
    font-size: 1.1rem;
    opacity: .9;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.7;
}
.academy-hero-sub strong { color: #fde68a; font-weight: 700; }

/* ---- 方向卡片 ---- */
.direction-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding-top: 44px;
    padding-bottom: 8px;
}
.direction-card {
    position: relative;
    display: block;
    border: 1px solid var(--border, #eceef2);
    border-radius: 20px;
    padding: 36px 32px 32px;
    text-decoration: none;
    color: var(--text, #1f2330);
    background: var(--surface, #fff);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease, border-color .3s ease;
}
.direction-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--accent, #6366f1);
}
.direction-card::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, var(--accent-soft, rgba(99,102,241,.16)), transparent 70%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}
.direction-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(20,20,60,.14);
    border-color: var(--accent, #6366f1);
}
.direction-card:hover::after { opacity: 1; }
.direction-icon {
    width: 64px; height: 64px;
    display: grid; place-items: center;
    font-size: 30px;
    border-radius: 16px;
    background: var(--accent-soft, rgba(99,102,241,.12));
    margin-bottom: 18px;
    transition: transform .3s ease;
}
.direction-card:hover .direction-icon { transform: scale(1.08) rotate(-4deg); }
.direction-name {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--accent, #6366f1);
    background: var(--accent-soft, rgba(99,102,241,.12));
    padding: 4px 12px;
    border-radius: 999px;
}
.direction-tagline {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 14px 0 10px;
    letter-spacing: -.01em;
}
.direction-desc {
    color: var(--text-muted, #666);
    line-height: 1.7;
    min-height: 52px;
}
.direction-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-weight: 700;
    color: var(--accent, #6366f1);
    transition: gap .25s ease;
}
.direction-card:hover .direction-cta { gap: 12px; }

/* 两方向性格色 */
.direction-ai-coding { --accent: #6366f1; --accent-soft: rgba(99,102,241,.12); }
.direction-monetize { --accent: #f59e0b; --accent-soft: rgba(245,158,11,.14); }

.direction-empty { color: var(--text-muted, #666); padding: 24px 0; }

.academy-footnote {
    text-align: center;
    padding: 28px 0 52px;
    color: var(--text-muted, #777);
    font-size: .98rem;
}
.academy-footnote strong { color: var(--text, #333); }

/* ---- 方向详情 hero ---- */
.direction-hero {
    position: relative;
    overflow: hidden;
    padding: 64px 0 52px;
    color: #fff;
    text-align: center;
}
.direction-hero-glow {
    position: absolute;
    left: 50%; top: -140px;
    transform: translateX(-50%);
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
    pointer-events: none;
}
.direction-hero-ai-coding { background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #8b5cf6); }
.direction-hero-monetize { background: linear-gradient(135deg, #d97706, #f59e0b 55%, #ef4444); }
.direction-hero-default { background: linear-gradient(135deg, #475569, #6366f1); }
.direction-hero-inner { position: relative; }
.direction-back {
    display: inline-block;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .88rem;
    margin-bottom: 18px;
}
.direction-back:hover { color: #fff; text-decoration: underline; }
.direction-hero-icon {
    width: 84px; height: 84px;
    margin: 0 auto 18px;
    display: grid; place-items: center;
    font-size: 42px;
    background: rgba(255,255,255,.16);
    border-radius: 22px;
    backdrop-filter: blur(6px);
}
.direction-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -.01em;
}
.direction-hero-sub { font-size: 1.1rem; opacity: .92; }

/* ---- 详情正文 ---- */
.direction-detail-body { padding-bottom: 56px; max-width: 880px; }
.direction-intro-card {
    background: rgba(99,102,241,.06);
    border-left: 4px solid #6366f1;
    padding: 22px 26px;
    border-radius: 8px;
    margin: 32px 0 36px;
    font-size: 1.08rem;
    line-height: 1.8;
}
.direction-block { margin-bottom: 34px; }
.direction-block-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text, #1f2330);
}
.db-ico { font-size: 1.3rem; }
.direction-block-text {
    color: var(--text, #333);
    line-height: 1.8;
    font-size: 1.02rem;
}
.direction-learn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.direction-learn-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #eceef2);
    border-radius: 12px;
    padding: 14px 16px;
    line-height: 1.55;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.direction-learn-item:hover {
    transform: translateY(-3px);
    border-color: #6366f1;
    box-shadow: 0 10px 24px rgba(20,20,60,.08);
}
.learn-check {
    flex: none;
    width: 22px; height: 22px;
    margin-top: 1px;
    display: grid; place-items: center;
    background: #6366f1;
    color: #fff;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
}
.direction-value {
    background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(236,72,189,.1));
    border: 1px solid rgba(245,158,11,.3);
    border-radius: 16px;
    padding: 26px 30px;
    margin-bottom: 36px;
}
.direction-value-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #b45309;
}
.direction-value p {
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--text, #333);
}
.direction-cta-block {
    text-align: center;
    margin-top: 40px;
    padding: 36px 24px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 20px;
    color: #fff;
}
.direction-cta-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 18px;
}
.btn-enroll {
    display: inline-block;
    padding: 14px 38px;
    background: #fff;
    color: #4f46e5;
    font-weight: 700;
    font-size: 1.02rem;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}
.btn-enroll:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

/* ---- 响应式 ---- */
@media (max-width: 760px) {
    .direction-split { grid-template-columns: 1fr; }
    .direction-learn-grid { grid-template-columns: 1fr; }
}
