﻿/* ===== 语考通 - 公共样式 ===== */

/* 全局变量 */
:root {
    --primary: #1A56DB;
    --primary-light: #E8EFFE;
    --gold: #F59E0B;
    --gold-light: #FEF3C7;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ===== 页眉 ===== */
.ykt-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.ykt-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.ykt-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.ykt-logo span { color: var(--gold); }

/* ===== 导航 ===== */
.ykt-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.ykt-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1.15;
    min-width: 56px;
}
.ykt-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.ykt-nav a.active {
    background: var(--primary);
    color: #fff;
}
.ykt-nav a .nav-cn {
    font-size: 15px;
    line-height: 1.2;
}
.ykt-nav a .nav-en {
    font-size: 10px;
    line-height: 1.1;
    opacity: 0.7;
    margin-top: 1px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== 汉堡按钮 - 电脑端默认隐藏 ===== */
.ykt-nav-toggle {
    display: none;
}

.ykt-search {
    flex: 1;
    max-width: 320px;
    position: relative;
}
.ykt-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.ykt-search input:focus { border-color: var(--primary); }
.ykt-search::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
}
.ykt-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.ykt-user a {
    color: var(--primary);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--primary);
    border-radius: 16px;
    transition: all 0.2s;
}
.ykt-user a:hover { background: var(--primary); color: #fff; }
.ykt-user .ykt-vip-btn {
    background: linear-gradient(135deg, var(--gold), #F97316);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
}

/* ===== Hero ===== */
.ykt-hero {
    background: linear-gradient(135deg, #1A56DB 0%, #3B82F6 100%);
    color: #fff;
    padding: 48px 20px 56px;
    text-align: center;
}
.ykt-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}
.ykt-hero h1 span { color: var(--gold); }
.ykt-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 28px;
}
.ykt-hero-search {
    max-width: 520px;
    margin: 0 auto;
}
.ykt-hero-search input {
    width: 100%;
    padding: 14px 20px 14px 44px;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    outline: none;
    background: rgba(255,255,255,0.95);
}

/* ===== 考试入口宫格 ===== */
.ykt-categories {
    max-width: 1200px;
    margin: -32px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}
.ykt-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.ykt-cat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.25s;
}
.ykt-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.ykt-cat-icon { font-size: 32px; margin-bottom: 8px; }
.ykt-cat-name { font-size: 15px; font-weight: 600; }
.ykt-cat-count { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== 主内容区 ===== */
.ykt-main {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

/* ===== 热门资料列表 ===== */
.ykt-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ykt-section-title::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}
.ykt-resource-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ykt-resource-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.ykt-resource-item:hover { box-shadow: var(--shadow-hover); }
.ykt-res-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ykt-res-info { flex: 1; }
.ykt-res-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}
.ykt-res-title:hover { color: var(--primary); }
.ykt-res-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 12px;
}
.ykt-res-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.ykt-tag-free { background: #DCFCE7; color: #16A34A; }
.ykt-tag-vip { background: #FEF3C7; color: #D97706; }
.ykt-tag-points { background: #E0E7FF; color: #4F46E5; }
.ykt-res-download { text-align: right; flex-shrink: 0; }
.ykt-download-btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.ykt-download-btn:hover { background: #1548C0; }
.ykt-download-btn.gold { background: var(--gold); }
.ykt-download-btn.gold:hover { background: #D97706; }

/* ===== 侧边栏 ===== */
.ykt-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* 会员卡 */
.ykt-vip-card {
    background: linear-gradient(135deg, #F59E0B, #F97316);
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    text-align: center;
}
.ykt-vip-card h3 { font-size: 18px; margin-bottom: 6px; }
.ykt-vip-card p { font-size: 13px; opacity: 0.9; margin-bottom: 16px; }
.ykt-vip-plans {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}
.ykt-vip-plan {
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    flex: 1;
}
.ykt-vip-plan .price { font-size: 18px; font-weight: 800; }
.ykt-vip-plan .unit { font-size: 11px; opacity: 0.85; }
.ykt-vip-plan .label { font-size: 11px; opacity: 0.9; }
.ykt-vip-cta {
    display: block;
    background: #fff;
    color: var(--gold);
    padding: 10px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* 排行榜 */
.ykt-rank-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.ykt-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.ykt-rank-item:last-child { border-bottom: none; }
.ykt-rank-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.ykt-rank-num.top3 { background: var(--gold); color: #fff; }
.ykt-rank-title { flex: 1; color: var(--text); text-decoration: none; }
.ykt-rank-title:hover { color: var(--primary); }
.ykt-rank-downloads { font-size: 12px; color: var(--text-light); white-space: nowrap; }

/* ===== 页脚 ===== */
.ykt-footer {
    background: #1E293B;
    color: rgba(255,255,255,0.8);
    padding: 40px 20px 20px;
    margin-top: 60px;
}
.ykt-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.ykt-footer-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}
.ykt-footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 12px;
}
.ykt-footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
}
.ykt-footer-col a:hover { color: #fff; }
.ykt-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
}
.ykt-footer-bottom p { margin: 4px 0; }

/* ===== 最新上传 ===== */
.ykt-latest-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}
.ykt-latest-inner { max-width: 100%; }
.ykt-latest-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.ykt-latest-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.ykt-latest-item:hover { box-shadow: var(--shadow-hover); }
.ykt-latest-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.ykt-latest-info { flex: 1; min-width: 0; }
.ykt-latest-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ykt-latest-title:hover { color: var(--primary); }
.ykt-latest-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    gap: 10px;
}
.ykt-latest-more {
    text-align: center;
    margin-top: 20px;
}
.ykt-latest-more a {
    display: inline-block;
    padding: 10px 28px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.ykt-latest-more a:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== 精选合集（横滑） ===== */
.ykt-collection-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 48px;
}
.ykt-collection-inner { max-width: 100%; }
.ykt-collection-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.ykt-collection-scroll::-webkit-scrollbar {
    height: 6px;
}
.ykt-collection-scroll::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}
.ykt-collection-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.ykt-collection-card {
    flex: 0 0 280px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.25s;
    scroll-snap-align: start;
}
.ykt-collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.ykt-collection-cover {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ykt-collection-emoji {
    font-size: 42px;
}
.ykt-collection-info {
    padding: 14px 16px;
}
.ykt-collection-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.ykt-collection-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.4;
}
.ykt-collection-count {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .ykt-cat-grid { grid-template-columns: repeat(3, 1fr); }
    .ykt-main { grid-template-columns: 1fr; }
    .ykt-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
    .ykt-footer-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ykt-topbar-inner { flex-wrap: wrap; gap: 10px; }

    /* 手机端才显示汉堡按钮 */
    .ykt-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--primary-light);
        border: none;
        border-radius: 8px;
        font-size: 18px;
        cursor: pointer;
        flex-shrink: 0;
    }
    .ykt-nav-toggle:focus { outline: none; }

    /* 导航默认收起 */
    .ykt-nav {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        transition: max-height 0.3s ease;
        display: flex;
    }
    .ykt-nav.open {
        max-height: 400px;
        overflow: visible;
    }
    .ykt-nav a {
        padding: 14px 16px;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        min-width: auto;
    }
    .ykt-nav a:last-child { border-bottom: none; }
    .ykt-nav a .nav-cn {
        font-size: 15px;
        line-height: 1.2;
    }
    .ykt-nav a .nav-en {
        font-size: 11px;
        opacity: 0.6;
        margin-top: 0;
    }
    .ykt-nav a.active {
        background: var(--primary-light);
        color: var(--primary);
    }

    .ykt-search { max-width: 200px; }

    .ykt-latest-grid { grid-template-columns: 1fr; }
    .ykt-latest-item { padding: 12px; }
    .ykt-latest-title { white-space: normal; }
    .ykt-collection-card { flex: 0 0 240px; }
    .ykt-collection-cover { height: 80px; }
    .ykt-collection-emoji { font-size: 32px; }

    /* 移动端搜索按钮 */
    .ykt-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--primary-light);
        border: none;
        border-radius: 8px;
        font-size: 18px;
        cursor: pointer;
        flex-shrink: 0;
        margin-left: 8px;
    }

    /* 移动端搜索框默认隐藏 */
    .ykt-search {
        display: none;
        order: 4;
        width: 100%;
        max-width: 100%;
        padding: 8px 0 0;
    }

    .ykt-search.ykt-search-open {
        display: block;
    }

    .ykt-search.ykt-search-open input {
        border-radius: 8px;
        padding: 12px 14px 12px 36px;
        font-size: 16px;
    }
    
}

