/* ============================================================
   办公小浣熊 移动端 — 设计系统
   继承自 apps/office 的设计令牌 (globals.css / tailwind preset)
   品牌紫 #8E6BF2 · Inter · 中性浅灰系 · 8px 圆角
   ============================================================ */

:root {
  /* 品牌紫 */
  --purple: #8e6bf2;
  --purple-light: #a98ef6;
  --purple-dark: #6e45d9;
  --purple-bg: #f3effd;   /* 极浅紫底 */
  --purple-border: #e7e2f6;

  /* 文字灰阶 (officev3 语义) */
  --t1: #0a0a06;  /* primary  */
  --t2: #36383b;  /* 与 Web 端标题保持一致 */
  --t3: #57574a;  /* tertiary */
  --muted: #8c8c85;
  --subtle: #9d9d9d;

  /* 背景 / 边框 */
  --bg: #ffffff;
  --bg-subtle: #f7f7f7;
  --bg-muted: #f2f2f2;
  --bg-soft: #e6e6e6;
  --app-card: #f2f2f7;
  --border: #ececec;
  --border-strong: #d8d8d4;

  /* 功能色 */
  --success: #34c79a;
  --warning: #f2994a;
  --danger: #eb5757;
  --link: #7092fa;

  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
}

/* ---- 屏幕外壳：纯屏幕，无设备外壳 ---- */
.screen {
  width: 390px;
  height: 844px;
  background: var(--bg);
  font-family: var(--font);
  color: var(--t1);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.screen * { box-sizing: border-box; }
.screen.tinted { background: var(--bg-subtle); }

/* ---- iOS 状态栏 ---- */
.statusbar {
  height: 50px;
  flex: 0 0 50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 26px 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--t1);
  z-index: 5;
}
.statusbar .sb-time { font-variant-numeric: tabular-nums; }
.statusbar .sb-right { display: flex; align-items: center; gap: 7px; }
.sb-icon { display: block; }

/* ---- Home indicator ---- */
.home-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: #0a0a06;
  opacity: 0.85;
  z-index: 6;
}

/* ---- 顶部栏 ---- */
.appbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.appbar .iconbtn { color: var(--t2); }
.appbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.2px;
}
.appbar-sub { font-size: 12px; color: var(--muted); }
.appbar .spacer { flex: 1; }

.iconbtn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--t2);
  border-radius: 9px;
  cursor: pointer;
  flex: 0 0 auto;
}
.iconbtn:active { background: var(--bg-muted); }

/* ---- 内容区 ---- */
.body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.scroll { flex: 1; overflow: hidden; }
.pad { padding: 0 16px; }

/* ---- AI 头像（浣熊） ---- */
.raccoon {
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--purple-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.raccoon img { width: 76%; height: 76%; object-fit: contain; }
.raccoon.sm { width: 32px; height: 32px; }
.raccoon.md { width: 40px; height: 40px; }
.raccoon.lg { width: 56px; height: 56px; }
.raccoon.brand { background: var(--purple); }
.raccoon.brand img { filter: brightness(0) invert(1); }

/* ---- 顶部模式切换器 (segmented) ---- */
.switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-muted);
  border-radius: 11px;
  padding: 4px;
  margin: 4px 16px 0;
}
.switcher .seg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--t3);
  white-space: nowrap;
  cursor: pointer;
}
.switcher .seg.active {
  background: #fff;
  color: var(--t1);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(10, 10, 6, 0.08);
}
.switcher .seg.add { flex: 0 0 auto; padding: 0 14px; color: var(--purple); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dot.on { background: var(--success); }
.dot.off { background: var(--subtle); }

/* ---- 快捷任务卡片 ---- */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 16px 0;
}
.shortcut {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  min-height: 104px;
  justify-content: space-between;
}
.shortcut .sc-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-bg);
  color: var(--purple-dark);
}
.shortcut .sc-name { font-size: 15px; font-weight: 600; color: var(--t1); }
.shortcut .sc-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* ---- 发起对话输入坞 ---- */
.dock-wrap {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  flex: 0 0 auto;
}
.dock {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 0 8px 0 18px;
}
.dock .ph { flex: 1; font-size: 15px; color: var(--muted); }
.dock .mic {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.dock .scope-icon { color: var(--muted); flex: 0 0 auto; }

/* 录音态 */
.dock.recording { border-color: var(--purple); background: var(--purple-bg); }
.wave { display: flex; align-items: center; gap: 3px; flex: 1; height: 28px; }
.wave i {
  width: 3px; border-radius: 2px; background: var(--purple);
  display: block;
}
.dock.recording .ph { color: var(--purple-dark); font-weight: 500; flex: 0 0 auto; }

/* 文字输入态 */
.dock.typing { background: #fff; border-color: var(--purple-light); }
.dock.typing .caret {
  display: inline-block; width: 1.5px; height: 18px; background: var(--purple);
  margin-left: 1px; vertical-align: -3px;
}
.dock .send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}

/* ---- 卡片 / 列表行 ---- */
.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
  padding: 0 4px;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.row + .row { border-top: 1px solid var(--border); }
.row .r-ic {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--bg-muted); color: var(--t3);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { font-size: 14.5px; font-weight: 500; color: var(--t1); }
.row .r-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .chev { color: var(--subtle); flex: 0 0 auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px;
}
.badge.on { background: rgba(52, 199, 154, 0.12); color: #1f9b78; }
.badge.off { background: var(--bg-muted); color: var(--muted); }

/* 帮助色 */
.text-purple { color: var(--purple-dark); }
.divider { height: 1px; background: var(--border); }
