/* ===========================================================
   专注小伙伴 · 样式表（浅色主题 · 电脑 / 手机双端）
   =========================================================== */
:root {
  --bg: #eef2f9;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-2: #eef1f6;
  --text: #1b2333;
  --text-2: #5b667a;
  --text-3: #8b95a8;

  --brand: #4f7cff;
  --brand-2: #7aa2ff;
  --ok: #10b981;
  --warn: #f59e0b;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --danger: #ef4444;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(28, 46, 92, 0.08);
  --shadow-lg: 0 18px 50px rgba(28, 46, 92, 0.16);
}

* { box-sizing: border-box; }

/* 关键：本页多处元素同时带 class 与 hidden 属性，需保证 hidden 一定生效 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 12% -10%, #e2ecff 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #eaf3ff 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
               BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand), #8ab4ff);
  box-shadow: 0 8px 20px rgba(79, 124, 255, .35);
  flex: none;
}
.brand-text h1 { margin: 0; font-size: 21px; letter-spacing: .3px; }
.brand-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.state-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 600; font-size: 14px;
  transition: .25s;
  white-space: nowrap;
}
.state-badge .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3);
  transition: .25s;
}
.state-badge .state-emoji { font-size: 16px; }

.state-badge[data-state="FOCUS"]      { border-color: #b6f0d8; background: #f0fdf8; color: #067a5a; }
.state-badge[data-state="FOCUS"] .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.state-badge[data-state="DISTRACTED"]      { border-color: #ffe1a8; background: #fffaf0; color: #a56600; }
.state-badge[data-state="DISTRACTED"] .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.state-badge[data-state="DROWSY"]      { border-color: #ddd0ff; background: #f8f5ff; color: #5b32b8; }
.state-badge[data-state="DROWSY"] .dot { background: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
.state-badge[data-state="AWAY"]      { border-color: #cbdcff; background: #f2f7ff; color: #1d4ed8; }
.state-badge[data-state="AWAY"] .dot { background: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.state-badge[data-state="DISTURBED"]      { border-color: #ffd0e6; background: #fff4f9; color: #be185d; }
.state-badge[data-state="DISTURBED"] .dot { background: var(--pink); box-shadow: 0 0 0 3px rgba(236,72,153,.18); }
.state-badge[data-state="BREAK"]      { border-color: #b9ecf7; background: #f0fcff; color: #0e7490; }
.state-badge[data-state="BREAK"] .dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(6,182,212,.18); }

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  min-width: 88px; text-align: center;
}
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 19px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: .18s;
  flex: none;
  padding: 0;
  color: inherit;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--brand-2); }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .95fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.head-right { display: flex; align-items: center; gap: 8px; }
.hud, .pill {
  font-size: 12px; color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.keepawake {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  background: #fff8e6; border: 1px solid #ffe1a8; color: #8a5a00;
  white-space: nowrap;
}

/* ---------------- 摄像头舞台 ---------------- */
/* 高度由 JS 按摄像头真实宽高比计算，避免 object-fit 裁剪导致叠加层错位 */
.stage {
  position: relative;
  width: 100%;
  min-height: 220px;
  background: #0f1626;
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
}
.stage video, .stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.stage video { object-fit: cover; transform: scaleX(-1); }
.stage video.no-mirror { transform: none; }
.stage canvas { pointer-events: none; }

