/* Shared layout and controls */
:root {
  color-scheme: light;
  --bg: #f3f6f2;
  --paper: #fff;
  --ink: #172e26;
  --muted: #4f655b;
  --green: #1e5641;
  --green-hover: #153e2f;
  --pine: #123d32;
  --line: #d8e2da;
  --soft: #e8f0e8;
  --accent: #e3f3ad;
  --radius: 18px;
  --shadow: 0 2px 4px #173b2811;
  --gutter: clamp(16px, 4vw, 42px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.27; }
h1 { font-size: clamp(1.85rem, 3vw, 2.65rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.25rem, 1.8vw, 1.65rem); letter-spacing: -.02em; }
h3 { font-size: 1.08rem; }
a { color: var(--green); text-underline-offset: .18em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a56021; outline-offset: 3px; }
button, input, select { font: inherit; }
button {
  min-height: 44px;
  padding: .52rem .95rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--green-hover); }
button:disabled { cursor: default; opacity: .67; }
button.light { color: var(--green); background: var(--soft); }
button.light:hover:not(:disabled) { background: #dceadd; }
button.icon-button { min-width: 44px; }
input, select {
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #b9cbbf;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: .48rem .7rem;
}
input:not([type="file"]) { width: 100%; }
input[type="file"] { width: 100%; font-size: .9rem; }
select { padding-right: 1.1rem; }
label { color: var(--muted); font-size: .91rem; }
form { display: grid; gap: .65rem; max-width: 36rem; }
form button { justify-self: start; }
small { font-size: .875rem; }
.muted, .sub, .word-source { color: var(--muted); }
.sub { margin-top: .48rem; }
.word { font: 600 1.33rem/1.2 Georgia, serif; overflow-wrap: anywhere; }
.skip-link { position: fixed; top: .5rem; left: 1rem; z-index: 50; padding: .6rem 1rem; color: #fff; background: var(--pine); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* Navigation */
body > header { border-bottom: 1px solid var(--line); background: var(--paper); }
.bar, #app { width: min(100%, 1224px); margin: auto; padding-inline: var(--gutter); }
.bar { display: flex; align-items: center; gap: clamp(.9rem, 3vw, 2.9rem); min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: 1.4rem; font-weight: 780; white-space: nowrap; text-decoration: none; }
.brand-name { display: grid; line-height: 1.08; }
.brand small { font: italic .84rem/1.1 Georgia, serif; color: #506959; margin-top: .2rem; }
.mark { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 13px; background: var(--pine); color: var(--accent); font: bold italic 2rem/1 Georgia, serif; }
nav { display: flex; align-items: center; gap: .22rem; min-width: 0; }
nav a { display: grid; min-height: 44px; align-content: center; white-space: nowrap; padding: .45rem .7rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .91rem; font-weight: 580; }
nav a:hover, nav a.active { color: var(--pine); background: var(--soft); }
nav a.active { font-weight: 720; }
body[data-route="lesson"] .bar { min-height: 64px; }
body[data-route="lesson"] nav { display: none; }

/* Page sections and grids */
#app { padding-block: clamp(21px, 3vw, 42px) 70px; }
.intro { margin-bottom: 1.3rem; }
.sheet, .stats, .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sheet { margin-top: 1rem; padding: clamp(1rem, 2vw, 1.52rem); min-width: 0; }
.sheet h2 + p, .sheet h3 + p { margin-top: .45rem; }
.section, .row, .metric { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.section { margin-bottom: .65rem; align-items: flex-start; }
.section, .section-actions { flex-wrap: wrap; }
.section-actions { display: flex; gap: .5rem; align-items: center; }
.row > * { min-width: 0; }
.row > button { flex: none; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .9rem 0; }
.sheet > :last-child, .feedback > :last-child { margin-bottom: 0; }
.item { padding-block: .85rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.item:first-of-type { margin-top: .55rem; }
.item:last-child { padding-bottom: 0; }
.tag, .pill {
  display: inline-block;
  padding: .22rem .58rem;
  border-radius: 8px;
  background: var(--soft);
  color: #345944;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.4;
}
.feedback { margin: 1rem 0; padding: .85rem 1rem; border-left: 3px solid #87aa85; border-radius: 0 11px 11px 0; background: var(--soft); overflow-wrap: anywhere; }
.feedback p + p, .feedback b + p { margin-top: .25rem; }
.plan-settings { display: flex; flex-wrap: wrap; gap: .62rem 1rem; margin: .9rem 0; }
.plan-settings label { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; max-width: 100%; }
.plan-settings select { width: auto; }
.tab-strip { gap: .38rem; }
.tab-strip button.light { background: #edf2ee; }

/* Learning desk */
.board { display: grid; grid-template-columns: minmax(0, 2.12fr) minmax(0, 1fr); gap: 1rem; margin: .9rem 0 1.55rem; align-items: stretch; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 255px;
  padding: clamp(1.3rem, 4vw, 2.6rem);
  border-radius: var(--radius);
  background: linear-gradient(112deg, #143b30, #225843);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .38;
  background: repeating-linear-gradient(0deg, transparent 0 32px, #b8e0ab3d 33px 34px);
  mask-image: linear-gradient(90deg, transparent 45%, #000);
  pointer-events: none;
}
.hero .pill { color: #ebf4e9; background: #ffffff1a; }
.hero h2 { font: 500 clamp(2rem, 4vw, 3.35rem)/1.16 Georgia, "Microsoft YaHei", serif; margin: .78rem 0 .25rem; }
.hero p { color: #e7f1e8; }
.hero button { margin-top: 1.12rem; color: #173b2a; background: var(--accent); }
.hero button:hover:not(:disabled) { background: #d7ec92; }
.stats { display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: clamp(1rem, 3vw, 1.65rem); }
.big, dd { font-variant-numeric: tabular-nums; }
.stats .big { color: var(--pine); font-size: clamp(1.85rem, 4vw, 2.65rem); font-weight: 750; line-height: 1; padding: .22rem 0; }
.big small { color: var(--muted); font-size: .9rem; font-weight: 520; }
.meter { height: .47rem; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: #5c8666; }
.metric { color: var(--muted); font-size: .9rem; }
.metric b { color: var(--pine); white-space: nowrap; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
button.card { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: .3rem .75rem; padding: 1rem; text-align: left; color: var(--ink); }
button.card:hover:not(:disabled) { color: var(--ink); background: #f5faf4; border-color: #97b19e; }
.card .icon { grid-row: span 2; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: var(--soft); color: var(--green); font: bold 1.3rem/1 Georgia, serif; }
.card p { color: var(--muted); font-weight: 400; font-size: .91rem; line-height: 1.5; }

@media (max-width: 1050px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .bar { gap: .85rem; }
  nav a { padding-inline: .48rem; }
}
@media (max-width: 700px) {
  .bar { display: grid; gap: .5rem; padding-block: .65rem; }
  .brand { justify-self: start; font-size: 1.24rem; }
  .brand-name { display: flex; align-items: baseline; gap: .5rem; }
  .mark { width: 36px; height: 36px; border-radius: 11px; font-size: 1.75rem; }
  nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .3rem; }
  nav a { justify-items: center; padding-inline: .2rem; text-align: center; font-size: .87rem; }
  .board { grid-template-columns: 1fr; gap: .65rem; }
  .hero { min-height: 0; }
  .board .stats { gap: .38rem; }
  #app { padding-bottom: 42px; }
}
@media (max-width: 480px) {
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav a { min-height: 44px; }
  .intro { margin-bottom: 1rem; }
  .cards { grid-template-columns: 1fr; gap: .62rem; }
  .section { gap: .6rem; }
  .plan-settings { gap: .55rem; }
  .plan-settings label { flex: 1 1 135px; display: grid; gap: .24rem; }
  .plan-settings select { width: 100%; }
}
@media (max-height: 480px) {
  .bar { min-height: 54px; padding-block: .35rem; }
  body[data-route="lesson"] .bar { min-height: 52px; }
}


.storage-notice{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;width:min(100%,1140px);margin:.6rem auto;padding:.6rem 1rem;border-block:1px solid #ddbd92;background:#fff4df;color:#563912}
.storage-notice span{flex:1 1 230px}
@media print{.storage-notice{display:none}}
