/* ============================================================
   英语写作闯关星球 · Cloudflare Pages 版
   学生端 + 家长后台 共用样式
   ============================================================ */

:root {
  --ink: #171c33;
  --ink2: #3f4763;
  --muted: #7b83a0;
  --line: #e7e9f7;
  --line2: #f0f1fb;
  --bg: #f4f6ff;
  --card: #ffffff;
  --primary: #5a5be0;
  --primary-d: #4342c4;
  --primary-l: #eeeefc;
  --violet: #8b5cf6;
  --teal: #12b8a6;
  --amber: #f7a72c;
  --coral: #ff6f86;
  --sky: #3fa9f5;
  --green: #22b07d;
  --red: #e5484d;
  --shadow: 0 12px 32px rgba(35, 45, 110, .08);
  --shadow-lg: 0 24px 60px rgba(35, 45, 110, .14);
  --r: 20px;
  --r-sm: 14px;
  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

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

::selection { background: rgba(90, 91, 224, .18); }

/* 星空背景 */
#stars-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(139, 92, 246, .16), transparent 34%),
    radial-gradient(circle at 88% 4%, rgba(63, 169, 245, .16), transparent 32%),
    radial-gradient(circle at 74% 82%, rgba(18, 184, 166, .12), transparent 34%),
    radial-gradient(circle at 20% 78%, rgba(247, 167, 44, .10), transparent 30%);
}
#stars-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 22%, #b9c0e8, transparent),
    radial-gradient(1.6px 1.6px at 42% 12%, #c9cff0, transparent),
    radial-gradient(1.6px 1.6px at 68% 30%, #b9c0e8, transparent),
    radial-gradient(1.6px 1.6px at 86% 62%, #c9cff0, transparent),
    radial-gradient(1.6px 1.6px at 8% 58%, #c9cff0, transparent),
    radial-gradient(1.6px 1.6px at 56% 76%, #b9c0e8, transparent),
    radial-gradient(1.6px 1.6px at 32% 92%, #c9cff0, transparent);
  background-repeat: repeat;
  background-size: 340px 340px;
}

#app { position: relative; z-index: 1; min-height: 100%; }

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

.shell { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.shell-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.shell-wide { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.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; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; } .mt28 { margin-top: 28px; } .mb0 { margin-bottom: 0; }
.center { text-align: center; }
.hide { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 233, 247, .9);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}
.topbar-wide .topbar-inner { max-width: 1240px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand-badge {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(140deg, #6d6ef0, #8b5cf6 55%, #3fa9f5);
  box-shadow: 0 8px 18px rgba(90, 91, 224, .32);
}
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.brand-name { font-size: 16px; line-height: 1.2; }

.who {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink2);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, #12b8a6, #3fa9f5);
}

/* ---------------- 卡片 / 按钮 ---------------- */

.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  border: 1px solid rgba(231, 233, 247, .9);
  padding: 20px;
}
.card-tight { padding: 14px; }
.card-flat { box-shadow: none; }
.card-title { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.card-sub { margin: 0; color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 18px; border-radius: 12px;
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 18px rgba(90, 91, 224, .24);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(90, 91, 224, .3); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--primary-d); box-shadow: none;
  border: 1px solid rgba(90, 91, 224, .28);
}
.btn-ghost:hover { background: var(--primary-l); box-shadow: none; }
.btn-soft { background: var(--primary-l); color: var(--primary-d); box-shadow: none; }
.btn-soft:hover { background: #e4e4fb; box-shadow: none; }
.btn-quiet { background: #f3f4fb; color: var(--ink2); box-shadow: none; }
.btn-quiet:hover { background: #eaecf7; box-shadow: none; }
.btn-danger { background: #fff0f1; color: #c92a2f; box-shadow: none; border: 1px solid #ffd6d9; }
.btn-danger:hover { background: #ffe4e6; box-shadow: none; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.7;
  background: var(--primary-l); color: var(--primary-d);
  white-space: nowrap;
}
.pill-teal { background: #e2f8f4; color: #0a8d80; }
.pill-amber { background: #fff4e0; color: #a86500; }
.pill-coral { background: #ffecef; color: #c73a52; }
.pill-gray { background: #f1f2f9; color: var(--ink2); }
.pill-sky { background: #e6f3fe; color: #1a72b8; }
.pill-violet { background: #f2ecfe; color: #6d34d6; }

/* ---------------- 首页统计 ---------------- */

.hero {
  margin-top: 22px; padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f7f6ff 62%, #f0f8ff 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(231, 233, 247, .9);
}
.hero h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }

.stat-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px;
}
.stat b { display: block; font-size: 22px; line-height: 1.2; letter-spacing: -.4px; white-space: nowrap; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .unit { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 2px; }

/* 星星 / 奖牌 展示 */
.stars-big { display: inline-flex; gap: 2px; font-size: 20px; line-height: 1; }
.stars-big i { font-style: normal; color: #dfe2f2; }
.stars-big i.on { color: #f7a72c; text-shadow: 0 2px 6px rgba(247, 167, 44, .5); }
.stars-sm { display: inline-flex; gap: 1px; font-size: 13px; line-height: 1; }
.stars-sm i { font-style: normal; color: #dfe2f2; }
.stars-sm i.on { color: #f7a72c; }

.bar {
  height: 9px; border-radius: 999px; background: #eef0fa; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(35, 45, 110, .06);
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #6d6ef0, #8b5cf6);
  transition: width .5s cubic-bezier(.22, .9, .28, 1);
}
.bar-teal > i { background: linear-gradient(90deg, #12b8a6, #4cd4c4); }

/* ---------------- 关卡地图 ---------------- */

.map-head { margin: 26px 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.map-head h2 { margin: 0; font-size: 18px; }
.map-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.map { position: relative; padding: 6px 0 10px 46px; }
.map-path {
  position: absolute; left: 21px; top: 34px; bottom: 46px; width: 2px;
  background-image: linear-gradient(#c9cdf0 55%, transparent 0);
  background-size: 2px 10px; background-repeat: repeat-y;
}
.map-path::before {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: var(--p, 0%);
  background: linear-gradient(#6d6ef0, #8b5cf6); border-radius: 2px;
  transition: height .6s ease;
}

.level-node {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin-bottom: 10px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
  text-align: left; width: 100%; font-family: inherit; color: inherit;
}
.level-node:hover { box-shadow: var(--shadow); border-color: #d9dcf5; }
.level-node.done { background: linear-gradient(100deg, #f5fff9, #fff 55%); border-color: #cdefe0; }
.level-node.next { border-color: #c7c8f7; box-shadow: 0 0 0 3px rgba(90, 91, 224, .09); }

.node-dot {
  position: absolute; left: -46px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: var(--ink2);
  background: #f1f2fb; border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(35, 45, 110, .1);
}
.level-node.done .node-dot { background: linear-gradient(140deg, #22b07d, #4cd4a8); color: #fff; }
.level-node.next .node-dot { background: linear-gradient(140deg, #6d6ef0, #8b5cf6); color: #fff; }
.node-main { flex: 1; min-width: 0; }
.node-title { display: block; font-weight: 800; font-size: 14.5px; margin: 0; }
.node-meta { display: block; margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.node-right { flex: none; text-align: right; display: grid; gap: 4px; justify-items: end; }

/* ---------------- 关卡内： flashcards ---------------- */

.stage-head { margin-top: 18px; }
.stage-head h1 { margin: 0; font-size: 21px; }
.stage-head p { margin: 6px 0 0; color: var(--ink2); font-size: 14px; white-space: pre-wrap; }

.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: var(--primary-d);
  margin: 0 0 10px;
}
.section-label .n {
  width: 21px; height: 21px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 12px; color: #fff;
  background: linear-gradient(140deg, #6d6ef0, #8b5cf6);
}

.flash-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.flip {
  display: block; perspective: 900px; height: 78px; cursor: pointer;
  background: none; border: 0; padding: 0; font-family: inherit; text-align: left;
}
.flip-inner {
  display: block; position: relative; width: 100%; height: 100%;
  transition: transform .5s cubic-bezier(.4, .2, .2, 1); transform-style: preserve-3d;
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; border-radius: var(--r-sm);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 14px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 6px 16px rgba(35, 45, 110, .06);
}
.flip-face b { font-size: 16px; letter-spacing: -.1px; }
.flip-face small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(140deg, #f6f4ff, #eef6ff);
  border-color: #ddd8fb;
}
.flip-back b { color: var(--primary-d); font-size: 14.5px; }
.flip-hint { position: absolute; right: 10px; top: 8px; font-size: 10.5px; color: #b6bcd8; }

.pattern-list { display: grid; gap: 9px; }
.pattern-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: linear-gradient(120deg, #f8f9ff, #fff);
  border: 1px solid var(--line);
}
.pattern-item .idx {
  flex: none; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
  background: #e9ebfb; color: var(--primary-d);
}
.pattern-item b { font-size: 14px; }
.pattern-item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------------- 写作区 ---------------- */

.write-area {
  width: 100%; min-height: 240px; resize: vertical;
  font-family: inherit; font-size: 15px; line-height: 1.8;
  padding: 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.write-area:focus {
  outline: none; border-color: #a9aaf2;
  box-shadow: 0 0 0 4px rgba(90, 91, 224, .1);
}
.write-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.wordcount { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.wordcount.ok { color: var(--green); }
.wordcount.warn { color: var(--amber); }

/* 批改中 */
.loading-card { display: grid; place-items: center; gap: 14px; padding: 46px 20px; text-align: center; }
.orbit { position: relative; width: 76px; height: 76px; }
.orbit::before, .orbit::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid transparent;
}
.orbit::before { border-top-color: #6d6ef0; border-right-color: #8b5cf6; animation: spin 1.1s linear infinite; }
.orbit::after { inset: 12px; border-bottom-color: #12b8a6; border-left-color: #3fa9f5; animation: spin 1.5s linear infinite reverse; }
.orbit i {
  position: absolute; inset: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #8b5cf6, #5a5be0);
  box-shadow: 0 6px 16px rgba(90, 91, 224, .4);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.06); } }

.loading-card h3 { margin: 0; font-size: 16px; }
.loading-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------------- 批改报告 ---------------- */

.report-head {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 20px; border-radius: var(--r);
  background: linear-gradient(135deg, #f7f5ff, #eef7ff 70%, #f2fffb);
  border: 1px solid #e6e4fb;
}
.score-ring { position: relative; width: 104px; height: 104px; flex: none; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .val {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.score-ring .val b { display: block; font-size: 30px; line-height: 1; letter-spacing: -1px; }
.score-ring .val span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); font-weight: 700; }
.report-title { font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.report-comment { margin: 0; font-size: 14px; color: var(--ink2); }

.dim-row { display: grid; gap: 6px; margin-top: 12px; }
.dim-row .top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.dim-row .top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.err-item {
  padding: 11px 13px; border-radius: 12px;
  background: #fff8f8; border: 1px solid #ffe1e3;
}
.err-item + .err-item { margin-top: 8px; }
.err-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.wrong { color: #c92a2f; text-decoration: line-through; text-decoration-color: rgba(201, 42, 47, .4); }
.right { color: #0d8a5f; font-weight: 700; }
.arrow { color: #b6bcd8; font-weight: 700; }
.why { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.tip-item {
  padding: 11px 13px; border-radius: 12px;
  background: #f8f9ff; border: 1px solid var(--line);
}
.tip-item + .tip-item { margin-top: 8px; }
.tip-item .right { color: var(--primary-d); font-weight: 700; }

.good-list { margin: 0; padding-left: 20px; }
.good-list li { margin: 4px 0; font-size: 14px; color: var(--ink2); }

/* 范文 */
.essay-box {
  padding: 16px; border-radius: var(--r-sm);
  background: #fbfbff; border: 1px dashed #cfd3f0;
  font-size: 14.5px; line-height: 1.85; white-space: pre-wrap;
}
.locked-box {
  display: grid; place-items: center; gap: 8px; padding: 26px 16px; text-align: center;
  border-radius: var(--r-sm); background: #f6f7fd; border: 1px dashed #d3d7ef;
  color: var(--muted); font-size: 13px;
}
.locked-box .ico { font-size: 26px; opacity: .6; }

/* ---------------- 历史记录 ---------------- */

.rec-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: border-color .14s, box-shadow .14s;
  width: 100%; text-align: left; font-family: inherit; color: inherit;
}
.rec-item:hover { border-color: #d5d8f3; box-shadow: 0 8px 20px rgba(35, 45, 110, .07); }
.rec-item + .rec-item { margin-top: 9px; }
.rec-score {
  flex: none; width: 46px; text-align: center; font-weight: 800;
  font-size: 17px; color: var(--primary-d); font-variant-numeric: tabular-nums;
}
.rec-score small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.rec-main { flex: 1; min-width: 0; }
.rec-main b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-main span { font-size: 12px; color: var(--muted); }

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

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 800; color: var(--ink2); margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 12px; border-radius: 11px;
  border: 1.5px solid var(--line); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #a9aaf2; box-shadow: 0 0 0 4px rgba(90, 91, 224, .1);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
.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='%237b83a0' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

/* ---------------- 登录 ---------------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 26px 18px; }
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 24px; padding: 30px 26px 26px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(231, 233, 247, .9);
}
.login-card .brand { justify-content: center; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 21px; text-align: center; }
.login-card .sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 13px; }

.err-msg {
  background: #fff0f1; color: #c92a2f; border: 1px solid #ffd6d9;
  padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
}

/* ---------------- 家长后台 ---------------- */

.admin-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px;
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(35, 45, 110, .04);
}
.admin-tabs button {
  flex: none; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink2);
  padding: 8px 15px; border-radius: 10px; transition: background .15s, color .15s;
  white-space: nowrap;
}
.admin-tabs button:hover { background: #f5f6fd; }
.admin-tabs button.on { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(90, 91, 224, .26); }

.table-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
table.data th, table.data td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.data th {
  font-size: 12px; font-weight: 800; color: var(--muted);
  background: #fafbff; white-space: nowrap; position: sticky; top: 0;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbff; }
table.data td.num { font-variant-numeric: tabular-nums; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty {
  display: grid; place-items: center; gap: 8px; padding: 34px 16px;
  color: var(--muted); font-size: 13.5px; text-align: center;
}
.empty .ico { font-size: 30px; opacity: .5; }

/* 汇总卡 */
.sum-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sum-card { padding: 16px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); }
.sum-card h4 { margin: 0 0 2px; font-size: 15px; }
.sum-card .acc { font-size: 12px; color: var(--muted); }
.sum-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: center; }
.sum-mini div { background: #f8f9ff; border-radius: 10px; padding: 7px 4px; }
.sum-mini b { display: block; font-size: 16px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-mini span { font-size: 10.5px; color: var(--muted); font-weight: 700; }

/* ---------------- 弹层 ---------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(23, 28, 51, .42);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px;
  animation: fadeIn .18s ease;
}
.modal {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.24, .9, .3, 1);
}
.modal-head {
  position: sticky; top: 0; z-index: 2; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px 22px; }
.modal-x {
  border: 0; background: #f3f4fb; color: var(--ink2); width: 30px; height: 30px;
  border-radius: 9px; cursor: pointer; font-size: 17px; line-height: 1; flex: none;
}
.modal-x:hover { background: #e9eaf5; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* toast */
#toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
.toast {
  background: rgba(23, 28, 51, .92); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 12px 30px rgba(23, 28, 51, .3);
  animation: toastIn .22s ease;
}
.toast.err { background: rgba(201, 42, 47, .95); }
.toast.ok { background: rgba(13, 138, 95, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- 落地页 ---------------- */

.landing { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.landing-inner { width: 100%; max-width: 860px; text-align: center; }
.landing h1 { margin: 16px 0 8px; font-size: 30px; letter-spacing: -.6px; }
.landing > .landing-inner > p { color: var(--muted); margin: 0 auto; max-width: 520px; font-size: 14px; }
.entry-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 32px; text-align: left; }
.entry {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 22px;
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease;
}
.entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.entry .ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; line-height: 1; margin-bottom: 12px; align-self: flex-start;
  background: linear-gradient(140deg, #eef0ff, #e6f3fe);
}
.entry h3 { margin: 0 0 4px; font-size: 16px; }
.entry p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.entry .go { margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 800; color: var(--primary-d); }

.landing-foot { margin-top: 26px; color: #a3a9c6; font-size: 12px; }

/* ---------------- 登录页脚注 ---------------- */

.login-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: #a3a9c6;
}
.login-foot a { color: var(--ink2); font-weight: 700; text-decoration: none; }
.login-foot a:hover { color: var(--primary-d); }

/* ---------------- 题目卡 / 写作工具 ---------------- */

.prompt-box {
  padding: 14px; border-radius: var(--r-sm);
  background: linear-gradient(120deg, #f8f9ff, #fff);
  border: 1px solid var(--line);
}
.prompt-k { font-size: 13px; font-weight: 800; color: var(--primary-d); margin-bottom: 6px; }
.prompt-t { font-size: 14.5px; white-space: pre-wrap; }
.prompt-tips {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed #dfe2f2;
  font-size: 13px; color: var(--ink2); white-space: pre-wrap;
}

.writer-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.ocr-note {
  margin-top: 10px; padding: 9px 12px; border-radius: 11px; font-size: 12.5px;
  background: #f4f6fd; border: 1px solid var(--line); color: var(--ink2);
}
.ocr-note.ok { background: #eefaf6; border-color: #c8efdf; color: #0a7f5c; }
.ocr-note.bad { background: #fff5f5; border-color: #ffd9dc; color: #c0392f; }

/* ---------------- 用词多样性 ---------------- */

.repeat-list { display: grid; gap: 8px; }
.repeat-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 11px;
  background: #fbf9ff; border: 1px solid #ece6fb;
  font-size: 13px;
}
.repeat-row .rw { font-weight: 800; color: #6d34d6; min-width: 64px; }
.repeat-row .rc { color: var(--muted); font-size: 12px; }
.repeat-row .rs { color: var(--ink2); }
.repeat-row .rs::before { content: "→ "; color: #b6bcd8; }

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

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .shell, .shell-narrow, .shell-wide { padding: 0 14px; }
  .topbar-inner { padding: 10px 14px; }
  .brand-name { font-size: 14.5px; }
  .hero { padding: 18px; margin-top: 16px; }
  .hero h1 { font-size: 19px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 19px; }
  .card { padding: 16px; border-radius: 16px; }
  .flash-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .map { padding-left: 40px; }
  .map-path { left: 18px; top: 30px; bottom: 42px; }
  .node-dot { width: 38px; height: 38px; left: -40px; font-size: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .entry-grid { grid-template-columns: 1fr; }
  .report-head { gap: 14px; padding: 16px; }
  .score-ring { width: 84px; height: 84px; }
  .score-ring .val b { font-size: 24px; }
  .modal { max-height: 92vh; }
  .modal-body { padding: 14px 16px 20px; }
  .hide-sm { display: none !important; }
  .admin-tabs button { padding: 7px 12px; font-size: 13px; }
  .write-area { min-height: 200px; padding: 13px; font-size: 15px; }
  #toast-host { bottom: 16px; width: calc(100% - 28px); }
  .toast { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