.stage-cover, .break-cover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  padding: 24px;
  background: linear-gradient(160deg, #f4f8ff, #e9f0ff);
  color: var(--text);
  z-index: 4;
}
.stage-cover .cover-emoji, .break-cover .cover-emoji { font-size: 54px; line-height: 1; }
.stage-cover h3, .break-cover h3 { margin: 6px 0 0; font-size: 19px; }
.stage-cover p, .break-cover p {
  margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.7; max-width: 420px;
}
.stage-cover b { color: #0d7a52; }
.break-cover { background: linear-gradient(160deg, #eafcff, #e5f6ff); z-index: 6; }
.break-count {
  margin-top: 8px; font-size: 34px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: #0e7490;
}

.stage-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 20px;
  background: rgba(15, 22, 38, .82);
  color: #fff; font-size: 14px; line-height: 1.6; z-index: 5;
}
.stage-msg.error { background: rgba(120, 22, 22, .9); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stage-msg.error .spinner { display: none; }

/* 提醒横幅 */
.banner {
  position: absolute; left: 50%; top: 14px;
  transform: translate(-50%, -160%);
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 28px);
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px;
  background: #fff7e6; color: #8a5a00;
  border: 2px solid #ffd489;
  box-shadow: var(--shadow-lg);
  transition: transform .38s cubic-bezier(.2, 1.5, .5, 1);
  z-index: 7;
}
.banner.show { transform: translate(-50%, 0); }
.banner[data-level="2"] { background: #fff0e2; border-color: #ffb066; color: #9a4a00; }
.banner[data-level="3"] { background: #ffe8ef; border-color: #ff8fb3; color: #a8003e; }
.banner-emoji { font-size: 20px; }

.controls { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: .18s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { border-color: var(--brand-2); background: #fff; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #6f9bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(79,124,255,.32);
  min-width: 138px;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #4472f5, #6790ff); }
.btn-primary.running {
  background: linear-gradient(135deg, #ff8a5b, #ff6b6b);
  box-shadow: 0 8px 20px rgba(255,107,107,.3);
}
.btn-block { width: 100%; margin-top: 8px; }

.tip { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* ---------------- 状态卡 ---------------- */
.status-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  border-left: 6px solid var(--text-3);
  transition: border-color .3s, background .3s;
}
.status-emoji { font-size: 44px; line-height: 1; }
.status-title { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.status-tip { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.status-card[data-state="FOCUS"]      { border-left-color: var(--ok);     background: linear-gradient(90deg,#f2fdf9,#fff 60%); }
.status-card[data-state="DISTRACTED"] { border-left-color: var(--warn);   background: linear-gradient(90deg,#fff9ee,#fff 60%); }
.status-card[data-state="DROWSY"]     { border-left-color: var(--purple); background: linear-gradient(90deg,#f9f6ff,#fff 60%); }
.status-card[data-state="AWAY"]       { border-left-color: var(--blue);   background: linear-gradient(90deg,#f1f7ff,#fff 60%); }
.status-card[data-state="DISTURBED"]  { border-left-color: var(--pink);   background: linear-gradient(90deg,#fff4f9,#fff 60%); }
.status-card[data-state="BREAK"]      { border-left-color: var(--cyan);   background: linear-gradient(90deg,#f0fdff,#fff 60%); }
.status-card[data-state="ALERT"]      { animation: pulseCard .8s ease-in-out 3; }
@keyframes pulseCard { 50% { background: #fffbeb; } }

/* ---------------- 番茄钟 ---------------- */
.pomo-time {
  font-size: 42px; font-weight: 800; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
  background: linear-gradient(135deg, #4f7cff, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pomo-bar {
  height: 9px; border-radius: 999px; background: var(--line-2);
  margin: 12px 0 8px; overflow: hidden;
}
.pomo-bar-in {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #4f7cff, #8b5cf6);
  transition: width .8s linear;
}
.pomo-sub { font-size: 12.5px; color: var(--text-3); }

/* ---------------- 数据指标 ---------------- */
.metrics { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ring-wrap { position: relative; width: 118px; height: 118px; flex: none; }
.ring { width: 118px; height: 118px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line-2); stroke-width: 11; }
.ring-fg {
  fill: none; stroke-width: 11; stroke-linecap: round;
  stroke: var(--ok);
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset .6s ease, stroke .4s;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-num { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring-cap { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.metric-list { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 9px; }
.metric {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 13.5px;
  padding-bottom: 9px; border-bottom: 1px dashed var(--line);
}
.metric:last-child { border-bottom: none; padding-bottom: 0; }
.m-label { color: var(--text-2); }
.m-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.m-value.warn { color: #b45309; }
.m-value.ok { color: #067a5a; }

/* ---------------- 今日记录 ---------------- */
.today-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.today-item {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
}
.today-item b {
  display: block; font-size: 17px; font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.today-item span { font-size: 11px; color: var(--text-3); }
.today-clear { margin-top: 12px; width: 100%; }

/* ---------------- 时间轴 ---------------- */
#timeline { width: 100%; height: 46px; border-radius: 10px; display: block; background: var(--bg-2); }
.legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 10px; font-size: 11.5px; color: var(--text-3);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------- 日志 ---------------- */
.log { list-style: none; margin: 0; padding: 0; max-height: 190px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.log li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.8px; padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
  color: var(--text-2);
}
.log li:last-child { border-bottom: none; }
.log .log-time { color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.log .log-emoji { flex: none; }
.log-empty { color: var(--text-3) !important; justify-content: center; padding: 16px 0 !important; }
.mini-btn {
  font-size: 12px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-2); cursor: pointer; color: var(--text-2);
  font-family: inherit;
}
.mini-btn:hover { border-color: var(--brand-2); color: var(--brand); }

/* ---------------- 底部 ---------------- */
.foot {
  text-align: center; font-size: 12px; color: var(--text-3);
  margin-top: 6px; padding: 10px; line-height: 1.7;
}

/* ---------------- 设置抽屉 ---------------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(17, 25, 45, .32);
  backdrop-filter: blur(2px); z-index: 40;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--card);
  box-shadow: -14px 0 50px rgba(20, 35, 70, .18);
  z-index: 41;
  display: flex; flex-direction: column;
  animation: slideIn .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideIn { from { transform: translateX(102%); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-body {
  padding: 6px 20px 28px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.group { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.group:last-child { border-bottom: none; }
.group-title {
  font-size: 12px; font-weight: 700; color: var(--brand);
  letter-spacing: 1.2px; margin-bottom: 12px; text-transform: uppercase;
}
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13.5px; margin-bottom: 8px; color: var(--text); }
.field > span b { color: var(--brand); font-variant-numeric: tabular-nums; }
.field small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.field input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px; background: var(--line-2); outline: none;
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); cursor: pointer;
  box-shadow: 0 2px 8px rgba(79,124,255,.35);
}
.field input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); cursor: pointer;
}
.field select {
  width: 100%;
  font-family: inherit; font-size: 14px; color: var(--text);
  padding: 11px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8b95a8 50%),
                    linear-gradient(135deg, #8b95a8 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus { border-color: var(--brand-2); }
.switch {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; padding: 9px 0; cursor: pointer;
}
.switch input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex: none; }
.model-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px;
}
.model-name { font-size: 13.5px; font-weight: 700; }
.model-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.mini-note { font-size: 11.5px; color: var(--text-3); line-height: 1.6; margin: 10px 0 0; }
.mini-note code {
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 5px; font-size: 11px;
}

@keyframes popIn { from { transform: scale(.9); opacity: 0; } }
.status-card, .card { animation: popIn .3s ease-out; }

/* ===========================================================
   监工模式（Kiosk）：全屏只留摄像头 + 大字状态
   =========================================================== */
.kiosk-hud, .kiosk-exit { display: none; }

body.kiosk { background: #05070c; overflow: hidden; }
body.kiosk .topbar,
body.kiosk .dash,
body.kiosk .foot,
body.kiosk .card-head,
body.kiosk .controls,
body.kiosk .tip { display: none !important; }

body.kiosk .app { max-width: none; padding: 0; }
body.kiosk .layout { display: block; }
body.kiosk .stage-card {
  border: none; border-radius: 0; box-shadow: none;
  margin: 0; padding: 0; background: transparent; animation: none;
}
body.kiosk .stage {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: auto;
  border-radius: 0;
  background: #05070c;
  max-width: 100vw;
  max-height: 100vh;
}
body.kiosk .stage-cover,
body.kiosk .break-cover { background: linear-gradient(160deg, #101827, #0b1220); color: #e8eefc; }
body.kiosk .stage-cover p, body.kiosk .break-cover p { color: #9fb0cd; }
body.kiosk .stage-cover b { color: #6ee7b7; }

body.kiosk .kiosk-hud {
  display: flex;
  position: absolute; left: 0; right: 0; bottom: 0;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5,7,12,.86), rgba(5,7,12,0));
  color: #fff;
  z-index: 8;
  pointer-events: none;
}
.kiosk-emoji { font-size: 44px; line-height: 1; }
.kiosk-label { font-size: 30px; font-weight: 800; letter-spacing: 2px; }
.kiosk-time {
  font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: #9ec1ff;
}
.kiosk-hud[data-state="FOCUS"] .kiosk-label { color: #6ee7b7; }
.kiosk-hud[data-state="DISTRACTED"] .kiosk-label { color: #fcd34d; }
.kiosk-hud[data-state="DROWSY"] .kiosk-label { color: #c4b5fd; }
.kiosk-hud[data-state="AWAY"] .kiosk-label { color: #93c5fd; }
.kiosk-hud[data-state="DISTURBED"] .kiosk-label { color: #f9a8d4; }
.kiosk-hud[data-state="BREAK"] .kiosk-label { color: #67e8f9; }

body.kiosk .banner {
  top: 24px; font-size: 22px; padding: 16px 30px;
  border-width: 3px;
}
body.kiosk .banner-emoji { font-size: 28px; }

body.kiosk .kiosk-exit {
  display: block;
  position: absolute; right: 16px; top: 16px;
  z-index: 9;
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.kiosk .kiosk-exit:hover { background: rgba(255,255,255,.24); }

/* ===========================================================
   移动端适配
   =========================================================== */
@media (max-width: 760px) {
  .app { padding: 12px 12px 20px; }

  .topbar { gap: 10px; margin-bottom: 12px; }
  .brand { gap: 9px; }
  .logo { width: 40px; height: 40px; font-size: 21px; border-radius: 12px; }
  .brand-text h1 { font-size: 17px; }
  .brand-text p { font-size: 11px; }
  .topbar-right { gap: 7px; width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .state-badge { padding: 7px 12px; font-size: 13px; }
  .state-badge .state-emoji { font-size: 14px; }
  .clock { font-size: 15px; padding: 7px 11px; min-width: 74px; border-radius: 10px; }
  .icon-btn { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }

  .card { padding: 13px; border-radius: 15px; margin-bottom: 12px; }
  .card-head { margin-bottom: 10px; }
  .card-head h2 { font-size: 14px; }

  /* 手机上摄像头放最上、给足高度 */
  .stage-card { order: -1; }

  .controls { gap: 8px; margin-top: 12px; }
  .btn { flex: 1 1 calc(50% - 4px); padding: 12px 10px; font-size: 13.5px; }
  .btn-primary { flex: 1 1 100%; min-width: 0; }

  .status-card { padding: 14px 16px; gap: 12px; }
  .status-emoji { font-size: 34px; }
  .status-title { font-size: 17px; }
  .status-tip { font-size: 12px; }

  .pomo-time { font-size: 34px; }

  .metrics { gap: 14px; }
  .ring-wrap, .ring { width: 96px; height: 96px; }
  .ring-num { font-size: 20px; }
  .metric-list { min-width: 140px; gap: 7px; }
  .metric { font-size: 12.5px; }

  .today-grid { grid-template-columns: repeat(2, 1fr); }
  .today-item b { font-size: 16px; }

  #timeline { height: 36px; }
  .legend { gap: 9px; font-size: 10.5px; }

  .drawer { width: 100vw; }
  .drawer-head { padding: 15px 16px; }
  .drawer-body { padding: 6px 16px 30px; }
  .foot { font-size: 11px; }
}

@media (max-width: 400px) {
  .brand-text p { display: none; }
  .metric-list { min-width: 120px; }
  .kiosk-label, .kiosk-time { font-size: 22px; }
  .kiosk-emoji { font-size: 32px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
