/* =========================================================
   安安小镇 · 校园安全学习平台
   卡通教育风 / 浅色主题
   ========================================================= */

:root {
    --ink: #202B46;
    --ink-2: #33415F;
    --muted: #74829E;
    --muted-2: #94A1BA;
    --line: #E6EDFB;
    --line-2: #D9E4F8;
    --bg: #F6F9FF;
    --card: #FFFFFF;
    --blue: #4F7CFF;
    --blue-2: #6E93FF;
    --blue-soft: #EAF0FF;
    --mint: #2FBF9B;
    --mint-soft: #E4F8F2;
    --sun: #FFC93C;
    --sun-soft: #FFF6D8;
    --coral: #FF6B6B;
    --coral-soft: #FFECEC;
    --purple: #A78BFA;
    --purple-soft: #F2EDFF;
    --orange: #FF9F43;
    --orange-soft: #FFF0E1;
    --pink: #FF8FB1;
    --shadow: 0 14px 34px rgba(31, 56, 122, .08);
    --shadow-sm: 0 6px 18px rgba(31, 56, 122, .07);
    --radius: 24px;
    --radius-sm: 16px;
    --font: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(560px 360px at 6% -6%, rgba(79, 124, 255, .10), transparent 70%),
        radial-gradient(520px 320px at 96% 4%, rgba(255, 201, 60, .13), transparent 70%),
        radial-gradient(600px 400px at 50% 110%, rgba(47, 191, 155, .08), transparent 70%);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #3C66E8; }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: .01em; }
p { margin: 0; }

::selection { background: #CFE0FF; }

:focus-visible { outline: 3px solid rgba(79, 124, 255, .45); outline-offset: 2px; }

/* ---------- 布局 ---------- */

.page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 20px 90px;
}

.page-narrow { max-width: 900px; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

/* ---------- 顶部导航 ---------- */

.site-top {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(217, 228, 248, .8);
}

.top-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(79, 124, 255, .16)); }
.brand-name { font-size: 21px; font-weight: 900; color: var(--ink); letter-spacing: .02em; }
.brand-sub { font-size: 10px; color: var(--muted-2); letter-spacing: .18em; margin-top: -3px; }

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
    padding: 9px 12px;
    border-radius: 999px;
    color: #536182;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    transition: .18s ease;
}
.nav a:hover { background: #F1F5FF; color: var(--blue); }
.nav a.active { background: var(--blue-soft); color: var(--blue); }

.top-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.points-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--sun-soft);
    color: #A76A00;
    font-weight: 800;
    font-size: 13px;
    border: 1px solid #FCE7A8;
}

.top-avatar { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; transition: .18s; }
.top-avatar:hover { background: #F1F5FF; }

/* 教师/管理员 · 工作台入口按钮（学生页页头） */
.ws-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(79, 124, 255, .32);
    transition: .18s;
}
.ws-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(79, 124, 255, .42); filter: brightness(1.05); }

