/* ============================================================
   app.css — AI易学 App 端共享视觉规范与公共组件样式
   被 index.html / reports.html / profile.html 复用，避免重复定义。
   （Design Tokens 与 reports.html / profile.html 保持一致）
   ============================================================ */

:root {
    /* ===== Design Tokens ===== */
    --canvas: #F7F7F7;
    --primary: #07C160;          /* 品牌绿 */
    --primary-dark: #06AE56;
    --primary-tint: #E8F7F0;     /* 浅绿底（图标底 / 选中态底） */
    --ink: #29241F;              /* 墨色标题 */
    --label: #363636;
    --helper: #6E6E6E;
    --caption: #A89C87;
    --cinnabar: #B03A24;         /* 退出登录（暖红） */
    --border: #E6E6E6;
    --divider: #E6E6E6;
    --accent: #E8760A;           /* 橙色（通知 / 解读中） */
    --tint-ink: #F1ECE3;         /* 暖灰底（隐私设置图标） */
    --tint-ink-c: #8A7B66;
    /* 圆角 */
    --radius-card: 16px;
    --radius-field: 12px;
    --radius-login: 14px;
    /* 阴影 */
    --shadow-card: 0 1px 2px rgba(41,33,23,.04), 0 6px 16px rgba(41,33,23,.06);
    --shadow-cta: 0 6px 14px rgba(7,193,96,.25);
    --font-serif: "Noto Serif SC", "Songti SC", serif;
    --font-sans: "Noto Sans SC", -apple-system, sans-serif;
    /* 兼容别名 */
    --bg-card: #FFFFFF;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background-color: var(--canvas);
    color: var(--ink);
    margin: 0; padding: 0;
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 16px; padding-bottom: 83px; /* 给底部 Tab Bar 留白 */
    -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 480px; background: transparent; }

/* ===== 顶部 Header（与首页 / 报告一致） ===== */
.header {
    background: transparent; color: var(--ink);
    padding: 8px 20px 6px; text-align: left; position: relative;
}
h1 {
    font-family: var(--font-serif);
    color: #000; font-size: 26px; font-weight: 600;
    text-align: left; margin: 14px 0 10px; letter-spacing: 1px;
}
.header p {
    text-align: left; color: var(--helper); font-size: 12px; margin: 0;
}

.copyright {
    text-align: center; color: var(--helper); font-size: 10px;
    line-height: 16px; margin: 12px 20px 4px;
}
.copyright a { color: var(--helper); }

/* ===== 箭头（chevron） ===== */
.chev { width: 16px; height: 16px; color: #A89C88; flex: none; stroke-width: 2; fill: none; }

/* ===== 底部 Tab Bar（公共导航组件） ===== */
.tabbar {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: 0; width: 100%; max-width: 480px; height: 83px;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box; background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex; z-index: 500;
}
.tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--helper); font-size: 10px; font-weight: 500; cursor: pointer;
}
.tabbar .tab svg { width: 24px; height: 24px; }
.tabbar .tab.active, .tabbar .tab.active svg { color: #07C161; }

/* ===== 详情 / 列表 底部抽屉（公共组件） ===== */
.sheet-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 900;
}
.sheet-mask.show { opacity: 1; visibility: visible; }
.detail-sheet {
    position: fixed; left: 50%; transform: translateX(-50%) translateY(100%);
    bottom: 0; width: 100%; max-width: 480px;
    background: var(--bg-card); border-radius: 16px 16px 0 0;
    z-index: 901; max-height: 84vh; display: flex; flex-direction: column;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.detail-sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px; border-bottom: 1px solid var(--divider);
}
.sheet-head .title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.sheet-close {
    width: 28px; height: 28px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--helper);
}
.sheet-close svg { width: 20px; height: 20px; }
.sheet-body { padding: 16px 20px 28px; overflow-y: auto; }
.detail-section { margin-bottom: 16px; }
.detail-section h3 {
    font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--ink);
    margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
}
.detail-section h3::before {
    content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--primary);
}
.detail-section p { font-size: 13px; line-height: 1.7; color: var(--helper); margin: 0; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 14px; }
.detail-meta .item { font-size: 12px; color: var(--helper); }
.detail-meta .item b { color: var(--label); font-weight: 600; margin-right: 4px; }
.detail-cta {
    width: 100%; height: 50px; margin-top: 8px;
    background: #07C161; color: #fff; border: none; border-radius: var(--radius-field);
    font-size: 15px; font-weight: 600; letter-spacing: 2px; cursor: pointer;
    box-shadow: var(--shadow-cta); transition: background .2s ease;
}
.detail-cta:hover { background: var(--primary-dark); }

/* ===== 轻量登录弹层（公共组件；风格统一） ===== */
.auth-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: none; align-items: center; justify-content: center;
    z-index: 950; padding: 24px;
}
.auth-mask.show { display: flex; }
.auth-card {
    width: 100%; max-width: 340px; background: #fff; border-radius: 16px;
    padding: 26px 22px; box-sizing: border-box; position: relative;
}
.auth-card .auth-close {
    position: absolute; top: 14px; right: 14px; border: none; background: transparent;
    cursor: pointer; color: var(--helper); width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
}
.auth-card .app-name { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); text-align: center; }
.auth-card .app-sub { font-size: 11px; color: var(--caption); text-align: center; margin: 4px 0 18px; }
.auth-card .field {
    display: flex; align-items: center; gap: 10px; height: 46px;
    border: 1px solid var(--border); border-radius: var(--radius-field);
    padding: 0 14px; margin-bottom: 12px;
}
.auth-card .field svg { width: 18px; height: 18px; color: var(--caption); flex: none; }
.auth-card .field input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.auth-card .field input::placeholder { color: var(--caption); }
.auth-card .submit {
    width: 100%; height: 48px; margin-top: 6px; background: #07C161; color: #fff;
    border: none; border-radius: var(--radius-field); font-size: 15px; font-weight: 600;
    letter-spacing: 2px; cursor: pointer; box-shadow: var(--shadow-cta);
}
.auth-card .hint { font-size: 11px; color: var(--caption); text-align: center; margin-top: 12px; }

/* ===== 响应式（公共） ===== */
@media (max-width: 768px) {
    body { padding-top: 1px; }
}
@media (max-width: 320px) {
    h1 { font-size: 24px; letter-spacing: 0; }
}
