:root {
  --ink: #162d2b;
  --ink-soft: #566a67;
  --cream: #f6f2e9;
  --paper: #fffdf8;
  --mint: #bfe3d0;
  --mint-deep: #1f6c5e;
  --coral: #ff8c6b;
  --line: #ded9cc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; background: radial-gradient(circle at 80% 0%, #e8efe5 0, transparent 28%), var(--cream); }

.topbar {
  height: 76px; padding: 0 34px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-bottom: 1px solid rgba(22,45,43,.1); background: rgba(255,253,248,.86); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: var(--ink); color: #ffe6a4; font-size: 19px; transform: rotate(-4deg); }
.brand div { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { color: var(--ink-soft); font-size: 10px; margin-top: 4px; }

.view-switch { display: flex; gap: 4px; padding: 4px; background: #e9e5dc; border-radius: 13px; }
.view-switch button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.view-switch .active { background: var(--paper); box-shadow: 0 2px 8px rgba(22,45,43,.08); font-weight: 700; }
.local-badge { justify-self: end; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: 11px; }
.local-badge i { width: 7px; height: 7px; background: #48a97d; border-radius: 50%; box-shadow: 0 0 0 4px #48a97d1c; }

.study-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 245px minmax(460px, 1fr) 250px; max-width: 1540px; margin: auto; }
.study-sidebar { padding: 28px 22px; border-right: 1px solid rgba(22,45,43,.1); }
.profile-card { display: flex; align-items: center; gap: 11px; padding: 12px 10px 25px; border-bottom: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: #ffe4bd; color: #984c29; font-weight: 800; }
.profile-card div:last-child { display: flex; flex-direction: column; gap: 4px; }
.profile-card strong { font-size: 13px; }
.profile-card span { font-size: 10px; color: var(--ink-soft); }
.study-sidebar nav { display: grid; gap: 7px; padding: 23px 0; }
.study-sidebar nav button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 12px 13px; border-radius: 12px; font-size: 13px; color: var(--ink-soft); text-align: left; cursor: pointer; }
.study-sidebar nav button span { width: 20px; font-size: 16px; }
.study-sidebar nav .nav-active { background: var(--ink); color: white; font-weight: 700; }
.today-card { margin-top: 10px; padding: 20px; border-radius: 20px; background: #dcece2; text-align: center; }
.today-card > p { margin: 0 0 12px; text-align: left; font-size: 11px; font-weight: 800; }
.ring { width: 104px; height: 104px; margin: auto; border-radius: 50%; background: conic-gradient(var(--mint-deep) 0 34%, #fff9 34%); display: grid; place-content: center; position: relative; }
.ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: #dcece2; }
.ring strong, .ring span { position: relative; z-index: 1; }
.ring strong { font-family: Georgia, serif; font-size: 33px; line-height: 1; }
.ring span { font-size: 9px; color: var(--ink-soft); }
.today-card small { display: block; margin-top: 14px; color: var(--ink-soft); font-size: 9px; }
.privacy-note { margin-top: 20px; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); font-size: 9px; line-height: 1.55; padding: 0 5px; }
.privacy-note p { margin: 0; }.privacy-note strong { display: block; color: var(--ink); }

.conversation { padding: 40px clamp(26px, 5vw, 78px) 24px; display: flex; flex-direction: column; max-height: calc(100vh - 76px); }
.conversation-head { display: flex; justify-content: space-between; align-items: flex-start; }
.eyebrow { margin: 0 0 7px; color: var(--mint-deep); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.conversation h1 { margin: 0; font-family: Georgia, "STSong", serif; font-size: clamp(29px, 3vw, 42px); font-weight: 500; letter-spacing: -.03em; }
.new-chat { border: 1px solid var(--line); background: var(--paper); padding: 9px 12px; border-radius: 11px; font-size: 11px; cursor: pointer; }
.message-list { flex: 1; overflow-y: auto; padding: 30px 2px 20px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }
.message { display: flex; gap: 10px; align-items: flex-start; max-width: 82%; }
.message.child { align-self: flex-end; }.message.coach { align-self: flex-start; }
.coach-dot { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: white; font-size: 10px; font-weight: 800; }
.bubble { padding: 14px 16px; border-radius: 5px 18px 18px 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 7px 18px rgba(22,45,43,.04); }
.child .bubble { background: #dcece2; border-color: #c8dfd1; border-radius: 18px 5px 18px 18px; }
.bubble p { margin: 0; font-size: 13px; line-height: 1.75; }
.message-label { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 800; color: var(--mint-deep); }
.next-actions { display: flex; gap: 7px; margin-top: 12px; }
.next-actions button { border: 1px solid #c7d8cf; background: white; padding: 6px 9px; border-radius: 8px; font-size: 9px; cursor: pointer; }
.thinking { display: flex; gap: 4px; padding: 13px 17px; border-radius: 5px 16px 16px 16px; background: var(--paper); border: 1px solid var(--line); }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint-deep); animation: bounce 1s infinite alternate; }.thinking i:nth-child(2){animation-delay:.16s}.thinking i:nth-child(3){animation-delay:.32s}
@keyframes bounce { to { transform: translateY(-4px); opacity: .4; } }

.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.starter-grid button { position: relative; min-height: 82px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.7); padding: 12px; text-align: left; cursor: pointer; transition: .18s ease; }
.starter-grid button:hover { transform: translateY(-2px); border-color: #a6c9b7; background: var(--paper); }
.starter-grid span { font-size: 9px; color: var(--mint-deep); font-weight: 800; }.starter-grid p { margin: 6px 20px 0 0; font-size: 10px; line-height: 1.45; }.starter-grid b { position: absolute; right: 12px; bottom: 10px; font-weight: 500; }

.composer { background: var(--paper); border: 1px solid #d6d1c5; border-radius: 20px; padding: 10px; box-shadow: 0 14px 35px rgba(22,45,43,.09); }
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.file-input { display: none; }.icon-button, .send-button { flex: 0 0 auto; border: 0; cursor: pointer; display: grid; place-items: center; }
.icon-button { width: 35px; height: 35px; background: #efebe3; border-radius: 11px; color: var(--ink-soft); }
.send-button { width: 36px; height: 36px; background: var(--coral); border-radius: 12px; font-size: 18px; font-weight: 800; }.send-button:disabled { opacity: .35; cursor: default; }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; min-height: 35px; padding: 8px 5px; font-size: 12px; color: var(--ink); }
.composer textarea::placeholder { color: #9b9b93; }
.compose-tools { margin-top: 6px; padding: 5px 4px 1px 43px; display: flex; justify-content: space-between; align-items: center; }
.compose-tools button { border: 0; background: transparent; color: var(--mint-deep); font-size: 10px; cursor: pointer; }.compose-tools button.selected { font-weight: 800; }.compose-tools span { color: #9b9b93; font-size: 8px; }
.attempt-box { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 7px; border-radius: 12px; background: #eef3e9; font-size: 9px; font-weight: 800; }
.attempt-box input { border: 0; outline: 0; background: transparent; font-size: 10px; font-weight: 400; }
.upload-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 7px 43px; padding: 6px 9px; background: #fff0d9; border-radius: 8px; font-size: 9px; }.upload-chip button { border: 0; background: transparent; cursor: pointer; }

.right-rail { padding: 28px 20px; border-left: 1px solid rgba(22,45,43,.1); }
.rail-card { border: 1px solid var(--line); background: rgba(255,253,248,.72); padding: 20px; border-radius: 19px; }
.focus-orbit { width: 118px; height: 118px; margin: 14px auto; border-radius: 50%; border: 1px dashed #79a993; display: grid; place-content: center; text-align: center; position: relative; }
.focus-orbit::after { content: '✦'; position: absolute; right: 4px; top: 15px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #ffe3a8; font-size: 9px; }
.focus-orbit span, .focus-orbit small { font-size: 9px; color: var(--ink-soft); }.focus-orbit strong { font-family: Georgia, serif; font-size: 38px; line-height: 1; }
.soft-copy { margin: 0; text-align: center; color: var(--ink-soft); font-family: Georgia, "STSong", serif; font-size: 11px; line-height: 1.6; }
.tip-card { display: flex; gap: 10px; margin-top: 12px; background: #fff0d8; }.tip-card > span { font-size: 17px; }.tip-card strong { font-size: 10px; }.tip-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.5; }
.feedback { width: 100%; margin-top: 15px; padding: 10px; border: 0; background: transparent; color: var(--ink-soft); font-size: 9px; cursor: pointer; }.feedback span { display: block; margin-top: 6px; font-size: 15px; }

.parent-wrap { max-width: 1160px; margin: auto; padding: 48px 30px 80px; }
.parent-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 34px; }
.parent-heading h1 { margin: 0; font-family: Georgia, "STSong", serif; font-size: clamp(34px, 5vw, 58px); font-weight: 500; line-height: 1.08; letter-spacing: -.04em; }
.week-picker { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); font-size: 11px; }.week-picker span { margin-left: 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.metric { min-height: 180px; padding: 22px; border-radius: 23px; display: flex; flex-direction: column; }.metric.coral { background: #ffb39a; }.metric.mint { background: #bfe3d0; }.metric.lilac { background: #d8cdf1; }
.metric > span { font-size: 11px; font-weight: 800; }.metric strong { margin-top: auto; font-family: Georgia, serif; font-size: 50px; font-weight: 500; line-height: 1; }.metric small { font-family: inherit; font-size: 12px; }.metric em { margin-top: 12px; font-style: normal; font-size: 9px; color: #354a47; }
.parent-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 13px; margin-top: 13px; }
.panel { border: 1px solid var(--line); background: rgba(255,253,248,.8); border-radius: 23px; padding: 24px; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; }.panel h2 { margin: 0; font-family: Georgia, "STSong", serif; font-size: 23px; font-weight: 500; }.panel-title > span { font-size: 9px; color: var(--ink-soft); }
.bars { height: 180px; display: flex; align-items: flex-end; gap: 12px; padding-top: 28px; }.bar-day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 9px; }.bar-day div { width: 100%; max-width: 38px; border-radius: 9px 9px 3px 3px; background: var(--mint-deep); }.bar-day:nth-child(5) div { background: var(--coral); }.bar-day span { font-size: 9px; color: var(--ink-soft); }
.insight-panel { background: var(--ink); color: white; }.insight-panel .eyebrow { color: #91cfb0; }.insight-panel > p:not(.eyebrow) { color: #c6d2cf; font-size: 11px; line-height: 1.8; }.insight-tag { margin-top: 25px; padding: 11px; border-radius: 12px; background: #ffffff12; color: #e3eee9; font-size: 9px; }
.mistake-list { margin-top: 13px; }.mistake-list .panel-title { margin-bottom: 14px; }.mistake-list .panel-title button { border: 0; background: transparent; color: var(--mint-deep); font-size: 10px; cursor: pointer; }
.mistake-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 17px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }.mistake-row .subject { text-align: center; padding: 7px; border-radius: 9px; font-size: 9px; font-weight: 800; }.subject.math { background: #ffe0d6; color: #a54e34; }.subject.english { background: #ddd5f0; color: #57418b; }.mistake-row strong { font-size: 11px; }.mistake-row p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; }.mistake-row b { font-size: 9px; color: var(--ink-soft); font-weight: 500; }

.device-lock { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 70% 15%, #d7eee0, transparent 34%), #f7f2e8; }
.device-lock[hidden] { display: none; }
.lock-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,248,.94); box-shadow: 0 30px 80px rgba(22,45,43,.13); text-align: center; }
.lock-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 22px; border-radius: 18px; background: var(--ink); color: #ffe6a4; font-size: 24px; }
.lock-card h1 { margin: 0 0 14px; font-family: Georgia, "STSong", serif; font-size: 34px; font-weight: 500; }
.lock-card > p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.lock-status { margin-top: 24px; padding: 12px; border-radius: 12px; background: #eef3e9; color: var(--mint-deep); font-size: 11px; line-height: 1.6; }

.device-panel { margin-top: 13px; }
.device-intro { max-width: 680px; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.invite-builder { display: grid; grid-template-columns: .8fr 1.4fr auto; gap: 10px; margin-top: 18px; align-items: end; }
.invite-builder label { display: grid; gap: 6px; }
.invite-builder label span { font-size: 9px; font-weight: 800; color: var(--ink-soft); }
.invite-builder input { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: white; color: var(--ink); font-size: 11px; }
.invite-builder input:focus { border-color: var(--mint-deep); box-shadow: 0 0 0 3px #6d9e871a; }
.invite-builder > button, .invite-result button { border: 0; border-radius: 11px; background: var(--ink); color: white; padding: 11px 14px; font-size: 10px; font-weight: 800; cursor: pointer; }
.invite-result { display: flex; align-items: center; gap: 22px; margin-top: 18px; padding: 18px; border-radius: 18px; background: #eef3e9; }
.invite-result[hidden] { display: none; }
.qr-box { flex: 0 0 auto; width: 148px; height: 148px; display: grid; place-items: center; padding: 8px; border-radius: 14px; background: white; }
.qr-box img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.invite-result strong { font-family: Georgia, "STSong", serif; font-size: 20px; font-weight: 500; }
.invite-result p { color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.invite-result button { padding: 8px 11px; background: var(--mint-deep); }
.device-list-head { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 11px; }
.device-list-head button { border: 0; background: transparent; color: var(--mint-deep); font-size: 9px; cursor: pointer; }
.device-list { margin-top: 8px; }
.device-list > p { color: var(--ink-soft); font-size: 10px; }
.device-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.device-item strong { display: block; font-size: 11px; }
.device-item span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 9px; }
.device-item button { border: 1px solid #e2b7ab; border-radius: 9px; background: #fff4ef; color: #a54e34; padding: 7px 9px; font-size: 9px; cursor: pointer; }

@media (max-width: 1050px) {
  .study-layout { grid-template-columns: 210px 1fr; }.right-rail { display: none; }
}

@media (max-width: 720px) {
  .topbar { height: 66px; padding: 0 15px; grid-template-columns: 1fr auto; }.brand small, .local-badge { display: none; }.view-switch { justify-self: end; }.view-switch button { padding: 7px 9px; font-size: 10px; }
  .study-layout { display: block; min-height: calc(100vh - 66px); }.study-sidebar { display: none; }.conversation { max-height: calc(100vh - 66px); padding: 25px 15px 14px; }.conversation-head h1 { font-size: 31px; }.new-chat { font-size: 9px; }.message { max-width: 92%; }.starter-grid { grid-template-columns: 1fr; }.starter-grid button { min-height: 62px; }.compose-tools span { display: none; }.compose-tools { padding-left: 43px; }.parent-wrap { padding: 30px 15px 60px; }.parent-heading { display: block; }.week-picker { display: inline-block; margin-top: 20px; }.metric-grid, .parent-grid { grid-template-columns: 1fr; }.metric { min-height: 150px; }.mistake-row { grid-template-columns: 52px 1fr; }.mistake-row b { display: none; }.invite-builder { grid-template-columns: 1fr; }.invite-result { align-items: flex-start; flex-direction: column; }.lock-card { padding: 32px 24px; }
}
