:root {
  --ink: #15181d;
  --ink-2: #4b5563;
  --ink-3: #8b93a1;
  --line: #e7e9ee;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #ff4d2d;
  --accent-soft: #fff1ee;
  --ok: #12805c;
  --ok-soft: #e9f6f0;
  --warn: #b26a00;
  --warn-soft: #fff6e6;
  --r: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.shell { max-width: 520px; margin: 0 auto; background: var(--bg); min-height: 100vh; padding-bottom: 78px; }
.wide .shell { max-width: 900px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px;
  background: rgba(246, 247, 249, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -.2px; }
.topbar .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.topbar .grow { flex: 1; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.chip.gray { background: #eceef2; color: var(--ink-2); font-weight: 500; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); margin: 0 16px 12px; overflow: hidden;
}
.card .hd { padding: 14px 16px 0; display: flex; align-items: center; gap: 8px; }
.card .hd h3 { margin: 0; font-size: 15px; font-weight: 650; flex: 1; }
.card .bd { padding: 12px 16px 16px; }
.card .ft { padding: 0 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { margin: 18px 16px 10px; font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: .3px; }

/* 按钮 */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { color: #c22b1c; border-color: #f3d3cd; background: #fff; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; color: var(--ink); font-family: inherit; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: #ffb3a4; box-shadow: 0 0 0 3px rgba(255, 77, 45, .1); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 列表 */
.list-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .t { font-size: 14px; line-height: 1.5; }
.list-item .m { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #f0f2f5; color: var(--ink-2); margin-right: 5px; }
.tag.a { background: var(--accent-soft); color: var(--accent); }

/* 任务卡 */
.task-card { padding: 14px 16px; }
.task-card .title { display: flex; align-items: center; gap: 8px; }
.task-card .title b { font-size: 15px; }
.task-card .meta { color: var(--ink-3); font-size: 12px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.task-card .actions { margin-top: 12px; display: flex; gap: 8px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 0 4px;
  z-index: 20;
}
.tabbar button { background: none; border: 0; font-family: inherit; font-size: 11px; color: var(--ink-3); padding: 6px 0; cursor: pointer; }
.tabbar button.on { color: var(--accent); }
.tabbar .ico { display: block; width: 20px; height: 20px; margin: 0 auto 2px; }
.tabbar .ico svg { width: 20px; height: 20px; display: block; }

/* 空态 / 提示 */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); font-size: 14px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .55; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(21, 24, 29, .92); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 40; max-width: 82%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .38); z-index: 50; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; max-width: 520px; margin: 0 auto; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; max-height: 88vh; overflow: auto; }
.sheet h3 { margin: 0 0 14px; font-size: 17px; }

/* 播放端 */
.player { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: #0f1115; color: #fff; }
.player .ph { padding: 18px 20px 10px; display: flex; align-items: center; gap: 8px; }
.player .ph .st { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.1); }
.player .ph .st.live { background: rgba(255, 77, 45, .18); color: #ff8a72; }
.player .stage { flex: 1; padding: 12px 20px; display: flex; flex-direction: column; justify-content: center; }
.player .now-label { font-size: 12px; color: rgba(255,255,255,.45); letter-spacing: 1px; }
.player .now { font-size: 24px; line-height: 1.55; font-weight: 600; margin-top: 10px; min-height: 120px; }
.player .q { margin-top: 14px; font-size: 13px; color: #ff8a72; }
.player .log { padding: 0 20px 10px; height: 128px; overflow: auto; font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.7; }
.player .ctl { padding: 0 20px 26px; }
.player .ctl .btn { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }
.player .tip { text-align: center; font-size: 11px; color: rgba(255,255,255,.35); margin-top: 10px; }
