/* ==========================================================================
   成长空间 · 基础样式
   不引任何 CDN：国内访问外链字体/框架的首屏代价比省下的代码大得多。
   断点三个：640（手机）/ 900（平板）/ 1200（桌面内容上限）
   ========================================================================== */

:root {
    --c-brand: #2f6fed;
    --c-brand-dark: #1e50c0;
    --c-brand-soft: #eaf1fe;
    --c-teal: #0e9f8f;
    --c-amber: #d97706;
    --c-red: #dc2626;
    --c-green: #16a34a;

    --c-bg: #f4f6fa;
    --c-surface: #ffffff;
    --c-surface-2: #fafbfd;
    --c-line: #e6eaf2;
    --c-line-strong: #d3dae8;

    --c-text: #1b2437;
    --c-text-2: #5b6b85;
    --c-text-3: #93a0b8;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;

    --sh-sm: 0 1px 2px rgba(24, 39, 75, .06);
    --sh-md: 0 4px 14px rgba(24, 39, 75, .07);
    --sh-lg: 0 12px 34px rgba(24, 39, 75, .10);

    --nav-h: 60px;
    --max-w: 1180px;

    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
            "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    --font-num: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

a { color: var(--c-brand); text-decoration: none; }
a:hover { color: var(--c-brand-dark); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

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

.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }
.ico-lg { width: 26px; height: 26px; flex: none; }

.muted { color: var(--c-text-2); }
.dim { color: var(--c-text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.bold { font-weight: 650; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--nav-h);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--c-line);
}
.topbar-inner {
    max-width: var(--max-w); margin: 0 auto; height: 100%;
    padding: 0 20px;
    display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--c-text); }
.brand:hover { color: var(--c-text); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, var(--c-brand), #5b9bff);
    display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
    box-shadow: 0 2px 8px rgba(47, 111, 237, .35);
}
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav a {
    position: relative;
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 9px;
    color: var(--c-text-2); font-size: 14px; font-weight: 500;
    white-space: nowrap;
}
.nav a:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav a.on { background: var(--c-brand-soft); color: var(--c-brand-dark); font-weight: 600; }
.nav .ico { width: 17px; height: 17px; opacity: .8; }
.nav a.on .ico { opacity: 1; }
.badge-dot {
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--c-red); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-user { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--c-brand-soft); color: var(--c-brand-dark);
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
    flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }

/* ---------- 布局 ---------- */
.page { max-width: var(--max-w); margin: 0 auto; padding: 24px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .sub { color: var(--c-text-2); font-size: 13.5px; margin-top: 3px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head:first-child { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.section-title .ico { color: var(--c-text-3); }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.g-auto-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 18px;
}
.card-flat { box-shadow: none; }
.card-hover { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--c-line-strong); }
.card-pad0 { padding: 0; overflow: hidden; }
.card-title { font-size: 14px; font-weight: 600; color: var(--c-text-2); margin-bottom: 10px; }

/* 统计块 */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 13px; font-weight: 500; color: var(--c-text-3); margin-left: 3px; }
.stat-label { font-size: 12.5px; color: var(--c-text-3); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px;
    border: 1px solid var(--c-line-strong); border-radius: 10px;
    background: var(--c-surface); color: var(--c-text);
    font-size: 14px; font-weight: 550; font-family: inherit;
    cursor: pointer; white-space: nowrap;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.btn:hover { background: var(--c-surface-2); border-color: var(--c-text-3); color: var(--c-text); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-brand); border-color: var(--c-brand); color: #fff; box-shadow: 0 2px 8px rgba(47,111,237,.25); }
.btn-primary:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #f3c2c2; color: var(--c-red); }
.btn-danger:hover { background: #fff5f5; border-color: var(--c-red); color: var(--c-red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn .ico { width: 17px; height: 17px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--c-text); }
.label .req { color: var(--c-red); margin-left: 2px; }
.hint { font-size: 12.5px; color: var(--c-text-3); margin-top: 5px; }
.err-msg { font-size: 12.5px; color: var(--c-red); margin-top: 5px; }

.input, .select, .textarea {
    width: 100%; font-family: inherit; font-size: 14.5px; color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-line-strong); border-radius: 10px;
    padding: 0 12px; height: 40px;
    transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; padding: 10px 12px; min-height: 92px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(47,111,237,.13);
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-3); }
.input.err, .textarea.err, .select.err { border-color: var(--c-red); }
.input[readonly] { background: var(--c-surface-2); color: var(--c-text-2); }
.input-lg { height: 44px; font-size: 15px; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235b6b85' stroke-width='1.7' stroke-linecap='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 34px;
}

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--c-brand); cursor: pointer; flex: none; }

