/* 碰碰 NFC 运营台 */
.merchant-thumbnail{height:112px;margin-bottom:16px;overflow:hidden;border-radius:8px;background:var(--surface-sink);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px}
.merchant-thumbnail img{width:100%;height:100%;object-fit:cover}
.merchant-image-field{min-width:0;padding:14px;border:1px solid var(--line);border-radius:8px}
.merchant-image-field input[type="file"]{width:100%;max-width:100%;min-width:0;font-size:12px}
.merchant-image-preview{display:block;width:100%;height:120px;object-fit:cover;margin:12px 0;border-radius:6px;background:#fff}
.merchant-image-preview.wechat-qr{object-fit:contain}
.image-upload-status{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0}
.promo-image-manager{min-width:0;margin:24px 0;padding-top:18px;border-top:1px solid var(--line)}
.promo-image-manager input[type="file"]{display:block;width:100%;min-width:0;max-width:100%;font-size:12px;white-space:normal}
.promo-image-list{display:grid;gap:14px;margin-top:14px;min-width:0}
.asset-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.asset-list .asset-row{grid-template-columns:minmax(0,1fr)}
.promo-image-row{display:grid;grid-template-columns:120px minmax(0,1fr);gap:14px;border:1px solid var(--line);border-radius:8px;padding:12px;min-width:0}
.promo-image-thumb{min-width:0;display:grid;place-items:center;align-content:start;background:var(--surface-soft)}
.promo-image-thumb img{display:block;width:100%;height:110px;object-fit:contain}
.promo-image-details{min-width:0;overflow-wrap:anywhere}
.promo-image-details textarea{box-sizing:border-box;width:100%;max-width:100%;min-width:0;resize:vertical}
.promo-image-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.promo-image-actions .button{min-height:36px;max-width:100%;white-space:normal}
.asset-upload-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.asset-file-icon{display:grid;place-items:center;min-height:110px;color:var(--muted-strong);font-weight:700;background:var(--surface-sink);border:1px dashed var(--line-strong)}
.showcase-asset-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:12px 0}
.showcase-choice{display:grid;grid-template-columns:auto 1fr;gap:7px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:8px;min-width:0;cursor:pointer}
.showcase-choice img{grid-column:1/-1;width:100%;height:100px;object-fit:cover;border-radius:6px;background:var(--surface-sink)}
.showcase-choice span{min-width:0;overflow-wrap:anywhere;font-size:12px}
.showcase-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0;min-width:0}
.showcase-preview img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;border-radius:6px;background:var(--surface-sink)}
.merchant-card-manager{min-width:0;margin:24px 0;padding-top:18px;border-top:1px solid var(--line)}
.merchant-card-list{display:grid;gap:8px;margin:10px 0}
.merchant-card-row{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid var(--line);border-radius:8px;padding:10px;min-width:0}
.merchant-card-row>div:first-child{min-width:0;overflow-wrap:anywhere}
.merchant-card-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}
.merchant-card-row .content-actions{grid-column:2;grid-row:1/3;flex-wrap:wrap}
.merchant-card-edit{grid-column:1/-1;min-width:0;width:100%;font-size:12px}
.merchant-card-edit summary{cursor:pointer;padding:8px 0;color:var(--accent-deep)}
.merchant-card-edit .form-grid{margin:8px 0}
.merchant-detail-link{border:0;padding:0;background:none;font:inherit;font-weight:700;text-align:left;color:var(--ink);cursor:pointer;overflow-wrap:anywhere}
.merchant-detail-link:hover{text-decoration:underline}
.merchant-detail-nav{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px}
.merchant-detail-nav .button{min-height:40px}
.showcase-preview-item{display:grid;gap:5px;min-width:0;font-size:12px}
.showcase-preview-item .asset-upload-actions{margin:0;gap:4px}
.camera-dialog{border:0;border-radius:12px;padding:0;max-width:min(520px,calc(100vw - 24px));background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.camera-dialog::backdrop{background:rgba(22,20,18,.52)}
.camera-dialog-body{display:grid;gap:12px;padding:16px}
.camera-dialog video{display:block;width:100%;max-height:60vh;object-fit:cover;border-radius:8px;background:#111}
@media(max-width:620px){.promo-image-row{grid-template-columns:minmax(0,1fr);gap:10px}.promo-image-thumb img{height:150px}.promo-image-actions .button{min-height:44px}.promo-image-manager input[type="file"]{font-size:14px}}
@media(max-width:620px){.asset-list{grid-template-columns:minmax(0,1fr)}.merchant-card-row{grid-template-columns:minmax(0,1fr)}.merchant-card-row .content-actions{grid-column:1;grid-row:auto;width:100%;flex-wrap:wrap}.showcase-asset-list{grid-template-columns:repeat(2,minmax(0,1fr))}.showcase-preview-item .button{width:100%;min-height:44px;padding:6px;white-space:normal}}
:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-soft: #faf8f3;
  --surface-sink: #efede5;
  --ink: #19181c;
  --ink-soft: #3f3d43;
  --muted: #797469;
  --muted-strong: #5d594f;
  --line: #e4e0d6;
  --line-strong: #d6d1c4;
  --accent: #f04b2a;
  --accent-deep: #d33b1d;
  --accent-soft: #fff0ea;
  --green: #0f7a58;
  --green-soft: #e6f5ee;
  --amber: #9a6a12;
  --amber-soft: #fdf3dd;
  --blue: #2b5fd9;
  --blue-soft: #eaefff;
  --danger: #b92d2d;
  --danger-soft: #fdecec;
  --dark: #17161a;
  --dark-soft: #242229;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(25, 24, 28, .05);
  --shadow: 0 1px 2px rgba(25, 24, 28, .04), 0 14px 34px rgba(25, 24, 28, .06);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .92em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 启动与登录 */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
  background: var(--surface-soft);
}

.auth-panel {
  padding: 56px clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: var(--surface);
}

.auth-brand, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.auth-brand { margin-bottom: 30px; }
.auth-brand strong, .sidebar-brand strong { display: block; font-size: 20px; letter-spacing: .04em; }
.auth-brand small, .sidebar-brand small { display: block; font-size: 9px; letter-spacing: .18em; color: var(--muted); margin-top: 1px; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(240, 75, 42, .28);
}

.brand-mark .icon { width: 24px; height: 24px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-panel h1 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.02em; }
.auth-description { color: var(--muted); max-width: 40ch; line-height: 1.7; }
.auth-form { margin-top: 16px; display: grid; gap: 16px; }
.auth-note { margin-top: 24px; color: var(--muted); font-size: 12px; max-width: 44ch; }

.auth-art {
  position: relative;
  margin: 18px;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(240, 75, 42, .38), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(255, 196, 120, .16), transparent 45%),
    linear-gradient(145deg, #19181c, #2a2520 60%, #19181c);
  color: #f8f3ea;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 4vw, 52px);
}

.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  mask-image: linear-gradient(to top, #000, transparent 70%);
}

.auth-art-copy { position: relative; max-width: 34ch; display: grid; gap: 18px; }
.auth-art-copy p { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.45; letter-spacing: -.01em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill-light { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #ffe8df; }

.signal { position: relative; width: 190px; height: 190px; margin-top: 16px; display: grid; place-items: center; }
.signal-card {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 18px 40px rgba(240, 75, 42, .45);
  position: relative;
  z-index: 2;
}
.signal-card .icon { width: 34px; height: 34px; }
.ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); }
.ring-1 { width: 112px; height: 112px; }
.ring-2 { width: 156px; height: 156px; opacity: .65; }
.ring-3 { width: 196px; height: 196px; opacity: .32; }

/* 基础表单与按钮 */
.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field small { color: var(--muted); font-size: 11.5px; line-height: 1.55; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}

input:hover, select:hover, textarea:hover { border-color: #c3bdaf; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 75, 42, .14);
}
input::placeholder, textarea::placeholder { color: #a49f94; }
textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8a857a 50%), linear-gradient(135deg, #8a857a 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.form-error {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(240, 75, 42, .24); }
.button-primary:hover:not(:disabled) { background: var(--accent-deep); }
.button-dark { background: var(--dark); color: #fff; }
.button-dark:hover:not(:disabled) { background: #2c2a31; }
.button-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.button-ghost:hover:not(:disabled) { background: var(--surface-sink); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover:not(:disabled) { background: #9c2323; }
.button-soft { background: var(--accent-soft); color: var(--accent-deep); border-color: #ffd8cc; }
.button-soft:hover:not(:disabled) { background: #ffe4db; }
.button-block { width: 100%; }
.button-small { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.button-small .icon { width: 15px; height: 15px; }

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: var(--surface-sink); color: var(--ink); }
.icon-button .icon { width: 17px; height: 17px; }
.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 后台框架 */
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px 20px;
  background: var(--dark);
  color: #f7f3ea;
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: 80px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 75, 42, .24), transparent 68%);
  pointer-events: none;
}

.sidebar-brand { padding: 4px 6px 2px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: none; }
.sidebar-brand small { color: #8f897d; }
.sidebar-brand strong { font-size: 18px; }

.nav { display: grid; gap: 4px; position: relative; z-index: 1; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b6b0a4;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav button .icon { width: 18px; height: 18px; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.is-active { background: rgba(240, 75, 42, .16); color: #ffd9cf; }
.nav button.is-active .icon { color: var(--accent); }

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; position: relative; z-index: 1; }

.ai-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .04);
  border-radius: 11px;
  padding: 9px 11px;
}
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #77726a; box-shadow: 0 0 0 3px rgba(255, 255, 255, .05); flex: none; }
.ai-chip.is-on .ai-dot { background: #35d39a; box-shadow: 0 0 0 3px rgba(53, 211, 154, .14); }
.ai-chip.is-warn .ai-dot { background: #e0a63c; box-shadow: 0 0 0 3px rgba(224, 166, 60, .14); }
.ai-copy { display: grid; line-height: 1.25; min-width: 0; }
.ai-copy strong { font-size: 12px; font-weight: 600; color: #e7e2d8; }
.ai-copy small { font-size: 10.5px; color: #948e82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #8f897d;
  font-size: 12px;
  padding: 6px 4px;
  border-radius: 8px;
}
.logout-button:hover { color: #fff; }
.logout-button .icon { width: 15px; height: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 34px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.page-heading h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.025em; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.view-root {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 34px 46px;
  flex: 1;
}
.view-root:focus { outline: none; }

.admin-footer {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 34px 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9b958a;
  font-size: 11.5px;
  border-top: 1px solid rgba(25, 24, 28, .05);
}

/* 通用面板与标题 */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 14px;
}
.section-head:first-child { margin-top: 8px; }
.section-head h2 { font-size: 17px; letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 14.5px; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }

.empty-state { padding: 42px 24px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty-state .icon { width: 30px; height: 30px; color: #b9b2a5; }
.empty-state strong { color: var(--ink-soft); font-size: 14px; }
.empty-state p { font-size: 12.5px; max-width: 38ch; line-height: 1.7; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.no-dot::before { display: none; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-gray { background: #f0eee8; color: #756f64; }
.badge-orange { background: var(--accent-soft); color: var(--accent-deep); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--danger-soft); color: var(--danger); }

.code-badge {
  display: inline-flex;
  align-items: center;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  background: var(--surface-sink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 7px;
  color: var(--ink-soft);
}

.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--muted-strong); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 概览 */
.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #1c1a1f 0%, #28231e 55%, #3a241c 100%);
  color: #f8f4eb;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-strip::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 75, 42, .4), transparent 68%);
}
.hero-strip h2 { font-size: 20px; letter-spacing: -.01em; }
.hero-strip p { color: #bdb6a9; font-size: 12.5px; margin-top: 5px; max-width: 54ch; }
.hero-actions { display: flex; gap: 8px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-strip .button-ghost { color: #f4eee3; border-color: rgba(255, 255, 255, .26); }
.hero-strip .button-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px 15px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  min-width: 0;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat-foot { color: var(--muted); font-size: 11.5px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 16px; margin-top: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }

.chart { padding: 20px; display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.chart-day { color: var(--muted); font-size: 11.5px; }
.chart-track { height: 9px; border-radius: 999px; background: #f1eee6; overflow: hidden; }
.chart-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff8a68, var(--accent)); min-width: 0; }
.chart-row.is-today .chart-day { color: var(--ink); font-weight: 700; }
.chart-row.is-today .chart-fill { background: linear-gradient(90deg, #ffb197, var(--accent)); }
.chart-value { text-align: right; font-size: 11.5px; color: var(--muted-strong); font-variant-numeric: tabular-nums; }
.w-0 { width: 0; }
.w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; }
.w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; }
.w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; }
.w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

.event-list { display: grid; }
.event-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 18px; border-bottom: 1px solid #f0ede6; }
.event-item:last-child { border-bottom: 0; }
.event-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-sink); color: var(--muted-strong); flex: none; }
.event-icon .icon { width: 15px; height: 15px; }
.event-icon.tap { background: var(--accent-soft); color: var(--accent-deep); }
.event-icon.draft, .event-icon.generate { background: var(--blue-soft); color: var(--blue); }
.event-main { min-width: 0; flex: 1; }
.event-main strong { display: block; font-size: 12.5px; }
.event-main span { color: var(--muted); font-size: 11.5px; }
.event-time { color: #a8a296; font-size: 11px; white-space: nowrap; }

.mini-list { display: grid; }
.mini-row { padding: 13px 18px; border-bottom: 1px solid #f0ede6; display: grid; gap: 7px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-row-head strong { font-size: 12.5px; }
.mini-row-head span { color: var(--muted); font-size: 11.5px; }
.mini-bar { height: 6px; border-radius: 999px; background: #f1eee6; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.quick-card { padding: 18px; display: grid; gap: 13px; }
.quick-card .field { gap: 5px; }
.quick-note { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.quick-preview { background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 11px; padding: 12px 13px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; max-height: 150px; overflow: auto; white-space: pre-wrap; }

.ai-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.ai-state .dot { width: 7px; height: 7px; border-radius: 50%; background: #b3ad9f; }
.ai-state.on .dot { background: var(--green); }
.ai-state.warn .dot { background: var(--amber); }

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 4px 0 14px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.search-box { position: relative; display: flex; align-items: center; min-width: 200px; }
.search-box .icon { position: absolute; left: 11px; width: 16px; height: 16px; color: #a49f94; pointer-events: none; }
.search-box input { padding-left: 34px; }
.toolbar select { width: auto; min-width: 116px; }
.filter-count { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #989286;
  padding: 11px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid #f0ede6; vertical-align: middle; font-size: 13px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfbf8; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.cell-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.row-link { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.row-link:hover { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }

/* 空卡提示 */
.callout {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: #23459c;
  font-size: 12.5px;
  line-height: 1.65;
}
.callout.warn { background: var(--amber-soft); color: #74500e; }
.callout .icon { width: 17px; height: 17px; margin-top: 1px; }

/* 门店卡片 */
.merchant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.merchant-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 13px;
  align-content: start;
}
.merchant-card-head { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fff0e9, #ffe1d6);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  flex: none;
}
.merchant-card-head strong { display: block; font-size: 15px; }
.merchant-card-head small { color: var(--muted); font-size: 11.5px; }
.merchant-meta { display: grid; gap: 6px; color: var(--muted-strong); font-size: 12px; }
.merchant-meta span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.merchant-meta .icon { width: 14px; height: 14px; color: #a49f94; }
.merchant-meta em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: var(--surface-sink); border-radius: 6px; padding: 2px 7px; font-size: 11px; color: var(--muted-strong); }
.merchant-card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0ede6; padding-top: 11px; gap: 8px; }
.platform-dots { display: flex; gap: 4px; }
.platform-dot { width: 7px; height: 7px; border-radius: 50%; background: #d8d3c8; }
.platform-dot.on { background: var(--green); }

/* 文案库 */
.library-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 16px; align-items: start; }
.library-list { display: grid; }
.content-item { padding: 15px 18px; border-bottom: 1px solid #f0ede6; display: grid; gap: 9px; }
.content-item:last-child { border-bottom: 0; }
.content-item:hover { background: #fcfbf8; }
.content-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.content-head .spacer { flex: 1; }
.content-text { font-size: 13px; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.content-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; flex-wrap: wrap; }
.content-foot .spacer { flex: 1; }
.content-actions { display: flex; gap: 1px; }
.library-pager { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.composer { position: sticky; top: 18px; }
.composer .panel-body { display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid .span-2 { grid-column: span 2; }
.composer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-box { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-soft); padding: 12px; display: grid; gap: 8px; }
.preview-box textarea { background: transparent; border: 0; padding: 0; min-height: 150px; box-shadow: none; }
.preview-box textarea:focus { box-shadow: none; }
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.preview-actions { display: flex; gap: 6px; }
.segmented { display: inline-flex; background: var(--surface-sink); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented button { border: 0; background: transparent; border-radius: 7px; padding: 5px 9px; font-size: 11.5px; color: var(--muted-strong); font-weight: 600; }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.library-stats { display: flex; gap: 14px; color: var(--muted); font-size: 11.5px; flex-wrap: wrap; }
.library-stats b { color: var(--ink-soft); font-weight: 600; }

/* 设置 */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 16px; align-items: start; }
.setting-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.setting-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.setting-head h2 { font-size: 15px; }
.setting-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.setting-body { padding: 20px; display: grid; gap: 15px; }
.setting-row { display: grid; gap: 5px; }
.setting-row > span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.setting-row small { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--surface-sink); color: var(--muted-strong); }
.status-pill.on { background: var(--green-soft); color: var(--green); }
.status-pill.off { background: var(--amber-soft); color: var(--amber); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; }
.switch-row strong { display: block; font-size: 12.5px; }
.switch-row small { color: var(--muted); font-size: 11.5px; }
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d9d4c8; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.key-preview { display: flex; align-items: center; gap: 8px; background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 9px 11px; color: var(--muted-strong); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.key-preview .icon { width: 15px; height: 15px; color: #a49f94; }
.setting-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-list { display: grid; gap: 8px; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f1eee6; font-size: 12.5px; }
.summary-list div:last-child { border: 0; }
.summary-list span { color: var(--muted); }
.summary-list b { font-weight: 600; }
.range-line { display: flex; align-items: center; gap: 10px; }
.range-line input[type="range"] { flex: 1; accent-color: var(--accent); padding: 0; }
.range-line output { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted-strong); }
.test-result { font-size: 12px; padding: 9px 11px; border-radius: 9px; background: var(--surface-soft); color: var(--muted-strong); }
.test-result.ok { background: var(--green-soft); color: var(--green); }
.test-result.bad { background: var(--danger-soft); color: var(--danger); }

/* 弹窗 */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: visible;
}
.modal::backdrop { background: rgba(20, 18, 22, .52); backdrop-filter: blur(3px); }
.modal-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(20, 18, 22, .35);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-card-small { max-width: 470px; margin: 0 auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; margin-top: 2px; }
.modal-body { padding: 19px 22px 22px; overflow-y: auto; display: grid; gap: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.qr-modal { width: min(560px, calc(100vw - 28px)); }
.qr-content { display: grid; gap: 14px; min-width: 0; }
.qr-preview { width: min(100%, 272px); justify-self: center; background: #fff; line-height: 0; }
.qr-preview svg { display: block; width: 100%; height: auto; }
.qr-caption { text-align: center; color: var(--ink-soft); margin: 0; }
.qr-url { margin: 0; padding: 12px; background: var(--surface-sink); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.qr-warning { margin: 0; padding: 12px; background: var(--amber-soft); color: #754b07; font-weight: 600; line-height: 1.7; }
.qr-print-hint { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted-strong); }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-actions .button { flex: 1 1 120px; min-height: 44px; justify-content: center; }
.confirm-text { color: var(--muted-strong); line-height: 1.7; font-size: 13px; }
.form-hint { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.field-row { display: grid; gap: 6px; }
.form-grid > .field { min-width: 0; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 4px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: #fbf8f1;
  padding: 10px 15px;
  border-radius: 11px;
  box-shadow: 0 16px 40px rgba(20, 18, 22, .28);
  font-size: 12.5px;
  max-width: min(90vw, 520px);
}
.toast .icon { width: 16px; height: 16px; color: #55d6a6; }

.review-stats { display: grid; gap: 12px; }
.review-stat-row { display: grid; grid-template-columns: minmax(92px, 1fr) repeat(3, auto); align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.review-stat-row strong { color: var(--dark); font-size: 13px; }
.review-stat-row span { color: var(--muted); white-space: nowrap; }
.review-stat-note { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.review-template-panel { display: grid; gap: 14px; margin-bottom: 18px; }
.review-template-panel select { width: min(100%, 360px); }
.review-template-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.review-template-field { display: grid; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.review-template-field strong { color: var(--dark); font-size: 12px; }
.review-template-field span { color: var(--muted); font-size: 11px; line-height: 1.5; }


/* 响应式 */
@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .settings-grid, .library-layout { grid-template-columns: 1fr; }
  .composer { position: static; }
}

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    overflow-x: auto;
  }
  .sidebar::after { display: none; }
  .sidebar-brand { flex: none; }
  .sidebar-brand small { display: none; }
  .nav { display: flex; flex: 1; gap: 2px; overflow-x: auto; }
  .nav button { width: auto; padding: 8px 11px; white-space: nowrap; }
  .nav button span { font-size: 12.5px; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .ai-chip { display: none; }
  .logout-button span { display: none; }
  .logout-button { padding: 7px; }
  .topbar { padding: 20px 20px 12px; }
  .view-root { padding: 4px 20px 34px; }
  .admin-footer { padding: 14px 20px 22px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 40px 24px; min-height: 100vh; }
}

@media (max-width: 620px) {
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; overflow: visible; }
  .sidebar-foot { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; overflow: visible; gap: 4px; }
  .nav button { width: 100%; min-height: 44px; padding: 10px; justify-content: center; }
  .nav button span { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero-strip { flex-direction: column; align-items: flex-start; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .composer-actions { grid-template-columns: 1fr; }
  .toolbar select { flex: 1; }
  .filter-count { margin-left: 0; }
  .admin-footer { flex-direction: column; }
  .merchant-grid { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 16px); }
  .review-stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .review-template-preview { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
