/* 结伴：照 DESIGN.md 定稿。三种颜色（墨、灰、学校色），三种字号（40 / 30 / 20），最小 20，每屏一件事 */
:root {
  --bg: #f7f4ef; --card: #fffdfa; --ink: #2b2826; --grey: #8d867e; --line: #e7e1d8;
  --school: #cc0000; --on-school: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body, #root { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 20px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
button { cursor: pointer; }
button:active { transform: scale(.98); }
.hidden { display: none !important; }

/* 三种字 */
.h1 { font-size: 40px; line-height: 1.15; font-weight: 600; letter-spacing: .02em; }
.h2 { font-size: 30px; line-height: 1.2; font-weight: 600; }
.p { font-size: 20px; line-height: 1.5; font-weight: 500; }
.grey { color: var(--grey); }
.red { color: var(--school); }

/* 页面骨架 */
.screen { height: 100%; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; position: relative; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 24px; }
.top { padding: calc(env(safe-area-inset-top) + 18px) 24px 0; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.pad { padding: 0 24px; }
.dock { flex: none; padding: 12px 20px calc(env(safe-area-inset-bottom) + 20px); background: var(--bg); }
.btn { width: 100%; height: 60px; border-radius: 18px; background: var(--school); color: var(--on-school); font-size: 20px; font-weight: 600; display: grid; place-items: center; letter-spacing: .04em; }
.btn:disabled { opacity: .35; }
.links { display: flex; justify-content: space-around; margin-bottom: 12px; }
.links button { color: var(--grey); padding: 6px 18px; }
.textbtn { color: var(--grey); padding: 4px 0; }
.textbtn.red { color: var(--school); }

/* 天际线 */
.sky { position: absolute; left: 0; right: 0; top: 0; height: calc(env(safe-area-inset-top) + 196px); pointer-events: none; }
.sky svg { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.sky.faint { opacity: .4; }
.sky-gap { height: 150px; }

/* 自己 */
.me { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--school); color: var(--school); background: var(--bg); display: grid; place-items: center; font-size: 20px; font-weight: 600; flex: none; }

/* 这周 */
.week { display: grid; grid-template-columns: repeat(7, 1fr); margin: 10px 14px 0; position: relative; z-index: 1; }
.day { text-align: center; }
.day b { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; font-weight: 600; }
.day.today b { background: var(--school); color: var(--on-school); }
.day.event b { box-shadow: inset 0 0 0 2px var(--school); }
.day.today.event b { box-shadow: none; }
.day .dots { height: 10px; margin-top: 6px; display: flex; justify-content: center; gap: 4px; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--school); opacity: .55; }

/* 卡片和选项 */
.card { margin: 24px 20px 0; background: var(--card); border-radius: 24px; padding: 22px; display: block; width: calc(100% - 40px); text-align: left; }
.card .p { margin-top: 4px; }
.opts { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 18px; border-radius: 16px; border: 2px solid var(--line); font-size: 20px; font-weight: 600; text-align: left; background: var(--card); }
.opt .n { color: var(--grey); font-weight: 500; }
.opt.best { border-color: var(--school); }
.opt.best .n { color: var(--school); }
.opt.on { border-color: var(--school); background: var(--school); color: var(--on-school); }
.opt.on .n { color: var(--on-school); }
.opt.plain { border-style: dashed; color: var(--grey); font-weight: 500; }
.empty { margin: 36px 24px 0; color: var(--grey); }

/* 行 */
.rows { margin-top: 22px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.box { margin: 24px 20px 0; background: var(--card); border-radius: 24px; padding: 4px 22px; }

/* 选人 */
.ck { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--on-school); font-size: 16px; font-weight: 700; flex: none; }
.row.on .ck { background: var(--school); border-color: var(--school); }

/* 输入 */
.field { width: 100%; height: 60px; padding: 0 18px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); font-size: 20px; }
.field:focus { border-color: var(--grey); }
.inline { display: flex; gap: 10px; margin-top: 14px; }
.inline .field { flex: 1; }
.inline .go { flex: none; width: 60px; height: 60px; border-radius: 16px; background: var(--ink); color: var(--bg); font-size: 22px; font-weight: 700; }

/* 助手们的对话 */
.talk { margin-top: 10px; }
.talk .line { padding: 8px 0; }
.talk .line .grey { margin-right: 10px; }

/* 登录 */
.gate { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 24px calc(env(safe-area-inset-bottom) + 28px); max-width: 520px; margin: 0 auto; position: relative; }
.gate .h1 { margin-bottom: 28px; }
.gate .field { margin-bottom: 12px; }
.gate .notice { color: var(--grey); margin-top: 16px; }
.err { color: var(--school); min-height: 30px; margin-top: 10px; }

/* 弹层 */
.sheet-bg { position: fixed; inset: 0; background: rgba(30,25,20,.28); display: flex; align-items: flex-end; justify-content: center; z-index: 10; animation: fade .2s; }
.sheet { width: 100%; max-width: 520px; background: var(--bg); border-radius: 26px 26px 0 0; padding: 26px 24px calc(env(safe-area-inset-bottom) + 26px); animation: up .25s cubic-bezier(.2,.7,.2,1); max-height: 88vh; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 20px; font-size: 20px; z-index: 20; animation: fade .2s; white-space: nowrap; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
