/* docs 网页端 · 设计基线
   参考腾讯文档的「白底 + 蓝主色 + 卡片」结构，配色/圆角/图标均为自有实现。 */

:root {
  --blue: #2b6cff;
  --blue-dark: #1d54d8;
  --blue-soft: #eef4ff;
  --blue-line: #d6e3ff;
  --green: #12b76a;
  --green-soft: #e8f8f0;
  --orange: #f79009;
  --orange-soft: #fff4e5;
  --red: #e5484d;
  --red-soft: #feecec;
  --ink: #1b1f27;
  --ink-2: #4b5563;
  --ink-3: #7b8496;
  --ink-4: #a6aebb;
  --line: #e6e9ef;
  --line-soft: #f0f2f6;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(18, 35, 68, .05), 0 1px 3px rgba(18, 35, 68, .06);
  --shadow-2: 0 10px 30px rgba(18, 35, 68, .12);
  --shadow-3: 0 20px 60px rgba(18, 35, 68, .18);
  --header-h: 60px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, textarea, select, button { font-size: 14px; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 基础控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px;
  background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
  font-weight: 500;
}
.btn:hover { background: #f6f8fc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(43, 108, 255, .22); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(24, 39, 75, .06); }
.btn-outline { border-color: var(--line); background: #fff; }
.btn-outline:hover { border-color: #c9d2e3; background: #fafbfe; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fde0e0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; color: var(--ink-3); }
.btn-icon:hover { background: rgba(24, 39, 75, .07); color: var(--ink); }
.btn .icon { width: 17px; height: 17px; }

.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
  color: var(--ink);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43, 108, 255, .12);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.textarea { resize: vertical; min-height: 76px; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8496' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.switch {
  position: relative; display: inline-flex; width: 46px; height: 26px; flex: 0 0 auto;
  border-radius: 999px; background: #dfe3ea; cursor: pointer; transition: background .18s;
  border: none; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

.checkbox, .radio {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 10px 12px; border-radius: 9px; transition: background .12s;
}
.checkbox:hover, .radio:hover { background: #f7f9fd; }
.checkbox input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox .box, .radio .box {
  width: 20px; height: 20px; border: 1.5px solid #c8cfdb; flex: 0 0 auto; margin-top: 1px;
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.radio .box { border-radius: 50%; }
.checkbox .box svg, .radio .box svg { width: 13px; height: 13px; opacity: 0; color: #fff; }
.checkbox input:checked + .box, .radio input:checked + .box { background: var(--blue); border-color: var(--blue); }
.checkbox input:checked + .box svg, .radio input:checked + .box svg { opacity: 1; }
.checkbox input:focus-visible + .box, .radio input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(43, 108, 255, .2); }
.checkbox .lbl, .radio .lbl { flex: 1; color: var(--ink); }

.field { margin-bottom: 18px; }
.field-label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 8px; }
.field-label .req { color: var(--red); font-weight: 600; }
.field-help { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; }
.field-error { margin-top: 6px; color: var(--red); font-size: 12.5px; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .upload-zone { border-color: var(--red); }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--header-h); position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: block; }
.brand-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.topbar-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.topbar-nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px;
}
.topbar-nav a:hover { background: #f4f6fa; text-decoration: none; }
.topbar-nav a.active { color: var(--blue); background: var(--blue-soft); }
.topbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-chip:hover { background: #f4f6fa; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6f9dff, #2b6cff);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 auto; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13.5px; color: var(--ink-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu {
  position: absolute; right: 22px; top: calc(var(--header-h) - 4px); min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2);
  padding: 6px; z-index: 60;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-size: 13.5px; width: 100%; border: 0; background: transparent; text-align: left;
}
.menu-item:hover { background: #f4f6fa; }
.menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 6px; }
.menu-head { padding: 9px 10px 7px; }
.menu-head .name { font-weight: 600; color: var(--ink); }
.menu-head .uid { font-size: 12px; color: var(--ink-3); }

/* ---------- 页面骨架 ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 26px 22px 80px; }
.page-narrow { max-width: 800px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; letter-spacing: -.3px; }
.page-desc { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.page-head .grow { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); }
.crumbs .sep { color: var(--ink-4); }
.crumbs .current { color: var(--ink); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 22px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.hidden { display: none !important; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-published { color: #0b8a52; background: var(--green-soft); }
.pill-draft { color: var(--ink-3); background: #f1f3f7; }
.pill-paused { color: #b26a00; background: var(--orange-soft); }
.pill-closed { color: var(--red); background: var(--red-soft); }

/* ---------- 收集表列表 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.form-card {
  position: relative; padding: 18px; border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; min-height: 156px;
}
.form-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #d8e2f5; }
.form-card .title { font-size: 16px; font-weight: 600; margin: 10px 0 6px; word-break: break-word; }
.form-card .meta { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; }
.form-card .meta .num { color: var(--blue); font-weight: 600; }
.form-card .more { position: absolute; right: 12px; top: 12px; opacity: 0; transition: opacity .15s; }
.form-card:hover .more { opacity: 1; }
.form-card .accent { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.form-card .accent .icon { width: 19px; height: 19px; }
.new-card {
  border: 1.5px dashed #cfd8e8; background: rgba(255, 255, 255, .55); align-items: center; justify-content: center;
  color: var(--ink-3); gap: 8px; min-height: 156px; cursor: pointer; display: flex; flex-direction: column;
  border-radius: var(--radius); transition: border-color .15s, color .15s, background .15s;
}
.new-card:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.new-card .plus { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); }

.empty {
  padding: 64px 20px; text-align: center; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .empty-ico { width: 74px; height: 74px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-1); display: flex; align-items: center; justify-content: center; color: var(--ink-4); margin-bottom: 4px; }
.empty .empty-ico .icon { width: 34px; height: 34px; }
.empty h3 { color: var(--ink); font-size: 16px; }

/* ---------- 编辑器 ---------- */
.editor-wrap { max-width: 760px; margin: 0 auto; }
.editor-title-input {
  border: 0; background: transparent; font-size: 24px; font-weight: 600; padding: 4px 0; width: 100%;
  outline: none; letter-spacing: -.3px;
}
.editor-title-input::placeholder { color: #c3cad6; }
.editor-desc-input { border: 0; background: transparent; color: var(--ink-2); width: 100%; resize: none; min-height: 26px; outline: none; padding: 2px 0; }
.question-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-1); position: relative; }
.question-card:focus-within { border-color: var(--blue-line); box-shadow: 0 0 0 3px rgba(43, 108, 255, .07); }
.q-head { display: flex; align-items: flex-start; gap: 8px; }
.q-seq { color: var(--ink-4); font-weight: 600; font-size: 13px; min-width: 20px; padding-top: 8px; }
.q-label-input { flex: 1; border: 0; background: transparent; font-size: 15px; font-weight: 600; padding: 6px 4px; outline: none; border-radius: 6px; }
.q-label-input:focus { background: #f7f9fd; }
.q-tools { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .15s; }
.question-card:hover .q-tools, .question-card:focus-within .q-tools { opacity: 1; }
.q-body { margin: 10px 0 4px 28px; }
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option { display: flex; align-items: center; gap: 8px; }
.q-option .opt-marker { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c8cfdb; flex: 0 0 auto; }
.q-option.check .opt-marker { border-radius: 5px; }
.q-option .input { flex: 1; padding: 7px 10px; }
.q-foot { display: flex; align-items: center; gap: 14px; margin: 12px 0 0 28px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.q-foot .spacer { flex: 1; }
.mini-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.mini-toggle .switch { width: 38px; height: 22px; }
.mini-toggle .switch::after { width: 16px; height: 16px; }
.mini-toggle .switch[aria-checked="true"]::after { transform: translateX(16px); }
.add-question {
  width: 100%; border: 1.5px dashed #cfd8e8; background: rgba(255, 255, 255, .6); color: var(--ink-2);
  border-radius: var(--radius); padding: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-weight: 500; transition: border-color .15s, color .15s, background .15s;
}
.add-question:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.type-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.type-btn {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; color: var(--ink-2); text-align: left;
}
.type-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.type-btn .icon { width: 17px; height: 17px; }
.editor-actions {
  position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 72%, rgba(244, 246, 250, 0));
  padding: 18px 0 22px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 8px;
}
.banner {
  display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border-radius: 10px;
  background: var(--orange-soft); color: #8a5300; font-size: 13px; margin-bottom: 14px;
}
.banner.info { background: var(--blue-soft); color: #1d4ed8; }
.banner .icon { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- 结果页 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .k { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat-card .v { font-size: 25px; font-weight: 600; margin-top: 5px; letter-spacing: -.5px; }
.stat-card .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-1); max-height: calc(100vh - 330px); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 11px 13px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th {
  position: sticky; top: 0; z-index: 2; background: #fbfcff; color: var(--ink-2); font-weight: 600;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
table.data th.sys { background: #fff7e0; color: #8a5a00; }
table.data td.sys { color: var(--ink-2); }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: #f7faff; }
table.data td.text { white-space: normal; min-width: 130px; max-width: 260px; word-break: break-word; }
table.data .thumb-row { display: flex; gap: 4px; }
table.data .thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #f3f5f9; cursor: zoom-in; }
table.data .thumb-more { width: 38px; height: 38px; border-radius: 6px; background: #eef1f6; color: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.table-empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.load-more { padding: 14px; text-align: center; }

/* 卡片视图 */
.sub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sub-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; box-shadow: var(--shadow-1); }
.sub-card:hover { border-color: var(--blue-line); box-shadow: var(--shadow-2); }
.sub-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sub-card .who { font-weight: 600; }
.sub-card .when { color: var(--ink-3); font-size: 12px; }
.sub-card .kv { display: flex; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line-soft); }
.sub-card .kv .k { color: var(--ink-3); min-width: 88px; flex: 0 0 auto; }
.sub-card .kv .v { word-break: break-word; }
.sub-card .imgs { display: flex; gap: 6px; margin-top: 8px; }
.sub-card .imgs img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- 抽屉 / 弹窗 / 图片查看 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .44); z-index: 80; display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  margin-left: auto; width: min(560px, 100%); height: 100%; background: #fff; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; animation: slideIn .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { font-size: 16px; }
.drawer-body { padding: 20px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.modal {
  margin: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-3);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 4px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 12px 22px 4px; overflow: auto; color: var(--ink-2); }
.modal-foot { padding: 18px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal.wide { width: min(680px, calc(100vw - 32px)); }

.lightbox { position: fixed; inset: 0; background: rgba(8, 12, 20, .9); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lightbox .close { position: absolute; top: 16px; right: 18px; color: #fff; background: rgba(255, 255, 255, .14); border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox .nav.prev { left: 18px; } .lightbox .nav.next { right: 18px; }

.toast-root { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(22, 28, 40, .92); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow-2); animation: toastIn .2s ease; max-width: 86vw;
}
.toast.error { background: rgba(190, 40, 45, .95); }
.toast.success { background: rgba(9, 133, 81, .95); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-left { position: relative; overflow: hidden; background: linear-gradient(150deg, #1b4fe0 0%, #2b6cff 48%, #5b93ff 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-left::after { content: ""; position: absolute; width: 620px; height: 620px; right: -220px; bottom: -280px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 62%); }
.login-left::before { content: ""; position: absolute; width: 340px; height: 340px; left: -130px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; position: relative; z-index: 1; }
.login-brand img { width: 38px; height: 38px; border-radius: 11px; }
.login-hero { position: relative; z-index: 1; }
.login-hero h1 { font-size: 38px; line-height: 1.22; letter-spacing: -.8px; font-weight: 600; }
.login-hero p { margin-top: 16px; color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.7; max-width: 460px; }
.login-points { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.login-point { display: flex; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, .9); font-size: 14px; }
.login-point .ico { width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.login-foot { position: relative; z-index: 1; color: rgba(255, 255, 255, .62); font-size: 12.5px; }
.login-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fbfcff; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card h2 { font-size: 22px; letter-spacing: -.3px; }
.login-card .sub { color: var(--ink-3); margin-top: 8px; font-size: 13.5px; }
.qr-box { position: relative; width: 268px; height: 268px; margin: 26px auto 0; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img { width: 232px; height: 232px; image-rendering: pixelated; }
.qr-box .qr-loading { color: var(--ink-3); font-size: 13px; }
.qr-box .qr-expired { position: absolute; inset: 0; background: rgba(255, 255, 255, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-2); font-size: 14px; }
.login-steps { margin-top: 22px; display: flex; justify-content: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.login-steps .n { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); align-items: center; justify-content: center; font-size: 11px; font-weight: 600; margin-right: 5px; }
.login-status { margin-top: 18px; min-height: 22px; color: var(--ink-3); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.spinner { width: 14px; height: 14px; border: 2px solid #d7deea; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dev-login { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); }
.dev-login .btn { color: var(--ink-3); }
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 30px 20px; align-items: flex-start; }
  .login-card { margin-top: 6vh; }
}

/* ---------- 二维码分享页 ---------- */
.share-wrap { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 22px; align-items: start; }
.qr-card { text-align: center; padding: 26px; }
.qr-card img.qr { width: 280px; height: 280px; margin: 8px auto 18px; border-radius: 12px; image-rendering: pixelated; }
.qr-card .title { font-weight: 600; font-size: 16px; word-break: break-word; }
.qr-card .hint { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.link-box { display: flex; gap: 8px; margin-top: 8px; }
.link-box .input { font-size: 12.5px; color: var(--ink-2); }
.share-tips { padding: 18px 20px; }
.share-tips li { display: flex; gap: 10px; padding: 8px 0; color: var(--ink-2); font-size: 13.5px; }
.share-tips li .ico { width: 26px; height: 26px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
@media (max-width: 760px) { .share-wrap { grid-template-columns: 1fr; } .qr-card img.qr { width: 230px; height: 230px; } }

/* ---------- 设置 ---------- */
.settings-group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.settings-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .info { flex: 1; min-width: 0; }
.settings-row .info .name { font-size: 14px; color: var(--ink); }
.settings-row .info .desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.settings-row .control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.settings-row .control .input { width: 110px; text-align: right; }
.danger-zone { border-color: #f6d5d5; }
.danger-zone .settings-row .name { color: var(--red); }

/* ---------- 手机填写页 ---------- */
.fill-page { max-width: 640px; margin: 0 auto; padding: 0 16px 110px; }
.fill-hero { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; margin: 16px 0 12px; }
.fill-hero h1 { font-size: 22px; letter-spacing: -.3px; word-break: break-word; }
.fill-hero p { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; white-space: pre-wrap; }
.fill-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 10px; }
.fill-q-label { display: flex; gap: 6px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.fill-q-label .no { color: var(--ink-4); font-weight: 600; min-width: 26px; }
.fill-q-body { margin: 12px 0 0 32px; }
.fill-options { display: flex; flex-direction: column; gap: 2px; margin: -6px -12px; }
.privacy-hint { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.privacy-hint .icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }
.upload-zone { border: 1px dashed #c6d0e0; border-radius: 10px; padding: 22px 12px; text-align: center; color: var(--ink-3); cursor: pointer; background: #fbfcff; transition: border-color .15s, background .15s; }
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.upload-zone .big-plus { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.upload-zone .sub { font-size: 12px; color: var(--ink-4); margin-top: 4px; }
.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.upload-item { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #f3f5f9; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(16, 24, 40, .66); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.upload-item .del .icon { width: 12px; height: 12px; }
.upload-item.uploading { display: flex; align-items: center; justify-content: center; }
.fill-submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 30;
}
.fill-submit-inner { max-width: 640px; margin: 0 auto; }
.fill-success { text-align: center; padding: 60px 20px; }
.fill-success .ok-ring { width: 78px; height: 78px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.fill-success .ok-ring .icon { width: 38px; height: 38px; }
.fill-success h2 { font-size: 21px; }
.fill-success p { color: var(--ink-3); margin-top: 8px; }
.fill-success .actions { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fill-footer { text-align: center; color: var(--ink-4); font-size: 12px; padding: 22px 0 8px; }
.fill-footer a { color: var(--ink-4); }
.paused-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 46px 22px; text-align: center; margin-top: 16px; }
.paused-box .ico { width: 62px; height: 62px; border-radius: 18px; background: var(--orange-soft); color: var(--orange); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.paused-box h2 { font-size: 19px; }
.paused-box p { color: var(--ink-3); margin-top: 6px; font-size: 13.5px; }

/* ---------- 二维码落地页 ---------- */
.qr-landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; text-align: center; background: #fff; }
.qr-landing .illu { width: 96px; height: 96px; border-radius: 26px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.qr-landing .illu .icon { width: 48px; height: 48px; }
.qr-landing h1 { font-size: 22px; }
.qr-landing p { color: var(--ink-3); margin-top: 10px; max-width: 420px; font-size: 14px; line-height: 1.7; }
.qr-landing .btn { margin-top: 24px; }

/* ---------- 骨架屏 ---------- */
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fc 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .topbar-nav a { padding: 6px 9px; }
  .page { padding: 18px 14px 80px; }
}
@media (max-width: 640px) {
  .page-title { font-size: 21px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .v { font-size: 21px; }
  .topbar-nav { display: none; }
  .user-name { display: none; }
  .editor-title-input { font-size: 21px; }
  .page-head .btn { height: 34px; }
  .table-wrap { max-height: none; border-radius: 12px; }
  .fill-page { padding: 0 12px 110px; }
  .fill-hero { padding: 18px 15px; }
  .fill-card { padding: 16px 14px; }
  .fill-q-body { margin-left: 0; }
  .upload-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-foot .btn { flex: 1; }
}
@media (prefers-color-scheme: dark) {
  /* 保持浅色主题：收集页需要稳定可读，不跟随系统暗色。 */
}
