:root {
  --page: #f3f5f4;
  --paper: #ffffff;
  --ink: #20342c;
  --muted: #697870;
  --line: #dce5df;
  --accent: #28644d;
  --accent-hover: #1e513d;
  --tint: #eaf2ed;
  --error: #a33832;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 44px;
  padding: 10px 17px;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:disabled { opacity: .48; cursor: default; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 2px 3px #193e2410; }
button.text { padding: 8px 4px; background: transparent; border-color: transparent; color: var(--accent); font-size: 13px; }
button:active:not(:disabled) { background: var(--tint); }
button.primary:active:not(:disabled) { background: var(--accent-hover); }
@media (hover: hover) {
  button:hover:not(:disabled) { border-color: #a5bbad; background: #f0f5f2; }
  button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  button.text:hover:not(:disabled) { border-color: transparent; background: var(--tint); }
}
.phone { max-width: 720px; margin: 0 auto; min-height: 100dvh; padding-bottom: 100px; }
header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 16px 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
header > span:first-child { font-size: 17px; font-weight: 650; letter-spacing: .04em; display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--accent); color: #fff; border-radius: 9px; font-size: 20px; font-weight: 600; line-height: 1; }
#account { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
#logout { color: var(--muted); }
main { padding: 32px 28px; min-width: 0; }
h1 { font-size: 29px; font-weight: 650; line-height: 1.35; letter-spacing: -.6px; margin: 0 0 28px; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 0 0 14px; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
p { margin: 0 0 10px; }
.small { font-size: 13px; line-height: 1.65; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.card, .list, .management-form, .entry-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
}
.card h2 { margin-bottom: 6px; }
.list { padding: 0 22px; }
.item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.picks button { color: var(--accent); background: var(--tint); border-color: transparent; min-height: 40px; padding: 8px 18px; font-size: 14px; }
.tag { color: var(--accent); background: var(--tint); border-radius: 6px; font-size: 12px; padding: 4px 9px; font-weight: 500; }
.field { display: block; font-size: 13px; font-weight: 550; margin: 20px 0 8px; color: #4c6055; }
.management-form > .field:first-child { margin-top: 0; }
input:not([type=checkbox]), textarea, select {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 16px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder, textarea::placeholder { color: #87928b; font-weight: 400; }
input[type=search] { background: #f8faf9; }
textarea { min-height: 150px; line-height: 1.85; resize: vertical; padding: 14px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.check { display: flex; gap: 9px; align-items: center; min-height: 44px; font-size: 14px; }
.wide { width: 100%; margin-top: 12px; }
.source { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.9; }
.divider { border-top: 1px solid var(--line); margin: 24px 0 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin: 20px 0 0; grid-column: 1 / -1; }
.pagination button { font-size: 13px; padding: 8px 12px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 550; min-height: 44px; padding: 10px 0; }
details { margin-top: 16px; }
details.card > summary { padding: 0; display: list-item; min-height: 24px; }
details[open] > summary { margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.notice { background: var(--tint); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 15px; font-size: 13px; color: var(--accent); }
#notice { margin: 0 28px 12px; font-size: 14px; color: var(--error); overflow-wrap: anywhere; }
#notice:empty { display: none; }
nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 720px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  gap: 6px;
  box-shadow: 0 -4px 24px #20342c05;
}
nav button { font-size: 14px; border: 0; background: transparent; color: var(--muted); padding: 12px 0; }
nav button[aria-current=page] { background: var(--tint); color: var(--accent); font-weight: 600; }
:focus-visible { outline: 3px solid #7ca88d; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.management-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 12px 0 30px; background: #e7ede9; padding: 5px; border-radius: 11px; }
.management-tabs button { padding: 8px 4px; font-size: 14px; background: transparent; border-color: transparent; color: var(--muted); }
.management-tabs button[aria-current=page] { color: var(--accent); background: var(--paper); box-shadow: 0 1px 4px #20342c12; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 16px; margin: 18px 0; }
legend { max-width: 100%; padding: 0 7px; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.scope-list { max-height: 420px; overflow: auto; padding: 0 4px; overscroll-behavior: contain; }
.scope-list fieldset { background: var(--paper); }
.scope-list .check { display: inline-flex; margin-right: 14px; }
.preview { border: 1px solid #90b29c; border-radius: var(--radius); background: #f8fbf9; margin: 24px 0 0; padding: 20px; }
.preview h3 { margin-top: 20px; }
.roster-row { background: #f8faf9; padding: 18px; margin-top: 24px; }
.roster-row .field { font-size: 13px; }
.roster-row textarea, .management-form > textarea { min-height: 94px; }
.roster-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.roster-toolbar button { color: var(--accent); border-color: #bfd1c5; }
.management-tabs:has(button:only-child) { grid-template-columns: 1fr; }
.student-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.student-grid .card { margin: 0; }
.student-grid > .small { grid-column: 1 / -1; }
main[data-page="开始今天的沟通"] { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; margin: 64px auto; max-width: 420px; padding: 32px; box-shadow: 0 8px 32px #20342c06; }
main[data-page="开始今天的沟通"] h1 { font-size: 26px; }
main[data-page="管理"] > h2 { margin-top: 24px; }
@media (min-width: 1024px) {
  .phone { max-width: 1160px; padding: 0 0 64px 210px; position: relative; }
  header { min-height: 88px; margin-left: -210px; padding: 20px 32px; }
  main { max-width: 840px; margin: 0 auto; padding: 44px 40px 32px; }
  h1 { font-size: 32px; }
  nav { left: max(0px, calc((100vw - 1160px) / 2)); top: 120px; bottom: auto; width: 190px; transform: none; display: flex; flex-direction: column; background: transparent; border: 0; box-shadow: none; padding: 0 12px 0 24px; gap: 8px; }
  nav button { text-align: left; padding: 13px 20px; }
  nav button[aria-current=page] { background: #e0ebe3; }
  #notice { max-width: 760px; margin: 0 auto; }
  .phone:has(nav[hidden]) { padding-left: 0; }
  .phone:has(nav[hidden]) header { margin-left: 0; }
}
@media (max-width: 540px) {
  header { min-height: 68px; padding: 12px 20px; gap: 9px; }
  header > span:first-child { font-size: 16px; gap: 9px; }
  .brand-mark { width: 28px; height: 28px; font-size: 18px; border-radius: 8px; }
  main { padding: 26px 20px; }
  h1 { font-size: 27px; margin-bottom: 24px; }
  .card, .management-form, .entry-form { padding: 18px; }
  .student-grid { grid-template-columns: 1fr; gap: 12px; }
  .student-grid .card { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .student-grid .card h2 { grid-column: 1; font-size: 17px; }
  .student-grid .card .small { grid-column: 1; margin-bottom: 0; }
  .student-grid .card .picks { grid-column: 2; grid-row: 1 / 3; margin: 0; justify-content: flex-end; max-width: 180px; }
  .picks button { padding: 8px 12px; min-height: 44px; }
  .roster-row { padding: 14px; }
  #notice { margin-inline: 20px; }
  main[data-page="开始今天的沟通"] { margin: 36px 20px; padding: 26px; }
}
@media (max-width: 360px) {
  main { padding-inline: 14px; }
  .card, .management-form, .entry-form { padding: 14px; }
  .student-grid .card .picks { max-width: 145px; }
  .management-tabs button { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  button, input, textarea, select { transition: none; }
}

main[data-page="本月沟通查漏"] > div > h2 { margin-top: 28px; }

/* Import review keeps complete labels and controls usable on narrow screens. */
.management-tabs { grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); }
.import-item { background: var(--paper); overflow-wrap: anywhere; }
.import-item .notice { margin-top: 12px; }
input[type=file] { font-size: 14px; padding: 10px; }
input[type=file]::file-selector-button { border: 0; border-radius: 6px; padding: 8px 12px; margin-right: 8px; color: var(--accent); background: var(--tint); }
@media (max-width: 540px) { .preview { padding: 14px; } .import-item { padding: 12px; } .management-tabs { grid-template-columns: repeat(3, 1fr); } }


.bootstrap-panel { margin: 24px 0; }
.roster-totals { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:24px 0; }
.roster-totals > div { background:var(--paper); padding:16px; border:1px solid var(--line); border-radius:12px; }
.roster-totals strong { display:block; font-size:28px; line-height:1.3; font-weight:600; }
.roster-totals span { color:var(--muted); font-size:13px; }
.bootstrap-list { border:1px solid var(--line); border-radius:12px; background:var(--paper); overflow:hidden; }
.bootstrap-row { display:flex; justify-content:space-between; gap:16px; padding:15px 18px; border-bottom:1px solid var(--line); }
.bootstrap-row:last-child { border-bottom:0; }
.bootstrap-row h3 { font-size:16px; margin:0 0 4px; }
.bootstrap-row p { margin:4px 0 0; }
.bootstrap-row > div:last-child { text-align:right; flex-shrink:0; }
.identity-review { border:1px solid #dbc394; background:#fffaf0; border-radius:12px; padding:18px; margin:24px 0; }
.identity-choice { padding:12px 0; border-top:1px solid #e8ddc5; }
.source-phone { white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0; font-size:13px; }
.bootstrap-action { margin:24px 0; padding-top:12px; }
@media(max-width:540px){.roster-totals{gap:8px}.roster-totals > div{padding:12px}.roster-totals strong{font-size:24px}.bootstrap-row{padding:13px 12px;gap:10px}.identity-review{padding:14px}}

.family-candidate{padding:24px;margin:18px 0;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
.family-candidate h3{margin-top:0;line-height:1.5}.family-candidate-member{padding:7px 0}.family-candidate-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px;border-top:1px solid var(--line);padding-top:12px}
@media(max-width:600px){.family-candidate{padding:16px}.family-candidate-actions{gap:8px}}

.family-import-students { max-height: 22rem; overflow-y: auto; margin-top: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; }

/* v61 mobile growth flow. Scoped so existing communication/admin views stay stable. */
.growth-ui { --growth-green: #087d48; min-width: 0; padding-bottom: 28px; overflow-wrap: anywhere; }
.growth-ui h1 { font-size: 27px; margin: 4px 0 18px; letter-spacing: -.4px; }
.growth-ui h2 { font-size: 17px; margin-bottom: 12px; }
.growth-ui h3 { font-size: 15px; margin: 12px 0; }
.growth-eyebrow { color: #66756d; font-size: 13px; }
.growth-card { background: #fff; border: 1px solid #e4e9e6; border-radius: 12px; margin: 14px 0; padding: 20px; min-width: 0; }
.growth-focus { font-size: 22px; font-weight: 600; line-height: 1.45; }
.growth-muted { color: #69766f; font-size: 13px; line-height: 1.7; margin: 7px 0; white-space: pre-wrap; }
.growth-quote { white-space: pre-wrap; border-left: 3px solid #dde8e0; padding-left: 12px; }
.growth-label { display: block; font-size: 14px; font-weight: 550; margin: 20px 0 8px; }
.growth-ui input, .growth-ui textarea, .growth-ui select { font-size: 16px; max-width: 100%; min-width: 0; scroll-margin-block: 24px; }
.growth-ui textarea { min-height: 108px; }
.growth-ui button, .growth-ui summary { min-height: 44px; }
.growth-ui button { margin-top: 10px; font-size: 15px; }
.growth-primary { background: var(--growth-green); color: #fff; border-color: var(--growth-green); width: 100%; }
.growth-primary:hover:not(:disabled), .growth-primary:active:not(:disabled) { background: #09653c; color: #fff; }
.growth-button { background: #fff; color: #236245; }
.growth-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.growth-actions > button { flex: 1 1 100px; width: auto; }
.growth-details { background: #fff; border-radius: 10px; padding: 8px 14px; margin: 12px 0; min-width: 0; }
.growth-details > summary { padding: 10px 0; }
.growth-details > button { margin-right: 8px; }
.growth-check { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 6px 0; }
.growth-row + .growth-row, .growth-timeline-row + .growth-timeline-row { border-top: 1px solid #e8ede9; padding-top: 18px; margin-top: 18px; }
.growth-timeline-row > p:not(.growth-muted) { white-space: pre-wrap; }
.growth-image-comparison { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.growth-image-comparison > div { min-width: 0; }
.growth-image-comparison img { max-width: 100%; height: auto; display: block; }
@media (max-width: 420px) {
 .growth-card { padding: 16px; border-radius: 10px; }
 .growth-ui h1 { font-size: 25px; }
 .growth-ui input[type=file] { padding: 8px 5px; font-size: 16px; }
 .growth-details { padding-inline: 10px; }
 .growth-image-comparison { gap: 8px; }
}
.growth-legacy-menu { grid-column: 1 / -1; margin: 0; text-align: center; }
.growth-legacy-menu summary { min-height: 44px; padding: 8px; font-size: 13px; color: var(--muted); }
.growth-legacy-menu button { margin: 0 6px; padding: 9px 12px; }
.phone:has(.growth-legacy-menu) { padding-bottom: 180px; }
.growth-legacy-menu[open] { max-height: 40dvh; overflow-y: auto; }

/* v61 analysis candidates stay in the teacher review flow. */
.growth-ui .growth-candidate { margin: 14px 0; border-left: 3px solid #c5d6ce; }
.growth-ui .growth-candidate-review { margin-top: 16px; padding: 12px; background: #f3f6f4; border-radius: 8px; }
.growth-ui .growth-candidate-review[hidden] { display: none; }
.growth-ui .growth-candidate textarea[readonly] { background: #f7f8f7; }

/* First-family follow-up keeps the primary path short on a phone. */
.first-followup-ui { max-width: 640px; margin-inline: auto; overflow-wrap: anywhere; }
.first-followup-ui h1 { margin-bottom: 16px; font-size: 26px; }
.first-followup-ui h3 { margin: 18px 0 8px; }
.first-card { padding: 20px; margin: 16px 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.first-card h2 { font-size: 17px; margin-bottom: 12px; }
.first-card p { white-space: pre-wrap; }
.first-muted, .first-eyebrow { color: var(--muted); font-size: 13px; }
.first-eyebrow { margin-bottom: 8px; }
.first-focus { font-size: 18px; line-height: 1.65; }
.first-followup-ui textarea { min-height: 108px; }
.first-followup-ui input[type=checkbox] { margin-bottom: 10px; }
.first-followup-ui input:disabled, .first-followup-ui textarea:disabled, .first-followup-ui select:disabled { color: var(--muted); background: var(--page); opacity: 1; }
@media (max-width: 360px) { .first-card { padding: 15px; } }
nav[data-workflow="63"] .growth-legacy-menu summary { min-height: 32px; padding: 4px 8px; }
nav[data-workflow="63"] .growth-legacy-menu > a { display: block; padding: 9px 12px; min-height: 44px; color: var(--accent); text-decoration: none; font-size: 13px; }
.phone:has(nav[data-workflow="63"]) { padding-bottom: 124px; }