@media (max-width: 640px) {
    .ykt-hero h1 { font-size: 24px; }
    .ykt-hero p { font-size: 14px; }
    .ykt-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ykt-cat-card { padding: 16px 10px; }
    .ykt-cat-icon { font-size: 26px; }
    .ykt-sidebar { grid-template-columns: 1fr; }
    .ykt-resource-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .ykt-res-download { text-align: left; width: 100%; }
    .ykt-download-btn { width: 100%; text-align: center; }
    .ykt-vip-plans { flex-direction: column; }
    .ykt-footer-cols { grid-template-columns: 1fr; }
    .ykt-latest-section { padding: 0 16px 32px; }
    .ykt-collection-section { padding: 0 16px 40px; }
}

/* ===== 登录后用户下拉菜单 ===== */
.ykt-user-menu {
    position: relative;
    display: inline-block;
}

.ykt-user-btn {
    color: #fff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    transition: background 0.2s;
    white-space: nowrap;
}

.ykt-user-btn:hover {
    background: rgba(255,255,255,0.25);
}

.ykt-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 130px;
    padding: 6px 0;
    display: none;
    z-index: 100;
}

.ykt-user-menu:hover .ykt-user-dropdown {
    display: block;
}

.ykt-user-dropdown a {
    display: block;
    padding: 9px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.ykt-user-dropdown a:hover {
    background: #f8fafc;
    color: #1e63f4;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ykt-user-dropdown {
        right: auto;
        left: 0;
    }
}

/* ===== 登录后用户按钮 ===== */
.ykt-member-btn {
    color: #1e63f4 !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid #1e63f4;
    border-radius: 16px;
    background: #fff;
    transition: background 0.2s;
}

.ykt-member-btn:hover {
    background: #f0f7ff;
}

.ykt-logout-btn {
    color: #999 !important;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    margin-left: 4px;
}

.ykt-logout-btn:hover {
    color: #e53e3e !important;
}