/* 选项按钮组（radio/checkbox 卡片式） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border: 1px solid var(--c-line-strong); border-radius: 999px;
    background: var(--c-surface); font-size: 13.5px; cursor: pointer;
    transition: all .14s;
}
.chip:hover { border-color: var(--c-text-3); }
.chip input { display: none; }
.chip.on { background: var(--c-brand-soft); border-color: var(--c-brand); color: var(--c-brand-dark); font-weight: 600; }

/* 星级 */
.rating { display: flex; gap: 4px; }
.rating input { display: none; }
.rating label { font-size: 26px; color: #dfe4ee; cursor: pointer; line-height: 1; transition: color .1s; }
.rating label:hover, .rating label.on { color: #f5a524; }
.rating-static { color: #f5a524; letter-spacing: 1px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th {
    text-align: left; font-weight: 600; font-size: 12.5px; color: var(--c-text-3);
    padding: 10px 12px; border-bottom: 1px solid var(--c-line); white-space: nowrap;
    background: var(--c-surface-2);
}
table.tb td { padding: 12px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: var(--c-surface-2); }

/* ---------- 标签 ---------- */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px;
    font-size: 12px; font-weight: 550; line-height: 1;
    background: var(--c-surface-2); color: var(--c-text-2);
    border: 1px solid var(--c-line);
    white-space: nowrap;
}
.tag-brand { background: var(--c-brand-soft); color: var(--c-brand-dark); border-color: #d3e2fd; }
.tag-green { background: #e9f8ef; color: #15803d; border-color: #c9ecd7; }
.tag-amber { background: #fef6e7; color: #b45309; border-color: #fbe3ba; }
.tag-red   { background: #fdeeee; color: #b91c1c; border-color: #f8d3d3; }
.tag-gray  { background: #f1f3f8; color: #64748b; border-color: #e2e7f0; }

/* 状态点 */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-pending { background: #f59e0b; }
.dot-approved { background: var(--c-green); }
.dot-rejected { background: var(--c-red); }
.dot-draft { background: #94a3b8; }

/* ---------- 提示条 ---------- */
.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--r-md);
    font-size: 14px; margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert .ico { margin-top: 2px; }
.alert-success { background: #edf9f2; border-color: #c9ecd7; color: #166534; }
.alert-error   { background: #fdeeee; border-color: #f8d3d3; color: #991b1b; }
.alert-info    { background: var(--c-brand-soft); border-color: #d3e2fd; color: #1e40af; }
.alert-warn    { background: #fef8ea; border-color: #fbe3ba; color: #92400e; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--c-text-3); }
.empty .ico { width: 40px; height: 40px; margin: 0 auto 10px; opacity: .45; }
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--c-text-2); margin-bottom: 4px; }

/* ---------- 列表项 ---------- */
.item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--c-line); }
.item:last-child { border-bottom: none; padding-bottom: 0; }
.item:first-child { padding-top: 0; }
.item-icon {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: var(--c-brand-soft); color: var(--c-brand);
}
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.item-meta { font-size: 12.5px; color: var(--c-text-3); display: flex; gap: 10px; flex-wrap: wrap; }

/* 时间轴 */
.tl { position: relative; padding-left: 26px; }
.tl::before {
    content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: var(--c-line); border-radius: 1px;
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute; left: -26px; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 2px solid var(--c-line-strong);
    display: grid; place-items: center;
}
.tl-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-brand); }
.tl-date { font-size: 12px; color: var(--c-text-3); font-family: var(--font-num); }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: var(--c-line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--c-brand); transition: width .4s ease; }

/* 分段切换 */
.seg { display: inline-flex; padding: 3px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 10px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 7px; font-size: 13.5px; color: var(--c-text-2); font-weight: 550; }
.seg a.on { background: #fff; color: var(--c-text); box-shadow: var(--sh-sm); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.pager a, .pager span {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: grid; place-items: center; border-radius: 8px;
    font-size: 13.5px; color: var(--c-text-2); border: 1px solid var(--c-line); background: #fff;
}
.pager a:hover { border-color: var(--c-text-3); color: var(--c-text); }
.pager .on { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.pager .gap { border: none; background: none; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    position: relative; overflow: hidden;
    background: linear-gradient(150deg, #1b3f9e 0%, #2f6fed 46%, #4b8cf7 100%);
    color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::after {
    content: ''; position: absolute; right: -90px; bottom: -110px;
    width: 380px; height: 380px; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.auth-side::before {
    content: ''; position: absolute; right: 60px; top: -120px;
    width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
.auth-brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 700; }
.auth-brand .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; }
.auth-headline { font-size: 32px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 16px; }
.auth-desc { font-size: 15px; color: rgba(255,255,255,.82); line-height: 1.8; max-width: 420px; }
.auth-facts { display: flex; gap: 30px; margin-top: 30px; }
.auth-fact-num { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-fact-label { font-size: 12.5px; color: rgba(255,255,255,.7); }
.auth-foot { font-size: 12.5px; color: rgba(255,255,255,.62); position: relative; z-index: 1; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--c-surface); }
.auth-box { width: 100%; max-width: 360px; }
.auth-title { font-size: 23px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--c-text-2); margin-bottom: 28px; }
.auth-alt { margin-top: 26px; font-size: 13.5px; color: var(--c-text-2); text-align: center; }
.auth-alt a { font-weight: 600; }

/* ---------- 落地页 ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav { max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; }
.hero { max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 60px 20px 40px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; margin-bottom: 18px; }
.hero p { font-size: clamp(15px, 2vw, 17px); color: var(--c-text-2); max-width: 560px; margin: 0 auto 30px; line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-facts { display: flex; gap: 44px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }

/* ---------- 底部 tab（手机） ---------- */
.tabbar { display: none; }

/* ---------- 装饰 ---------- */
.cat-德育 { background: #fdeeee; color: #b91c1c; border-color: #f8d3d3; }
.cat-智育 { background: var(--c-brand-soft); color: #1e40af; border-color: #d3e2fd; }
.cat-体育 { background: #e9f8ef; color: #15803d; border-color: #c9ecd7; }
.cat-美育 { background: #f6eefd; color: #7e22ce; border-color: #e9d5ff; }
.cat-劳育 { background: #fef6e7; color: #b45309; border-color: #fbe3ba; }
.cat-综合 { background: #f1f3f8; color: #475569; border-color: #e2e7f0; }

/* 打印：激活单要能直接打出来发给学生 */
@media print {
    .topbar, .tabbar, .no-print, .page-head .btn { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .split { grid-template-columns: 1fr; }
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .nav { display: none; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main { min-height: 100vh; }
    .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page { padding: 18px 16px 90px; }
    .topbar-inner { padding: 0 16px; gap: 12px; }
    .topbar .nav-user .uname { display: none; }
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
        border-top: 1px solid var(--c-line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .tabbar a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 8px 0 7px; font-size: 10.5px; color: var(--c-text-3); position: relative;
    }
    .tabbar a.on { color: var(--c-brand); font-weight: 600; }
    .tabbar .ico { width: 21px; height: 21px; }
    .tabbar .badge-dot { position: absolute; top: 4px; right: 50%; margin-right: -22px; }
    .hero-facts { gap: 26px; }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    h1 { font-size: 21px; }
    h2 { font-size: 17px; }
    .g2, .g3, .g4 { grid-template-columns: 1fr; }
    .g-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .card { padding: 15px; border-radius: var(--r-md); }
    .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stat-num { font-size: 24px; }
    .btn { height: 40px; }               /* 手机点击区不小于 40px */
    .btn-sm { height: 34px; }
    .input, .select { height: 42px; }
    table.tb th, table.tb td { padding: 9px 10px; }
    .auth-main { padding: 28px 20px; }
    .hero { padding: 40px 18px 30px; }
}
