:root {
  --brand: #FF6B35;
  --brand-soft: #FFF3ED;
  --brand-deep: #E2561F;
  --text: #1F2329;
  --text-2: #61666D;
  --text-3: #9AA0A6;
  --line: #EDEFF2;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --red: #E54545;
  --green: #17A673;
  --blue: #2F6BFF;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 35, 41, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

.page { max-width: 560px; margin: 0 auto; padding-bottom: 92px; }
.page-pc { max-width: 1180px; margin: 0 auto; padding: 20px 20px 60px; }

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand) 0%, #FF8A5B 62%, #FFB088 100%);
  color: #fff;
  padding: 26px 20px 22px;
}
.hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .5px; }
.hero p { margin: 0; font-size: 13px; opacity: .92; }
.hero .inviter {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,.2); border-radius: 999px; font-size: 13px;
}
.hero .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.34);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 12px; padding: 16px;
}
.card.tight { padding: 12px 14px; }
.card h2 {
  margin: 0 0 12px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card h2 .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

.section-title { margin: 18px 16px 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }

/* ---------- 数据块 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats .item .num { font-size: 22px; font-weight: 700; color: var(--brand); }
.stats .item .lbl { font-size: 12px; color: var(--text-3); }

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; }
.kv .v.brand { color: var(--brand); }
.kv .v.muted { color: var(--text-3); font-weight: 400; }
.kv-note { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 46px; border: none; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn[disabled] { background: #D8DBE0; cursor: not-allowed; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-deep); }
.btn.line { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.sm { height: 34px; font-size: 13px; width: auto; padding: 0 16px; }
.btn-row { display: flex; gap: 10px; margin: 16px; }
.btn-row .btn { margin: 0; }

/* 底部固定操作栏 */
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
}
.footer-bar .btn { flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--text); outline: none; font-family: inherit;
}
textarea.input { height: auto; min-height: 76px; padding: 12px 14px; line-height: 1.5; }
.input:focus { border-color: var(--brand); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-row .btn { width: 120px; height: 46px; border-radius: 10px; font-size: 14px; }

/* ---------- 列表 ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.li-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.li-title { font-weight: 600; font-size: 15px; }
.li-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.li-right { text-align: right; white-space: nowrap; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; font-weight: 500;
}
.tag.gray { background: #F1F2F4; color: var(--text-2); }
.tag.brand { background: var(--brand-soft); color: var(--brand-deep); }
.tag.green { background: #E8F7F1; color: var(--green); }
.tag.blue { background: #EDF3FF; color: var(--blue); }
.tag.red { background: #FDECEC; color: var(--red); }

/* ---------- 进度条 ---------- */
.funnel { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.funnel .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.funnel .bar .col { width: 100%; background: linear-gradient(180deg, #FF9A6B, var(--brand)); border-radius: 6px 6px 0 0; min-height: 4px; }
.funnel .bar .n { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.funnel .bar .l { font-size: 11px; color: var(--text-3); margin-top: 6px; white-space: nowrap; }

/* ---------- 表格（PC） ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #FAFAFB; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.table tr:hover td { background: #FCFCFD; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 悬浮提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  background: rgba(31,35,41,.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; max-width: 82vw;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 999; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 1000;
}
.mask.center { align-items: center; }
.sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.mask.center .sheet { border-radius: 16px; margin: 0 20px; max-width: 420px; }

/* ---------- 空态 / 骨架 ---------- */
.empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 0; }
.loading { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 0; }

/* ---------- 海报 ---------- */
.poster-box { text-align: center; padding: 12px; }
.poster-box img, .poster-box canvas {
  width: 100%; max-width: 340px; border-radius: 12px; box-shadow: var(--shadow); display: block; margin: 0 auto;
}
.tpl-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; }
.tpl-row .tpl {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
.tpl-row .tpl.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ---------- 管理端 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  border-top: 1px solid var(--line); display: flex; max-width: 560px; margin: 0 auto; z-index: 50;
}
.tabbar .tab {
  flex: 1; text-align: center; padding: 9px 0 calc(9px + env(safe-area-inset-bottom));
  font-size: 11px; color: var(--text-3); cursor: pointer;
}
.tabbar .tab.active { color: var(--brand); font-weight: 600; }
.tabbar .tab .dot {
  display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 3px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; line-height: 16px;
}
.todo-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin: 12px; padding: 14px; }
.todo-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.todo-card .who { font-size: 15px; font-weight: 600; }
.todo-card .meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.todo-card .acts { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 配置表单 ---------- */
.cfg-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cfg-row:last-child { border-bottom: none; }
.cfg-row .label { flex: 1; }
.cfg-row .label .t { font-size: 14px; font-weight: 500; }
.cfg-row .label .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.cfg-row .input { width: 130px; flex: 0 0 130px; text-align: right; }
.cfg-row .switch { position: relative; width: 46px; height: 26px; flex: 0 0 46px; }
.cfg-row .switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: relative; z-index: 2; }
.cfg-row .switch .track {
  position: absolute; inset: 0; background: #D8DBE0; border-radius: 999px; transition: background .2s;
}
.cfg-row .switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.cfg-row .switch input:checked + .track { background: var(--brand); }
.cfg-row .switch input:checked + .track::after { transform: translateX(20px); }

.pc-nav { display: flex; gap: 4px; margin-bottom: 18px; background: #fff; padding: 8px; border-radius: 12px; box-shadow: var(--shadow); }
.pc-nav .item { padding: 8px 18px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--text-2); }
.pc-nav .item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.pc-nav .spacer { flex: 1; }
.pc-nav .who { align-self: center; font-size: 13px; color: var(--text-3); }

.hidden { display: none !important; }
