/* 试用版外壳页（登录、课堂页、助手、个性化、课后问卷、后台）共用样式：冷灰底、白色薄片、深色小黑板，靠留白和柔和阴影分层，手机优先 */
:root {
  --bg: #F3F4F6; --card: #FFFFFF; --soft: #E8E9ED; --line: #ECEDF0; --text: #1B1D21; --muted: #686C74;
  --blue: #17181C; --blue-hover: #2B2D33; --blue-soft: #E8E9ED; --red: #B3261E;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --lift: 0 1px 2px rgba(20, 22, 28, .04), 0 10px 26px rgba(20, 22, 28, .05);
  font-family: var(--sans); color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 560px; margin: 0 auto; padding: 8px 20px 64px; }
body.nav .wrap { padding-bottom: 104px; }
h1 { font-size: 23px; font-weight: 400; line-height: 1.4; margin: 0 0 4px; letter-spacing: .01em; }
h2 { font-size: 14px; font-weight: 500; margin: 0 0 10px; }
p.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: #B8BBC1; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--red); min-height: 20px; margin-top: 8px; font-size: 13px; }

/* 顶栏只放站名和积分；导航是底部悬浮的一条 */
.top { display: flex; align-items: center; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; padding: 20px 20px 6px; font-size: 13px; }
.top .brand { color: var(--muted); text-decoration: none; }
.top .grow { flex: 1; }
.top .quota { color: var(--muted); white-space: nowrap; text-decoration: none; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.tabs { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; display: flex; gap: 2px; padding: 5px; border-radius: 26px; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 12px 28px rgba(20, 22, 28, .14); }
.tabs a { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 86px; height: 42px; padding: 0 12px; border-radius: 21px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.tabs a[aria-current=page] { background: var(--blue); color: #fff; }
.tabs a span { max-width: 5.5em; overflow: hidden; text-overflow: ellipsis; }
.tabs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (hover: hover) { .tabs a:not([aria-current=page]):hover { color: var(--text); } }

button, .btn {
  font: inherit; font-size: 14px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 0;
  background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px #DDDFE4; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.primary, .btn.primary { background: var(--blue); box-shadow: none; color: #fff; font-weight: 500; }
@media (hover: hover) { button:not(:disabled):hover, .btn:hover { background: #F7F8F9; } button.primary:not(:disabled):hover, .btn.primary:hover { background: var(--blue-hover); } }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input[type=text], input[type=password], select, textarea {
  font: inherit; width: 100%; border: 0; box-shadow: inset 0 0 0 1px #DDDFE4; border-radius: 14px; padding: 11px 14px; background: var(--card); color: var(--text);
}
input[type=text]:focus, input[type=password]:focus, select:focus, textarea:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--blue); }
::placeholder { color: #8B8F96; }
textarea { min-height: 96px; resize: vertical; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }

/* 选项（问卷和学科） */
.q { margin: 24px 0; }
.q .t { font-weight: 500; margin-bottom: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.row { flex-direction: row; flex-wrap: wrap; }
.opt { text-align: left; justify-content: flex-start; height: auto; min-height: 44px; padding: 10px 16px; border-radius: 14px; }
.q input.other { margin-top: 8px; font-size: 14px; }
.opt[aria-pressed=true] { background: var(--blue); color: #fff; box-shadow: none; }

/* 白色薄片 */
.card { background: var(--card); border-radius: 18px; padding: 18px 16px; margin-top: 12px; box-shadow: var(--lift); }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 2px 10px; font-size: 14px; min-height: 32px; }
.sec .hint { font-size: 13px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.head h2 { margin: 0; }

/* 课堂页：小黑板 */
.greet { margin: 10px 2px 16px; }
.slate { position: relative; overflow: hidden; display: block; min-height: 196px; padding: 18px 18px 68px; border-radius: 22px; background: var(--blue); color: #F1F1EF; text-decoration: none; box-shadow: 0 16px 34px rgba(20, 22, 28, .2); }
.slate::before { content: ""; position: absolute; left: -30%; top: -70%; width: 120%; height: 160%; background: radial-gradient(closest-side, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0)); pointer-events: none; }
.slate > * { position: relative; }
.slate .lab { font-size: 12px; color: #A8ABB2; }
.slate .prob { margin-top: 10px; font-family: "Times New Roman", Tinos, var(--sans); font-size: 17px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.slate .how { position: absolute; left: 18px; right: 136px; bottom: 16px; font-size: 12px; line-height: 1.45; color: #A8ABB2; }
.slate .enter { position: absolute; right: 14px; bottom: 14px; height: 40px; padding: 0 8px 0 16px; border-radius: 20px; background: #F6F6F4; color: #17181C; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.slate .enter b { width: 26px; height: 26px; border-radius: 50%; background: #17181C; color: #fff; display: grid; place-items: center; font-weight: 400; font-size: 13px; }
@media (hover: hover) { .slate:hover .enter { background: #fff; } }

/* 助手在课堂页说的一句话 */
.asst-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 13px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--lift); color: var(--text); text-decoration: none; }
.asst-card .orb { flex: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #C6DAFF, #4C8DFF 60%, #2C62D8); }
.asst-card .body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.asst-card .body b { display: block; font-weight: 500; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-card .go { flex: none; color: var(--muted); }

/* 模型切换 */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-top: 14px; border-radius: 16px; background: var(--soft); }
.seg button { display: block; min-height: 54px; padding: 7px 12px; border-radius: 13px; text-align: left; background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; line-height: 1.4; }
.seg button small { display: block; font-size: 11.5px; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(20, 22, 28, .12); }
.seg-note { font-size: 12px; color: var(--muted); margin: 7px 4px 0; }

/* 默认声音：小黑板旁边一张卡片，点开弹出选项，其余部分变半透明 */
.voice-card { display: flex; justify-content: flex-start; width: 100%; min-height: 56px; margin-top: 12px; padding: 9px 16px; gap: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--lift); text-align: left; }
.voice-card[hidden] { display: none; }
.voice-card svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.voice-card .txt { flex: 1; min-width: 0; line-height: 1.4; }
.voice-card small { display: block; font-size: 12px; color: var(--muted); }
.voice-card b { display: block; font-weight: 500; font-size: 14px; }
.voice-card i { flex: none; font-style: normal; font-size: 11px; color: var(--muted); }
.voice-dim { position: fixed; inset: 0; z-index: 40; background: rgba(243, 244, 246, .72); }
.voice-pop { position: fixed; z-index: 41; width: min(320px, calc(100vw - 32px)); padding: 12px; border-radius: 18px; background: var(--card); box-shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 18px 44px rgba(20, 22, 28, .2); display: flex; flex-direction: column; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.voice-dim[hidden], .voice-pop[hidden] { display: none; }
.voice-head { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 6px 10px; }
.voice-head b { font-weight: 500; font-size: 14px; }
.voices { display: grid; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.voice { position: relative; min-width: 0; }
.voice .pick { display: block; width: 100%; min-height: 54px; padding: 7px 50px 7px 12px; border-radius: 13px; text-align: left; background: transparent; box-shadow: none; color: var(--text); font-size: 14px; line-height: 1.4; }
.voice .pick small { display: block; font-size: 11.5px; color: var(--muted); }
.voice .pick[aria-pressed=true] { background: var(--soft); font-weight: 500; }
.voice .play { position: absolute; right: 10px; top: 50%; width: 32px; height: 32px; min-height: 32px; padding: 0; transform: translateY(-50%); border-radius: 50%; font-size: 11px; line-height: 1; }

/* 题库 */
.addbtn { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 16px; }
.subjects { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.subjects .opt { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 16px; }
.addrow { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.addrow .grow { flex: 1; min-width: 0; }
.addform { margin-bottom: 12px; }
.list .it { padding: 13px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; }
.list .it + .it { border-top: 1px solid var(--line); }
.list .it:first-child { padding-top: 0; }
.list .it:last-child { padding-bottom: 0; }
.list .it .meta { font-size: 11.5px; color: var(--muted); }
.list .it .tx { grid-column: 1; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.list .it .del { grid-column: 2; grid-row: 1 / span 2; min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 15px; color: var(--muted); white-space: nowrap; box-shadow: none; background: transparent; }
.list .it .del.armed { color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

/* 个性化 */
ol.mem { padding-left: 20px; margin: 8px 0 16px; font-size: 14px; }
ol.mem li { margin: 7px 0; }
.rule { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-size: 14px; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule span { flex: 1; min-width: 0; }
.rule button { flex: none; min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 15px; }
.rules-title { font-size: 12px; color: var(--muted); margin: 12px 0 2px; }

/* 登录 */
.login { min-height: 100vh; min-height: 100dvh; padding: 18vh 20px 24px; }
.login .box { width: 100%; max-width: 360px; margin: 0 auto; }
.login .sign { margin: 0 2px 18px; }
.login .sign h1 { margin: 0; }
.login .sign p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.login form { background: var(--card); border-radius: 18px; padding: 4px 16px 16px; box-shadow: var(--lift); }
.login form[hidden], .login-foot[hidden] { display: none; }
.login-foot { margin: 14px 2px 0; text-align: center; }
.login-foot .hint { margin-top: 8px; }
button.link { height: auto; min-height: 0; padding: 4px 8px; background: none; box-shadow: none; color: var(--blue); }
.account-no { font-size: 32px; font-weight: 700; letter-spacing: 3px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }

/* 电脑：导航收到左边一条，内容铺开；手机和窄窗口不受影响 */
@media (min-width: 1024px) {
  body.nav { padding-left: 216px; }
  body.nav .top { position: fixed; top: 0; bottom: 0; left: 0; width: 216px; max-width: none; margin: 0; padding: 26px 12px 22px; flex-direction: column; align-items: stretch; gap: 0; background: var(--card); box-shadow: 1px 0 0 var(--line); }
  body.nav .top .brand { padding: 0 12px 22px; font-size: 15px; font-weight: 500; color: var(--text); }
  body.nav .top .quota { padding: 0 12px; }
  body.nav .tabs { position: static; transform: none; flex-direction: column; gap: 4px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  body.nav .tabs a { justify-content: flex-start; gap: 10px; min-width: 0; padding: 0 12px; border-radius: 12px; font-size: 14px; }
  body.nav .tabs a span { max-width: none; }
  body.nav .wrap { max-width: 1180px; padding: 40px 48px 56px; }
  body.nav .wrap.home { max-width: 1520px; }
  body.nav .wrap > h1:first-child { font-size: 28px; }
  .prefs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto) 1fr; gap: 16px; align-items: start; }
  .prefs > h1, .prefs > .sub { grid-column: 1 / -1; margin-bottom: 0; }
  .prefs .card { grid-column: 1; margin-top: 0; padding: 22px; }
  .prefs .card.tall { grid-column: 2; grid-row: 3 / -1; } /* 老师记住的很长，独占右栏从头到底，左栏其余卡片紧贴着往下排，不被它撑出空白 */

  .greet { margin: 0 2px 20px; }
  .hero { display: flex; flex-wrap: wrap; gap: 16px; }
  .slate { flex: 1 1 0; min-width: 0; padding: 22px 26px 70px; }
  .voice-card { flex: 0 0 176px; width: auto; margin-top: 0; padding: 18px; flex-wrap: wrap; align-content: space-between; border-radius: 22px; }
  .voice-card svg { width: 26px; height: 26px; }
  .voice-card i { order: -1; margin-left: auto; }
  .voice-card svg { order: -2; }
  .voice-card .txt { flex: 0 0 100%; }
  .voice-card b { font-size: 16px; }
  .slate .prob { max-width: 46em; font-size: 18px; line-height: 1.6; -webkit-line-clamp: 3; }
  .slate .how { left: 26px; right: 170px; bottom: 20px; font-size: 13px; }
  .slate .enter { right: 18px; bottom: 16px; }
  .side { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 16px; } /* 窗口不够宽时另起一行 */
  .side > * { flex: 1 1 300px; min-width: 0; }
  .side .asst-card { margin-top: 0; }
  .side .seg { margin-top: 0; }

  .home .sec { margin: 26px 2px 10px; font-size: 15px; }
  .home #listCard { padding: 0; margin: 0; background: none; box-shadow: none; }
  .home .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
  .home .list .it, .home .list .it:first-child, .home .list .it:last-child { padding: 18px 20px; border-radius: 18px; background: var(--card); box-shadow: var(--lift); align-content: start; }
  .home .list .it + .it { border-top: 0; }
}

/* 够宽时三块排一行 */
@media (min-width: 1280px) {
  .side { flex: 0 0 340px; flex-direction: column; flex-wrap: nowrap; }
  .side > * { flex: none; }
  .side .asst-card { flex: 1; }
}

@media (max-width: 380px) { .tabs a { min-width: 76px; padding: 0 8px; } }