/* 教师/管理员 · 首页身份横幅 */
.role-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 18px 0 4px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: linear-gradient(120deg, #EEF3FF, #F6EDFF);
    border: 1px dashed #C9D8FB;
}
.role-banner .rb-ico {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.role-banner .rb-copy { flex: 1 1 220px; display: flex; flex-direction: column; line-height: 1.5; }
.role-banner .rb-copy strong { font-size: 15.5px; color: var(--ink); }
.role-banner .rb-copy span { font-size: 13px; color: var(--muted); }
.top-avatar .who { font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.2; }
.top-avatar .who small { display: block; color: var(--muted-2); font-size: 11px; font-weight: 600; }

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 16px;
    transition: .18s;
}
.icon-btn:hover { border-color: #C9D8F5; color: var(--blue); background: #F8FAFF; }

/* ---------- 按钮 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #F0F4FF;
    color: var(--ink-2);
    font-weight: 800;
    font-size: 14px;
    line-height: 1.2;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
    text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, var(--blue), #6F94FF); color: #fff; box-shadow: 0 10px 22px rgba(79, 124, 255, .28); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 26px rgba(79, 124, 255, .34); }

.btn-sun { background: linear-gradient(135deg, #FFD25C, #FFB800); color: #6B4700; box-shadow: 0 10px 22px rgba(255, 184, 0, .24); }
.btn-sun:hover { color: #6B4700; }

.btn-mint { background: linear-gradient(135deg, #48D3B0, #22B58F); color: #fff; box-shadow: 0 10px 22px rgba(47, 191, 155, .24); }
.btn-mint:hover { color: #fff; }

.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: #BFD1F3; color: var(--blue); }

.btn-danger { background: var(--coral-soft); color: #D33A3A; }
.btn-danger:hover { background: #FFDCDC; color: #B92B2B; }

.btn-sm { padding: 7px 12px; border-radius: 11px; font-size: 12.5px; }
.btn-xs { padding: 5px 9px; border-radius: 9px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; border-radius: 16px; font-size: 16px; }

/* ---------- 卡片 / 面板 ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card-flat { box-shadow: var(--shadow-sm); }
.card-tight { padding: 16px; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 20px 38px rgba(31, 56, 122, .11); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 900; }
.section-title .bubble {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: var(--blue-soft);
}
.section-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 标签 ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #F2F6FF;
    color: #52648A;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.chip-blue { background: var(--blue-soft); color: #3763DE; }
.chip-mint { background: var(--mint-soft); color: #168F70; }
.chip-sun { background: var(--sun-soft); color: #9B6600; }
.chip-coral { background: var(--coral-soft); color: #CF4040; }
.chip-purple { background: var(--purple-soft); color: #7957D6; }
.chip-orange { background: var(--orange-soft); color: #B36A16; }

.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- 首页 Hero ---------- */

.hero {
    position: relative;
    min-height: 330px;
    border-radius: 30px;
    overflow: hidden;
    background: #D9EDFF;
    box-shadow: 0 24px 50px rgba(42, 86, 170, .16);
    isolation: isolate;
}
.hero > img.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
    z-index: -2;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(255, 255, 255, .97) 0%, rgba(255, 255, 255, .9) 34%, rgba(255, 255, 255, .35) 58%, rgba(255, 255, 255, 0) 78%);
}
.hero-copy { position: relative; max-width: 560px; padding: 40px 38px; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 800;
    color: #4C628F;
    margin-bottom: 14px;
}
.hero h1 { font-size: clamp(27px, 3.3vw, 40px); font-weight: 900; letter-spacing: .01em; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p.lead { margin-top: 12px; font-size: 14.5px; color: #536182; max-width: 470px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-mini { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.hero-mini div { font-size: 12px; color: #64749A; }
.hero-mini strong { display: block; font-size: 20px; color: var(--ink); line-height: 1.2; }

/* ---------- 数据卡 ---------- */

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 13px;
}
.stat .ico {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: var(--blue-soft);
    flex: 0 0 auto;
}
.stat .num { font-size: 23px; font-weight: 900; line-height: 1.15; }
.stat .lab { font-size: 12px; color: var(--muted); font-weight: 600; }

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

/* ---------- 进度 ---------- */

.progress { height: 9px; border-radius: 999px; background: #EDF2FE; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6E93FF, #4F7CFF); }
.progress.thin { height: 6px; }
.progress.mint > i { background: linear-gradient(90deg, #61E0C2, #2FBF9B); }
.progress.sun > i { background: linear-gradient(90deg, #FFD966, #FFB800); }
.progress.coral > i { background: linear-gradient(90deg, #FF9A9A, #FF6B6B); }
.progress.purple > i { background: linear-gradient(90deg, #C4B5FD, #A78BFA); }

/* ---------- 部落 / 英雄 ---------- */

.tribe-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: .2s ease;
}
.tribe-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    right: -45px;
    top: -45px;
    background: var(--tone, #EAF0FF);
    opacity: .7;
}
.tribe-card:hover { transform: translateY(-4px); box-shadow: 0 20px 38px rgba(31, 56, 122, .12); }
.tribe-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: var(--tone, #EAF0FF);
    position: relative;
    z-index: 1;
}
.tribe-card h3 { font-size: 18px; font-weight: 900; margin-top: 12px; position: relative; z-index: 1; }
.tribe-card .sub { font-size: 12px; color: var(--muted); position: relative; z-index: 1; }
.tribe-card p.desc { font-size: 13px; color: #5D6D8E; margin-top: 8px; position: relative; z-index: 1; }
.tribe-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; position: relative; z-index: 1; }
.tribe-card { cursor: pointer; }
.tribe-card:hover .tribe-go { transform: translateX(4px); }
.tribe-go { font-size: 22px; font-weight: 900; color: var(--tone, #4F7CFF); margin-left: 12px; transition: transform .2s ease; flex: none; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.filter-bar .btn { flex: none; }

.hero-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: .2s ease;
}
.hero-card:hover { transform: translateY(-3px); box-shadow: 0 18px 32px rgba(31, 56, 122, .11); }
.hero-card .halo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 38px;
    background: var(--tone, #EAF0FF);
    box-shadow: inset 0 0 0 5px #fff;
    margin-bottom: 12px;
}
.hero-card h3 { font-size: 17px; font-weight: 900; }
.hero-card .title { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero-card .slogan { margin-top: 10px; font-size: 13px; color: #536182; background: #F8FAFF; border-radius: 12px; padding: 10px 12px; }
.hero-card .skills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

/* ---------- 任务 ---------- */

.task-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    transition: .18s ease;
}
.task-item:hover { border-color: #CBD9F7; background: #FCFDFF; }
.task-item.done { background: #F9FBF9; border-color: #DDF1E7; }
.task-ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: var(--tone, var(--blue-soft));
    flex: 0 0 auto;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 800; font-size: 15px; }
.task-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.task-points { font-weight: 900; color: #B57900; font-size: 13px; background: var(--sun-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* ---------- 勋章 ---------- */

.badge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.badge-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.badge-card .medal {
    width: 72px;
    height: 72px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 34px;
    background: var(--tone, #FFF6D8);
    box-shadow: inset 0 0 0 5px #fff, 0 8px 18px rgba(31, 56, 122, .10);
}
.badge-card h4 { font-size: 14.5px; font-weight: 900; }
.badge-card .desc { font-size: 11.5px; color: var(--muted); margin-top: 4px; min-height: 36px; }
.badge-card.locked { opacity: .62; filter: saturate(.25); }
.badge-card.locked .medal { box-shadow: inset 0 0 0 5px #fff; }
.badge-card .unlocked-tag { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; color: #148A6C; background: #E4F8F2; border-radius: 999px; padding: 2px 7px; }

/* ---------- 排行榜 ---------- */

.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #EDF2FC; }
.rank-row:last-child { border-bottom: 0; }
.rank-no {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #F2F6FF;
    color: #62739A;
    font-size: 12px;
    font-weight: 900;
    flex: 0 0 auto;
}
.rank-row:nth-child(1) .rank-no { background: linear-gradient(135deg, #FFE082, #FFC93C); color: #7A4E00; }
.rank-row:nth-child(2) .rank-no { background: #E8EEF9; color: #5A6B8C; }
.rank-row:nth-child(3) .rank-no { background: #FFE3CC; color: #A85E12; }
.rank-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.rank-name small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.rank-points { font-weight: 900; color: var(--blue); font-size: 14px; }

/* ---------- 问小安 ---------- */

.qa-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.qa-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 560px;
}
.qa-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(120deg, #EDF3FF, #F7FAFF);
    border-bottom: 1px solid var(--line);
}
.qa-head .mascot { width: 52px; height: 52px; object-fit: contain; }
.qa-head h3 { font-size: 17px; font-weight: 900; }
.qa-head p { font-size: 12px; color: var(--muted); }
.qa-msgs { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #FBFDFF, #F7FAFF); }
.qmsg { display: flex; gap: 9px; max-width: 86%; }
.qmsg .who { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); font-size: 18px; flex: 0 0 auto; }
.qmsg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 12px 15px; font-size: 14px; white-space: pre-wrap; line-height: 1.72; box-shadow: var(--shadow-sm); }
.qmsg.user { margin-left: auto; flex-direction: row-reverse; }
.qmsg.user .bubble { background: linear-gradient(135deg, #5D87FF, #4F7CFF); color: #fff; border: 0; border-radius: 18px 4px 18px 18px; box-shadow: 0 8px 20px rgba(79, 124, 255, .24); }
.qmsg.user .who { background: #FFE9B8; }
.qmsg .meta { margin-top: 7px; font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.qa-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 12px; background: #F7FAFF; }
.qa-suggest button { border: 1px dashed #C9D9F8; background: #fff; color: #4E628C; border-radius: 999px; padding: 6px 11px; font-size: 12px; }
.qa-suggest button:hover { border-color: var(--blue); color: var(--blue); }
.qa-form { display: flex; gap: 9px; padding: 14px 16px; border-top: 1px solid var(--line); background: #fff; }
.qa-form input {
    flex: 1;
    border: 1px solid var(--line-2);
    background: #F8FAFF;
    border-radius: 14px;
    padding: 12px 15px;
    outline: none;
    font-size: 14px;
}
.qa-form input:focus { border-color: #A9C0F7; background: #fff; box-shadow: 0 0 0 4px rgba(79, 124, 255, .08); }

.hero-mini-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: #F8FAFF; border: 1px solid var(--line); }
.hero-mini-card .halo { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; display: grid; place-items: center; background: var(--tone, #EAF0FF); }

/* ---------- 安全宝盒 ---------- */

.treasure-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.treasure-tabs::-webkit-scrollbar { display: none; }
.treasure-tabs a {
    padding: 9px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: #536182;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.treasure-tabs a.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(79, 124, 255, .22); }

.knowledge-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-sm); }
.knowledge-card h3 { font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.knowledge-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.knowledge-list li { display: flex; gap: 9px; font-size: 13.5px; color: #4F5F7E; line-height: 1.6; }
.knowledge-list li .dot { width: 20px; height: 20px; border-radius: 7px; background: var(--tone, #EAF0FF); color: #3763DE; display: grid; place-items: center; font-size: 11px; font-weight: 900; flex: 0 0 auto; margin-top: 1px; }
.knowledge-list.steps li .dot { background: var(--blue); color: #fff; border-radius: 50%; }
.knowledge-tip { background: linear-gradient(135deg, #FFF8E1, #FFFDF5); border: 1px solid #FBE7A8; border-radius: 14px; padding: 12px 14px; font-size: 13px; color: #7A5A00; margin-top: 10px; }

.hotline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hotline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.hotline .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; background: var(--tone, #EAF0FF); }
.hotline .num { font-size: 20px; font-weight: 900; line-height: 1.1; }
.hotline .name { font-size: 11.5px; color: var(--muted); }

.sign-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sign-card { border-radius: 18px; padding: 16px 10px; text-align: center; background: #fff; border: 1px solid var(--line); }
.sign-card .glyph { font-size: 32px; }
.sign-card .name { font-size: 12px; font-weight: 700; margin-top: 4px; color: #52648A; }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-item { display: flex; gap: 9px; padding: 11px 13px; border-radius: 13px; background: #F8FAFF; border: 1px solid var(--line); font-size: 13px; color: #4F5F7E; }
.check-item .box { width: 18px; height: 18px; border-radius: 6px; border: 2px solid #B9C9E9; background: #fff; flex: 0 0 auto; margin-top: 2px; }

/* ---------- 表单 ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 800; color: #4E5E7F; }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--line-2);
    background: #FBFCFE;
    border-radius: 13px;
    padding: 11px 13px;
    outline: none;
    font-size: 14px;
    transition: .16s;
    color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus { border-color: #A9C0F7; background: #fff; box-shadow: 0 0 0 4px rgba(79, 124, 255, .08); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8A99B8 50%), linear-gradient(135deg, #8A99B8 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4E5E7F; }
.check-row input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
    text-align: left;
    font-size: 11.5px;
    letter-spacing: .04em;
    color: #7B8AA7;
    font-weight: 800;
    padding: 12px 14px;
    background: #F8FAFF;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid #F0F4FC; font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFDFF; }
.table .name-cell { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- 提示 / 空状态 ---------- */

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 15px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.flash .f-ico { font-size: 16px; line-height: 1.4; }
.flash-ok { background: #E9F9F2; color: #147A5E; border-color: #BEEBDC; }
.flash-warn { background: #FFF7E0; color: #8A6000; border-color: #FBE3A3; }
.flash-error { background: #FFEDED; color: #B52F2F; border-color: #FFCECE; }
.flash-info { background: #EAF2FF; color: #2F55B8; border-color: #CBDCFB; }

.empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--muted);
}
.empty .emoji { font-size: 46px; margin-bottom: 8px; }
.empty h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 5px; }

.alert-inline {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: #FFF8E8;
    border: 1px solid #FBE7AE;
    color: #806000;
    font-size: 13px;
}

/* ---------- 认证 / 落地页 ---------- */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.05fr); }
.auth-side { padding: 40px clamp(24px, 5vw, 70px); display: flex; flex-direction: column; justify-content: center; background: #fff; }
.auth-side .brand { margin-bottom: 30px; }
.auth-title { font-size: 30px; font-weight: 900; }
.auth-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.auth-form { margin-top: 24px; max-width: 420px; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-art {
    position: relative;
    background: linear-gradient(160deg, #E7F1FF, #F4F9FF 45%, #FFF8E6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 30px;
}
.auth-art img.art { width: min(86%, 560px); border-radius: 30px; box-shadow: 0 28px 60px rgba(42, 86, 170, .18); object-fit: cover; }
.auth-art .float-card {
    position: absolute;
    background: #fff;
    border-radius: 18px;
    padding: 12px 15px;
    box-shadow: 0 16px 30px rgba(31, 56, 122, .14);
    font-size: 12px;
    font-weight: 800;
    color: #4D5F81;
    display: flex;
    align-items: center;
    gap: 8px;
}
.auth-art .fc1 { top: 9%; left: 8%; animation: floaty 4.5s ease-in-out infinite; }
.auth-art .fc2 { bottom: 12%; right: 7%; animation: floaty 5.2s ease-in-out infinite .6s; }
.auth-art .fc3 { bottom: 36%; left: 5%; animation: floaty 4.8s ease-in-out infinite .3s; }

.landing { max-width: 1240px; margin: 0 auto; padding: 26px 20px 80px; }
.landing-hero { position: relative; border-radius: 32px; overflow: hidden; box-shadow: 0 28px 60px rgba(42, 86, 170, .16); background: #DFF1FF; min-height: 480px; }
.landing-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.97), rgba(255,255,255,.9) 38%, rgba(255,255,255,.25) 62%, transparent 80%); }
.landing-copy { position: relative; z-index: 2; max-width: 600px; padding: clamp(34px, 5vw, 60px); }
.landing-copy h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 900; line-height: 1.18; }
.landing-copy h1 em { font-style: normal; color: var(--blue); }
.landing-copy p { margin-top: 16px; font-size: 15px; color: #526182; max-width: 500px; }
.landing-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.landing-tags span { background: rgba(255,255,255,.9); border: 1px solid #E3ECFC; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #4F6288; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-sm); }
.feature-card .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 25px; background: var(--tone, var(--blue-soft)); margin-bottom: 12px; }
.feature-card h3 { font-size: 17px; font-weight: 900; }
.feature-card p { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- 个人中心 ---------- */

.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head .who h1 { font-size: 24px; font-weight: 900; }
.profile-head .who p { font-size: 13px; color: var(--muted); }
.profile-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats strong { display: block; font-size: 22px; font-weight: 900; color: var(--blue); line-height: 1.2; }
.profile-stats span { font-size: 11.5px; color: var(--muted); }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-picker label { position: relative; cursor: pointer; }
.avatar-picker input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-picker .opt {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: var(--tone, #F2F6FF);
    border: 2px solid transparent;
    transition: .15s;
}
.avatar-picker input:checked + .opt { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(79, 124, 255, .14); transform: scale(1.05); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 13.5px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---------- 图表 ---------- */

.donut {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.donut::after {
    content: "";
    position: absolute;
    inset: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px #F0F4FD;
}
.donut .inner { position: relative; z-index: 1; text-align: center; }
.donut .pct { font-size: 28px; font-weight: 900; line-height: 1.1; }
.donut .cap { font-size: 11px; color: var(--muted); }

.bar-row { display: grid; grid-template-columns: 96px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 11px; }
.bar-row .lab { font-size: 12.5px; font-weight: 700; color: #536182; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { font-size: 12px; font-weight: 800; color: var(--blue); text-align: right; }
.bar-track { height: 10px; border-radius: 999px; background: #F0F4FD; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7FA1FF, #4F7CFF); }
.bar-track.mint > i { background: linear-gradient(90deg, #6FE3C7, #2FBF9B); }
.bar-track.sun > i { background: linear-gradient(90deg, #FFE08A, #FFC93C); }
.bar-track.coral > i { background: linear-gradient(90deg, #FFA3A3, #FF6B6B); }
.bar-track.purple > i { background: linear-gradient(90deg, #C9BBFF, #A78BFA); }
.bar-track.orange > i { background: linear-gradient(90deg, #FFC08A, #FF9F43); }

.sparkline { width: 100%; height: 150px; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* ---------- 工作台布局 ---------- */

.t-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.t-side {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
    background: linear-gradient(180deg, #EEF4FF, #F8FAFF);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.t-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px; }
.t-brand img { width: 40px; height: 40px; object-fit: contain; }
.t-brand b { font-size: 17px; font-weight: 900; display: block; line-height: 1.2; }
.t-brand small { font-size: 10px; color: var(--muted); }
.t-nav { display: flex; flex-direction: column; gap: 3px; }
.t-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #536182;
    font-size: 13.5px;
    font-weight: 700;
    transition: .16s;
}
.t-nav a .ti { width: 22px; text-align: center; font-size: 16px; }
.t-nav a:hover { background: #fff; color: var(--blue); }
.t-nav a.active { background: var(--blue); color: #fff; box-shadow: 0 8px 16px rgba(79, 124, 255, .24); }
.t-nav .nav-group { font-size: 10.5px; letter-spacing: .12em; color: #9AA8C2; font-weight: 800; padding: 14px 12px 4px; }
.t-side-foot { margin-top: auto; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.t-main { padding: 22px clamp(16px, 2.4vw, 34px) 60px; min-width: 0; }
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.t-top h1 { font-size: 24px; font-weight: 900; }
.t-top p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.t-user { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 5px; box-shadow: var(--shadow-sm); }
.t-user .who { font-size: 12px; font-weight: 800; line-height: 1.25; }
.t-user .who small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; }

.mobile-bar { display: none; }

/* ---------- 管理后台 ---------- */

.a-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; background: #F3F6FC; }
.a-side { background: linear-gradient(180deg, #17233F, #1E2E52); color: #C6D2E8; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.a-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px; color: #fff; }
.a-brand img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; }
.a-brand b { font-size: 16px; display: block; line-height: 1.25; }
.a-brand small { font-size: 10px; color: #8FA2C4; letter-spacing: .1em; }
.a-nav { display: flex; flex-direction: column; gap: 3px; }
.a-nav a { color: #B9C7E0; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; display: flex; gap: 9px; align-items: center; }
.a-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.a-nav a.active { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(79, 124, 255, .3); }
.a-nav .nav-group { font-size: 10px; letter-spacing: .12em; color: #6E80A3; padding: 14px 12px 4px; font-weight: 800; }
.a-side-foot { margin-top: auto; font-size: 11px; color: #899BC0; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.a-main { padding: 22px clamp(16px, 2.5vw, 34px) 60px; min-width: 0; }
.a-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.a-top h1 { font-size: 23px; font-weight: 900; color: #1C2947; }
.a-top p { font-size: 12px; color: #7A88A5; }
.a-user { background: #fff; border: 1px solid #E3EAF6; border-radius: 999px; padding: 5px 12px 5px 5px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.admin-note { font-size: 11.5px; color: #8996B0; }
.a-card { background: #fff; border: 1px solid #E5EBF6; border-radius: 18px; padding: 20px; box-shadow: 0 8px 22px rgba(28, 45, 82, .05); }
.a-kpi { display: flex; align-items: center; gap: 12px; }
.a-kpi .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: #EEF3FF; }
.a-kpi .num { font-size: 22px; font-weight: 900; line-height: 1.15; }
.a-kpi .lab { font-size: 11.5px; color: #7C8AA6; }

/* ---------- AI 悬浮球 ---------- */

.ai-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(145deg, #FFFFFF, #E9F1FF);
    box-shadow: 0 16px 34px rgba(49, 91, 190, .28), 0 0 0 6px rgba(255, 255, 255, .7);
    display: grid;
    place-items: center;
    transition: transform .2s ease;
}
.ai-fab:hover { transform: translateY(-3px) scale(1.03); }
.ai-fab img { width: 54px; height: 54px; object-fit: contain; }
.ai-fab::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(79, 124, 255, .35);
    animation: pulse 2.6s ease-out infinite;
}
.ai-fab .dot { position: absolute; right: 6px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: #2FBF9B; border: 2px solid #fff; }

.ai-panel {
    position: fixed;
    right: 22px;
    bottom: 102px;
    z-index: 91;
    width: 384px;
    max-width: calc(100vw - 28px);
    height: min(600px, calc(100vh - 140px));
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(24, 46, 98, .24);
    border: 1px solid rgba(226, 234, 248, .9);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}
.ai-panel.open { display: flex; animation: popIn .22s ease; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px; background: linear-gradient(120deg, #4F7CFF, #7C9CFF); color: #fff; }
.ai-head img { width: 42px; height: 42px; object-fit: contain; background: rgba(255,255,255,.2); border-radius: 50%; padding: 2px; }
.ai-head h3 { font-size: 15px; font-weight: 900; line-height: 1.2; }
.ai-head p { font-size: 10.5px; opacity: .85; }
.ai-head .close { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 17px; display: grid; place-items: center; }
.ai-head .close:hover { background: rgba(255,255,255,.28); }
.ai-body { flex: 1; overflow-y: auto; padding: 14px; background: linear-gradient(180deg, #F7FAFF, #F2F7FF); display: flex; flex-direction: column; gap: 12px; }
.ai-msg { display: flex; gap: 8px; max-width: 92%; }
.ai-msg .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: #E9F0FF; flex: 0 0 auto; }
.ai-msg .bubble { background: #fff; border-radius: 4px 16px 16px 16px; padding: 10px 12px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; box-shadow: 0 5px 14px rgba(31, 56, 122, .06); border: 1px solid #EDF2FC; }
.ai-msg.user { margin-left: auto; flex-direction: row-reverse; }
.ai-msg.user .bubble { background: var(--blue); color: #fff; border: 0; border-radius: 16px 4px 16px 16px; }
.ai-msg.user .av { background: #FFE9B8; }
.ai-msg .meta { font-size: 10px; color: #98A5BE; margin-top: 4px; display: flex; gap: 5px; align-items: center; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #F2F7FF; }
.ai-quick button { border: 1px dashed #C7D8F7; background: #fff; color: #4E628C; border-radius: 999px; padding: 5px 9px; font-size: 11px; }
.ai-quick button:hover { border-color: var(--blue); color: var(--blue); }
.ai-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #EDF2FC; background: #fff; }
.ai-input input { flex: 1; border: 1px solid #DDE7F8; background: #F8FAFF; border-radius: 12px; padding: 10px 12px; outline: none; font-size: 13px; }
.ai-input input:focus { border-color: #A9C0F7; background: #fff; }
.ai-send { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-size: 16px; }
.ai-send:disabled { opacity: .5; }
.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: #8FA5CC; animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }

/* ---------- 底部 ---------- */

.site-foot { border-top: 1px solid var(--line); background: rgba(255,255,255,.7); padding: 26px 20px; margin-top: 30px; }
.site-foot .inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

.bottom-nav { display: none; }

/* ---------- 动画 ---------- */

@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(.9); opacity: .8; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
    .grid-4, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .qa-shell { grid-template-columns: 1fr; }
    .qa-shell aside { order: 2; }
    .grid-main { grid-template-columns: 1fr; }
    .t-layout { grid-template-columns: 200px minmax(0, 1fr); }
    .a-layout { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .nav { display: none; }
    .top-inner { justify-content: space-between; }
    .site-top .brand-sub { display: none; }
    .hero { min-height: 360px; }
    .hero::before { background: linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.92) 55%, rgba(255,255,255,.55) 100%); }
    .hero-copy { padding: 26px 22px; max-width: 100%; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-side { min-height: 100vh; }
    .t-layout, .a-layout { grid-template-columns: 1fr; }
    .t-side, .a-side {
        position: sticky;
        top: 0;
        height: auto;
        z-index: 70;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .t-brand small, .a-brand small { display: none; }
    .t-brand b, .a-brand b { font-size: 14px; }
    .t-brand img, .a-brand img { width: 32px; height: 32px; }
    .t-nav, .a-nav { flex-direction: row; gap: 2px; }
    .t-nav a, .a-nav a { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
    .t-nav .nav-group, .a-nav .nav-group, .t-side-foot, .a-side-foot { display: none; }
    .t-main, .a-main { padding-top: 16px; }
    .hotline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sign-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .checklist { grid-template-columns: 1fr; }
    .landing-hero { min-height: 430px; }
    .landing-hero::after { background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.9) 62%, rgba(255,255,255,.6)); }
}

@media (max-width: 620px) {
    body { font-size: 14px; padding-bottom: 64px; }
    .page { padding: 18px 14px 50px; }
    .top-inner { padding: 8px 14px; }
    .brand img { width: 40px; height: 40px; }
    .brand-name { font-size: 18px; }
    .points-pill { display: none; }
    .top-avatar .who { display: none; }
    .ws-btn { padding: 6px 11px; font-size: 12px; }
    .role-banner { gap: 12px; padding: 14px 16px; }
    .role-banner .rb-copy { flex-basis: 100%; }
    .hero { border-radius: 24px; min-height: 400px; }
    .hero-copy { padding: 22px 18px; }
    .hero p.lead { font-size: 13.5px; }
    .grid-2, .grid-3, .grid-4, .kpi-grid, .badge-grid { grid-template-columns: 1fr; }
    .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .hotline-grid { grid-template-columns: 1fr; }
    .sign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { padding: 17px; border-radius: 20px; }
    .section-title { font-size: 18px; }
    .task-item { padding: 13px; }
    .task-side { align-items: flex-end; }
    .ai-fab { width: 58px; height: 58px; right: 16px; bottom: 76px; }
    .ai-fab img { width: 46px; height: 46px; }
    .ai-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 86vh; border-radius: 22px 22px 0 0; }
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 75;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav a { flex: 1; text-align: center; font-size: 10px; color: #8A97B2; font-weight: 700; padding: 4px 0; }
    .bottom-nav a .bi { display: block; font-size: 19px; line-height: 1.3; }
    .bottom-nav a.active { color: var(--blue); }
    .profile-head { gap: 12px; }
    .profile-stats { margin-left: 0; width: 100%; justify-content: space-between; gap: 10px; }
    .qa-panel { min-height: 520px; border-radius: 20px; }
    .qa-msgs { padding: 14px; }
    .qmsg { max-width: 94%; }
    .btn { padding: 10px 16px; }
    .table { min-width: 640px; }
    .auth-side { padding: 26px 20px 40px; }
    .landing { padding: 16px 14px 60px; }
    .landing-copy { padding: 26px 20px; }
    .landing-hero { min-height: 470px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- 轻提示 / 奖励弹层 ---------- */

.inline-form { display: inline; }
.inline-form button { font-family: inherit; }

.toast-wrap {
    position: fixed;
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #33415F;
    box-shadow: 0 14px 30px rgba(24, 46, 98, .16);
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    transition: .24s ease;
    max-width: min(420px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: #FFD4D4; }
.toast-warn { border-color: #FBE3A3; }

.reward-mask {
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(23, 36, 66, .48);
    backdrop-filter: blur(5px);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: .22s ease;
    padding: 20px;
}
.reward-mask.show { opacity: 1; }
.reward-box {
    background: #fff;
    border-radius: 28px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 30px 70px rgba(10, 25, 60, .3);
    transform: translateY(10px) scale(.96);
    transition: .25s ease;
    max-width: 460px;
    width: 100%;
}
.reward-mask.show .reward-box { transform: none; }
.reward-title { font-size: 22px; font-weight: 900; }
.reward-list { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 20px 0; }
.reward-badge { width: 120px; padding: 14px 8px; border-radius: 18px; background: #F8FAFF; border: 1px solid var(--line); }
.reward-badge .medal {
    width: 62px; height: 62px; margin: 0 auto 8px; border-radius: 50%;
    display: grid; place-items: center; font-size: 30px;
    background: var(--tone, #FFD166);
    box-shadow: inset 0 0 0 4px #fff, 0 8px 16px rgba(31, 56, 122, .14);
}
.reward-badge b { display: block; font-size: 13px; }
.reward-badge span { font-size: 10.5px; color: var(--muted); }

.ai-inline-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ai-inline-suggest button {
    border: 1px dashed #C7D8F7;
    background: #fff;
    color: #4E628C;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 10.5px;
}
.ai-inline-suggest button:hover { border-color: var(--blue); color: var(--blue); }
