:root {
  --ink: #203c3b;
  --muted: #758b89;
  --teal: #368c80;
  --teal-dark: #28766c;
  --teal-soft: #e4f2ed;
  --blue: #628caa;
  --blue-soft: #eaf2f7;
  --cream: #f8f6ee;
  --paper: #ffffff;
  --bg: #f4f8f7;
  --line: #e6eeeb;
  --amber: #b77935;
  --amber-soft: #fff5e4;
  --shadow: 0 8px 28px rgba(45, 83, 76, .065);
}

* { box-sizing: border-box; }
html { background: #eaf0ee; }
body {
  margin: 0;
  color: var(--ink);
  background: #eaf0ee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: none; cursor: pointer; }
svg { display: block; }

.phone-shell {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 50px rgba(30, 61, 57, .08);
}
.app-header {
  height: 78px;
  padding: 17px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244, 248, 247, .96);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 13px;
  display: grid; place-items: center;
  color: white; background: var(--teal);
  box-shadow: 0 5px 12px rgba(54, 140, 128, .18);
}
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: 19px; line-height: 1.15; letter-spacing: 1px; }
.brand small { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; letter-spacing: .3px; }
.student-chip { display: flex; align-items: center; gap: 5px; padding: 5px 7px 5px 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; font-size: 11px; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f3ddba; color: #8d683e; font-size: 11px; }
.chevron { color: #8a9c99; font-size: 14px; margin-top: -3px; }
#app { padding: 5px 18px 108px; min-height: calc(100vh - 78px); outline: none; }
.page { animation: enter .25s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 5px 2px 17px; }
.page-heading h1 { font-size: 25px; line-height: 1.25; margin: 0; letter-spacing: -.5px; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.text-button { color: var(--teal-dark); font-size: 12px; padding: 7px 10px; background: var(--teal-soft); border-radius: 10px; white-space: nowrap; }
.back-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 23px; line-height: 1; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 23px 2px 11px; }
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.section-head span, .section-head a { color: var(--muted); font-size: 11px; }
.card { background: var(--paper); border: 1px solid rgba(224, 235, 231, .8); border-radius: 20px; box-shadow: var(--shadow); }

.status-card { padding: 20px; overflow: hidden; position: relative; background: linear-gradient(135deg, #e1f2eb 0%, #f1f8f4 65%, #e8f1f4 100%); border: 0; }
.status-card::after { content: ""; position: absolute; width: 150px; height: 150px; border: 28px solid rgba(255,255,255,.32); border-radius: 50%; right: -69px; top: -65px; }
.status-top { display: flex; align-items: flex-start; gap: 13px; position: relative; z-index: 1; }
.status-symbol { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.85); color: var(--teal); box-shadow: 0 4px 12px rgba(55,100,90,.06); }
.status-symbol svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status-copy { flex: 1; }
.status-copy h2 { margin: 0 0 4px; font-size: 21px; font-weight: 700; }
.status-copy p { margin: 0; font-size: 12px; color: #68827c; }
.confirm-tag { font-size: 10px; padding: 4px 8px; border-radius: 20px; color: var(--teal-dark); background: rgba(255,255,255,.8); white-space: nowrap; }
.confirm-tag.pending { color: var(--amber); background: #fff7e8; }
.status-foot { margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(80,130,117,.12); display: flex; justify-content: space-between; align-items: center; color: #68827c; font-size: 11px; position: relative; z-index: 1; }
.status-foot strong { font-weight: 500; color: var(--teal-dark); }
.alert-card { margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--amber-soft); border: 1px solid #f2dfbd; }
.alert-title { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 650; color: #94652e; }
.alert-card p { color: #8a7457; font-size: 12px; margin: 8px 0 12px; }
.alert-actions { display: flex; gap: 8px; }
.alert-actions button { padding: 7px 12px; background: white; border-radius: 9px; color: #92632c; font-size: 11px; }
.alert-switch { display: flex; margin-top: 12px; gap: 12px; font-size: 11px; }
.alert-switch button { padding: 0; color: #a58a67; }
.alert-switch button.active { color: #94652e; text-decoration: underline; text-underline-offset: 3px; }

.attendance-card { padding: 18px; }
.attendance-times { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 17px; align-items: center; }
.attendance-times .divider { height: 33px; background: var(--line); }
.time-label { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 5px; }
.time-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.time-label i.blue { background: var(--blue); }
.time-value { font-size: 22px; font-weight: 650; margin-top: 4px; letter-spacing: .3px; }
.time-value small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.gate-shot { margin-top: 16px; border-radius: 14px; overflow: hidden; position: relative; }
.gate-shot .scene-art { aspect-ratio: 2.35; }
.gate-caption { position: absolute; left: 12px; bottom: 10px; padding: 4px 8px; border-radius: 7px; color: white; background: rgba(24,48,45,.55); font-size: 10px; backdrop-filter: blur(5px); }
.text-only { padding: 14px; background: #f6f9f8; border-radius: 13px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.text-only::before { content: "文"; flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); border-radius: 8px; font-size: 11px; }

.timeline { padding: 4px 18px; }
.timeline-item { display: grid; grid-template-columns: 45px 18px 1fr; gap: 8px; min-height: 61px; position: relative; }
.timeline-time { padding-top: 15px; font-size: 12px; color: #526c68; font-variant-numeric: tabular-nums; }
.timeline-rail { display: flex; justify-content: center; position: relative; }
.timeline-rail::after { content: ""; position: absolute; width: 1px; top: 25px; bottom: -15px; background: #dce9e5; }
.timeline-item:last-child .timeline-rail::after { display: none; }
.timeline-dot { width: 9px; height: 9px; border: 2px solid white; background: var(--teal); border-radius: 50%; margin-top: 19px; z-index: 1; box-shadow: 0 0 0 2px #b9dcd2; }
.timeline-item.pending .timeline-dot { background: white; box-shadow: 0 0 0 1px #b8cbc6; }
.timeline-content { padding: 13px 0 14px; border-bottom: 1px solid #edf2f0; }
.timeline-item:last-child .timeline-content { border: 0; }
.timeline-content strong { display: block; font-size: 13px; font-weight: 600; }
.timeline-content small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.timeline-item.pending .timeline-content { color: #94a4a1; }

.moment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.moment-card { overflow: hidden; text-align: left; padding: 0; width: 100%; display: block; }
.moment-card:first-child { grid-column: 1 / -1; }
.moment-card .scene-art { aspect-ratio: 1.65; }
.moment-card:first-child .scene-art { aspect-ratio: 2.05; }
.moment-info { padding: 12px 13px 13px; }
.moment-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.moment-meta .scene-name { color: var(--teal-dark); }
.moment-info h3 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.55; }
.moment-card:first-child .moment-info h3 { font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { font-size: 9px; color: #66817c; background: #f0f6f4; padding: 3px 7px; border-radius: 6px; }
.summary-card { padding: 17px; display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(120deg, #f8f6ed, #fff); }
.summary-icon { width: 31px; height: 31px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: #eee9d8; color: #9a8550; }
.summary-card h3 { margin: 0 0 4px; font-size: 12px; }
.summary-card p { margin: 0; color: #6e7c75; font-size: 12px; line-height: 1.7; }

.filter-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 17px; padding: 0 18px 4px; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 8px 15px; border-radius: 20px; background: white; border: 1px solid var(--line); font-size: 12px; color: #6e827f; }
.filter-chip.active { color: white; background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 10px rgba(54,140,128,.15); }
.feed-list { display: grid; gap: 15px; }
.feed-card { overflow: hidden; padding: 0; text-align: left; }
.feed-card .scene-art { aspect-ratio: 1.95; }
.feed-card .moment-info { padding: 15px 16px 16px; }
.feed-card h3 { font-size: 14px; }
.feed-date { padding: 3px 2px 0; color: var(--muted); font-size: 11px; }
.empty-state { padding: 40px 25px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 6px; }

.scene-art { width: 100%; position: relative; overflow: hidden; background: #dfede7; }
.scene-art > svg { width: 100%; height: 100%; }
.privacy-watermark { position: absolute; top: 10px; right: 10px; color: rgba(255,255,255,.95); background: rgba(36,65,61,.38); border: 1px solid rgba(255,255,255,.3); padding: 4px 7px; border-radius: 6px; font-size: 9px; letter-spacing: .3px; backdrop-filter: blur(5px); }
.scene-label { position: absolute; left: 11px; top: 10px; padding: 3px 7px; border-radius: 6px; color: #41655e; background: rgba(255,255,255,.75); font-size: 9px; }

.detail-visual { margin: 0 -18px; }
.detail-visual .scene-art { aspect-ratio: 1.35; }
.detail-head { margin: 15px 2px 17px; }
.detail-head .moment-meta { font-size: 11px; }
.detail-head h1 { font-size: 20px; line-height: 1.45; margin: 7px 0 10px; }
.sense-list { display: grid; gap: 10px; }
.sense-card { padding: 15px 16px; display: grid; grid-template-columns: 35px 1fr; gap: 12px; align-items: start; }
.sense-icon { width: 35px; height: 35px; border-radius: 11px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-size: 14px; font-weight: 650; }
.sense-copy h3 { margin: 0; font-size: 13px; }
.sense-copy p { margin: 4px 0 0; font-size: 12px; color: #6e817e; line-height: 1.65; }
.sense-copy .off { color: #99a7a4; }
.sense-card.muted { background: #f8faf9; box-shadow: none; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.primary-button, .secondary-button { min-height: 45px; border-radius: 14px; font-size: 13px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 7px; }
.primary-button { background: var(--teal); color: white; box-shadow: 0 5px 14px rgba(54,140,128,.18); }
.primary-button.saved { background: #e5f1ed; color: var(--teal-dark); box-shadow: none; }
.secondary-button { background: white; border: 1px solid #dce8e4; color: var(--teal-dark); }
.privacy-note { text-align: center; color: #94a39f; font-size: 10px; margin: 13px 0 0; }

.week-banner { padding: 20px; background: linear-gradient(135deg, #e6f1f5, #f1f7f5); border: 0; }
.week-banner small { color: #6d8589; font-size: 11px; }
.week-banner h2 { font-size: 21px; margin: 4px 0 6px; }
.week-banner p { margin: 0; color: #6d8582; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.metric-card { padding: 17px; }
.metric-card .metric-label { font-size: 11px; color: var(--muted); }
.big-number { margin: 7px 0 3px; font-size: 29px; font-weight: 650; line-height: 1.1; color: var(--teal-dark); }
.big-number small { font-size: 12px; font-weight: 400; }
.metric-card p { margin: 0; font-size: 11px; color: #6e817d; }
.chart-card { padding: 18px; }
.chart-title { display: flex; justify-content: space-between; align-items: center; }
.chart-title h3 { font-size: 14px; margin: 0; }
.chart-title span { color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 15px; margin: 14px 0 5px; justify-content: flex-end; font-size: 10px; color: var(--muted); }
.chart-legend i { width: 7px; height: 7px; display: inline-block; border-radius: 2px; margin-right: 4px; background: var(--teal); }
.chart-legend .last i { background: #dce7e4; }
.bar-chart { height: 170px; display: grid; grid-template-columns: 1fr 1fr; gap: 35px; padding: 10px 25px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #edf2f0 43px); }
.bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 9px; position: relative; }
.bar { width: 27px; border-radius: 7px 7px 0 0; background: linear-gradient(#5ba99c, #8ac5b9); position: relative; min-height: 4px; }
.bar.last { background: #dce7e4; }
.bar em { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: #5c7570; }
.bar-label { position: absolute; bottom: -27px; width: 100px; text-align: center; font-size: 11px; color: #617772; }
.chart-caption { margin: 39px 0 0; padding: 11px 12px; border-radius: 11px; background: #f3f8f6; color: #657c77; font-size: 11px; }
.growth-card { padding: 16px; display: flex; gap: 13px; align-items: center; }
.growth-badge { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 15px; background: #f8edda; display: grid; place-items: center; color: #ac8348; font-size: 22px; }
.growth-card h3 { font-size: 13px; margin: 0 0 4px; }
.growth-card p { font-size: 11px; color: var(--muted); margin: 0; }
.neutral-note { margin-top: 18px; color: #8a9b97; text-align: center; font-size: 10px; line-height: 1.8; }

.message-list { display: grid; gap: 11px; }
.message-card { padding: 16px; display: grid; grid-template-columns: 39px 1fr; gap: 12px; position: relative; }
.message-card.unread::after { content: ""; width: 6px; height: 6px; background: var(--teal); border-radius: 50%; position: absolute; right: 13px; top: 13px; }
.message-icon { width: 39px; height: 39px; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-size: 16px; }
.message-icon.alert { background: var(--amber-soft); color: var(--amber); }
.message-icon.blue { background: var(--blue-soft); color: var(--blue); }
.message-head { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.message-head h3 { margin: 0; font-size: 13px; }
.message-head time { margin-left: auto; color: #97a5a2; font-size: 9px; white-space: nowrap; }
.message-card p { margin: 5px 0 0; font-size: 11px; color: #6e817d; line-height: 1.65; }
.message-link { display: inline-block; margin-top: 8px; font-size: 10px; color: var(--teal-dark); }

.settings-group { margin-bottom: 21px; }
.settings-group > h2 { font-size: 13px; margin: 0 2px 9px; }
.settings-card { overflow: hidden; padding: 0 16px; }
.setting-row { padding: 15px 0; border-bottom: 1px solid #edf2f0; }
.setting-row:last-child { border: 0; }
.setting-main { display: flex; gap: 12px; align-items: center; }
.setting-copy { flex: 1; }
.setting-copy strong { display: block; font-size: 13px; font-weight: 600; }
.setting-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; line-height: 1.55; }
.switch { width: 42px; height: 24px; border-radius: 20px; background: #d6e0dd; padding: 3px; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: .2s; }
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(18px); }
.scene-settings { margin: 2px 0 13px; padding: 11px 12px; background: #f6f9f8; border-radius: 12px; display: flex; flex-wrap: wrap; gap: 8px 13px; }
.check-label { display: flex; align-items: center; gap: 5px; color: #647a75; font-size: 10px; cursor: pointer; }
.check-label input { accent-color: var(--teal); width: 13px; height: 13px; margin: 0; }
.segment-control { display: flex; padding: 3px; background: #eff4f2; border-radius: 11px; margin-top: 11px; }
.segment-control button { flex: 1; padding: 7px 3px; border-radius: 8px; font-size: 11px; color: #758884; }
.segment-control button.active { background: white; color: var(--teal-dark); box-shadow: 0 2px 6px rgba(45,80,72,.08); font-weight: 600; }
.privacy-list { padding: 3px 0; }
.privacy-row { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; font-size: 11px; }
.privacy-row span { color: var(--muted); }
.privacy-row strong { font-weight: 500; text-align: right; }
.privacy-row strong.ok { color: var(--teal-dark); }
.danger-button { color: #a2695e; border: 1px solid #eddfdb; background: #fffaf8; width: 100%; padding: 10px; border-radius: 11px; margin: 8px 0 14px; font-size: 11px; }
.forbidden-note { padding: 13px 14px; background: #f7f8f5; border-radius: 15px; color: #7c8981; font-size: 10px; line-height: 1.75; }
.forbidden-note strong { color: #5f7168; display: block; margin-bottom: 3px; font-size: 11px; }

.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 390px; height: 76px; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.96); border-top: 1px solid rgba(218,230,226,.8); backdrop-filter: blur(18px); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8b9b98; font-size: 10px; position: relative; }
.bottom-nav a.active { color: var(--teal-dark); font-weight: 600; }
.nav-icon { width: 23px; height: 23px; }
.nav-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a.active .nav-icon { filter: drop-shadow(0 3px 4px rgba(54,140,128,.12)); }
.unread-dot { position: absolute; width: 5px; height: 5px; background: #d98b69; border: 1px solid white; border-radius: 50%; top: 0; left: calc(50% + 7px); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(24,45,42,.42); display: flex; align-items: flex-end; justify-content: center; padding: 18px; backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 354px; background: white; border-radius: 24px; padding: 23px; box-shadow: 0 18px 50px rgba(20,45,40,.2); animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(20px); } }
.modal-symbol { width: 46px; height: 46px; border-radius: 15px; background: var(--teal-soft); display: grid; place-items: center; font-size: 21px; color: var(--teal); margin-bottom: 14px; }
.modal h2 { font-size: 18px; margin: 0 0 9px; }
.modal p { font-size: 12px; color: #6c817c; line-height: 1.75; margin: 0 0 12px; }
.modal ul { margin: 0 0 17px; padding: 13px 13px 13px 29px; border-radius: 12px; background: #f5f8f7; color: #71847f; font-size: 11px; line-height: 1.9; }
.modal .primary-button { width: 100%; }
.modal .modal-cancel { width: 100%; text-align: center; padding: 12px 0 0; color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 94px; transform: translate(-50%, 12px); max-width: 320px; padding: 10px 16px; color: white; background: rgba(30,56,52,.9); border-radius: 12px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 500px) {
  body { padding: 24px 0; }
  .phone-shell { min-height: calc(100vh - 48px); border-radius: 28px; overflow: hidden; }
  .app-header { top: 24px; border-radius: 28px 28px 0 0; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 28px 28px; }
}
@media (max-width: 350px) {
  #app { padding-left: 14px; padding-right: 14px; }
  .app-header { padding-left: 14px; padding-right: 14px; }
  .brand small { display: none; }
  .status-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
