/* ============================================================
   周易大学堂 · 全站统一UI规范
   基准：会员中心高级灰风格
   ============================================================ */

/* ===== 色彩变量 ===== */
:root {
    /* 主色 */
    --primary: #3d4452;
    --primary-hover: #2d3436;
    --primary-light: #5c5470;
    --primary-gradient: linear-gradient(135deg, #5c5470, #3d4452);

    /* 金色（VIP/强调） */
    --gold: #c9a96e;
    --gold-dark: #a08040;
    --gold-gradient: linear-gradient(135deg, #c9a96e, #a08040);

    /* 文字 */
    --text: #2d3436;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* 背景 */
    --bg: #F0ECE4;
    --bg-card: #ffffff;
    --bg-soft: #f7f8fa;
    --bg-softer: #f3f4f6;

    /* 边框 */
    --border: #e5e7eb;
    --border-light: #f0ebe3;

    /* 功能色 */
    --success: #52c41a;
    --warning: #faad14;
    --danger: #f56c6c;
    --info: #1890ff;

    /* 圆角 */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;

    /* 阴影 */
    --shadow-sm: 0 1px 4px rgba(45,52,54,0.06);
    --shadow: 0 2px 12px rgba(45,52,54,0.06);
    --shadow-lg: 0 4px 20px rgba(45,52,54,0.1);

    /* 字体 */
    --font-serif: "Source Han Serif CN", "Noto Serif SC", "STSong", "SimSun", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }

/* ===== 统一导航栏 ===== */
.zydx-nav {
    background: var(--primary-gradient);
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(61,68,82,0.2);
}
.zydx-nav-brand {
    color: #F0E4C8;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.zydx-nav-brand .logo-dot {
    width: 28px; height: 28px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
}
.zydx-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.zydx-nav-links a {
    color: rgba(240,228,200,0.85);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all .2s;
    white-space: nowrap;
}
.zydx-nav-links a:hover,
.zydx-nav-links a.active {
    color: #F0E4C8;
    background: rgba(255,255,255,0.12);
}
.zydx-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.zydx-nav-user .nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.zydx-nav-user a {
    color: rgba(240,228,200,0.85);
    font-size: 14px;
}

/* 移动端导航简化 */
@media (max-width: 640px) {
    .zydx-nav { padding: 0 12px; height: 48px; }
    .zydx-nav-brand { font-size: 15px; }
    .zydx-nav-brand .logo-dot { width: 24px; height: 24px; font-size: 12px; }
    .zydx-nav-links { display: none; }
    .zydx-nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0; right: 0;
        background: var(--primary);
        padding: 8px 12px;
        gap: 2px;
    }
    .zydx-nav-links.mobile-open a { padding: 10px 12px; }
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        padding: 6px;
    }
    .nav-toggle span {
        width: 20px; height: 2px;
        background: #F0E4C8;
        border-radius: 1px;
    }
}
.nav-toggle { display: none; }

/* ===== 统一卡片 ===== */
.zydx-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.zydx-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.zydx-card-body { padding: 16px; }

/* ===== 统一按钮 ===== */
.zydx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.zydx-btn-primary {
    background: var(--primary-gradient);
    color: #F0E4C8;
}
.zydx-btn-primary:hover { opacity: .9; color: #F0E4C8; }
.zydx-btn-gold {
    background: var(--gold-gradient);
    color: #fff;
}
.zydx-btn-gold:hover { opacity: .9; color: #fff; }
.zydx-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.zydx-btn-outline:hover { background: var(--primary); color: #fff; }
.zydx-btn-danger { background: var(--danger); color: #fff; }
.zydx-btn-sm { padding: 5px 12px; font-size: 12px; }
.zydx-btn-lg { padding: 12px 28px; font-size: 16px; }
.zydx-btn-block { width: 100%; }

/* ===== 统一表单 ===== */
.zydx-form-group { margin-bottom: 16px; }
.zydx-form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}
.zydx-input,
.zydx-select,
.zydx-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.zydx-input:focus,
.zydx-select:focus,
.zydx-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,68,82,0.1);
}
.zydx-textarea { resize: vertical; min-height: 80px; }

/* ===== 统一徽章 ===== */
.zydx-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: var(--radius-full);
    font-weight: 500;
}
.zydx-badge-gold { background: var(--gold-gradient); color: #fff; }
.zydx-badge-gray { background: var(--bg-softer); color: var(--text-secondary); }
.zydx-badge-green { background: #e8f5e9; color: #2e7d32; }
.zydx-badge-red { background: #ffebee; color: #c62828; }

/* ===== 统一容器 ===== */
.zydx-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== 统一提示消息 ===== */
.zydx-msg {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}
.zydx-msg-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.zydx-msg-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.zydx-msg-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* ===== 统一空状态 ===== */
.zydx-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.zydx-empty-icon { font-size: 42px; margin-bottom: 12px; opacity: .4; }
.zydx-empty-text { font-size: 14px; }

/* ===== 统一底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(45,52,54,0.05);
    z-index: 100;
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    transition: color .2s;
    gap: 2px;
}
.bottom-nav a:hover { color: var(--primary); }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav .nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav .nav-label { font-size: 11px; }
