:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e7ebf2;
  --panel: #ffffff;
  --soft: #f6f8fc;
  --blue: #335dff;
  --blue-dark: #2445d3;
  --shadow: 0 22px 60px rgba(27, 43, 75, .13);
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }

/* Public microsite */
.site-app {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 32px 18px;
  background: #18243f;
  isolation: isolate;
}
.site-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--site-bg), linear-gradient(130deg, #192d58, #4268a5);
  background-size: cover;
  background-position: center;
  filter: saturate(.86);
}
.site-app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(7, 16, 36, .8), rgba(17, 31, 60, .24) 60%, rgba(16, 24, 40, .64));
}
.site-app { background: #18243f; }
.site-app::before, .site-app::after { display: block; }
.qr-only { width: 100%; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
.top-image { width: min(88vw, 420px); height: auto; max-height: 30vh; object-fit: contain; display: block; border-radius: 10px; }
.qr-only-image { width: min(74vw, 330px); height: min(74vw, 330px); object-fit: contain; display: block; margin: 0 auto; border-radius: 10px; background: #fff; }
.site-shell { width: min(100%, 1040px); position: relative; }
.site-nav { display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: clamp(40px, 9vw, 98px); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 700; letter-spacing: .05em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; color: #152452; background: #fff; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.16); }
.nav-note { font-size: 13px; opacity: .76; }
.site-content { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: clamp(32px, 8vw, 120px); align-items: center; color: #fff; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: .11em; text-transform: uppercase; color: rgba(255,255,255,.74); }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: #91b4ff; }
.site-title { margin: 18px 0 18px; font-size: clamp(38px, 6vw, 74px); line-height: 1.07; letter-spacing: -.045em; font-weight: 700; }
.site-subtitle { margin: 0; max-width: 520px; color: rgba(255,255,255,.76); line-height: 1.8; font-size: 16px; }
.site-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.meta-chip { border: 1px solid rgba(255,255,255,.23); background: rgba(255,255,255,.1); border-radius: 100px; padding: 8px 13px; font-size: 12px; color: rgba(255,255,255,.86); backdrop-filter: blur(8px); }
.qr-card { padding: 24px; border: 1px solid rgba(255,255,255,.46); border-radius: 24px; background: rgba(255,255,255,.93); box-shadow: var(--shadow); color: var(--ink); text-align: center; backdrop-filter: blur(14px); }
.qr-image-wrap { aspect-ratio: 1; border-radius: 15px; overflow: hidden; background: #f0f3f8; display: grid; place-items: center; }
.qr-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-placeholder { color: #75809a; font-size: 13px; line-height: 1.6; padding: 15px; }
.qr-label { margin: 17px 0 3px; font-weight: 700; font-size: 15px; }
.qr-hint { margin: 0; color: var(--muted); font-size: 12px; }
.site-footer { margin-top: clamp(42px, 10vw, 106px); color: rgba(255,255,255,.52); font-size: 12px; display: flex; justify-content: space-between; gap: 15px; }
.admin-link { color: inherit; text-decoration: none; }

/* Admin console */
.admin-body { background: var(--soft); }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #f6f8fc, #eef3ff); }
.admin-login-card { width: min(360px, 100%); padding: 34px 30px 30px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 60px rgba(27, 43, 75, .12); text-align: center; }
.admin-login-mark { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; color: #fff; background: var(--blue); font-size: 20px; box-shadow: 0 8px 18px rgba(51,93,255,.22); }
.admin-login-card h1 { margin: 0; color: var(--ink); font-size: 23px; letter-spacing: -.04em; }
.admin-login-card p { margin: 9px 0 18px; color: var(--muted); font-size: 13px; }
.admin-login-card .text-input { text-align: center; }
.admin-login-card .btn { width: 100%; margin-top: 14px; }
.admin-login-error { min-height: 18px; margin-top: 10px; color: #e05f6e; font-size: 12px; }
.admin-layout { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 52px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-topbar .brand-mark { background: var(--ink); color: #fff; }
.admin-topbar .brand { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 15px; font-weight: 600; font-size: 13px; color: #39445d; transition: .2s ease; }
.btn:hover { border-color: #bcc8e7; transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 18px rgba(51,93,255,.22); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.admin-heading { margin-bottom: 24px; }
.admin-heading h1 { margin: 0 0 7px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.admin-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.console-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 18px; box-shadow: 0 8px 30px rgba(30, 48, 82, .04); }
.site-list { padding: 10px; }
.site-list-title { padding: 9px 11px 13px; color: var(--muted); font-size: 12px; font-weight: 600; }
.site-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px; border: 0; border-radius: 11px; text-align: left; color: #515b70; background: transparent; }
.site-item:hover { background: #f4f6fb; }
.site-item.active { color: var(--blue); background: #eff3ff; }
.site-dot { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #f0f2f7; color: #65708a; font-size: 11px; font-weight: 700; }
.active .site-dot { color: #fff; background: var(--blue); }
.site-item-main { flex: 1; min-width: 0; }
.site-item-name { font-size: 13px; font-weight: 600; }
.site-item-status { margin-top: 3px; color: #99a1b2; font-size: 11px; }
.editor { padding: clamp(20px, 3vw, 32px); }
.editor-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.editor-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.025em; }
.editor-head p { margin: 0; color: var(--muted); font-size: 13px; }
.site-code { border-radius: 8px; background: #f4f6fb; color: #69748a; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #48536a; font-size: 12px; font-weight: 600; }
.text-input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); outline: none; font-size: 13px; transition: .2s; }
.text-input:focus { border-color: #8ca4ff; box-shadow: 0 0 0 3px #eff3ff; }
.upload-zone { position: relative; min-height: 206px; display: grid; place-items: center; padding: 18px; border: 1px dashed #cad2e4; border-radius: 14px; background: #fafbfe; overflow: hidden; }
.upload-zone:hover { border-color: #8ca4ff; background: #f7f9ff; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { width: 100%; height: 100%; min-height: 168px; border-radius: 9px; object-fit: cover; display: none; }
.upload-preview.visible { display: block; }
.upload-copy { text-align: center; color: #7a859a; font-size: 12px; line-height: 1.7; }
.upload-copy strong { display: block; margin-bottom: 3px; color: #4e5b76; font-size: 13px; }
.upload-icon { display: block; margin: 0 auto 10px; font-size: 23px; }
.qr-zone { min-height: 206px; }
.qr-zone .upload-preview { width: 168px; min-height: 168px; height: 168px; object-fit: contain; background: #fff; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 3; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 10px; background: #1b2539; color: #fff; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; font-size: 13px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .site-app { min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); align-items: stretch; }
  .site-shell { min-height: calc(100svh - max(46px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); display: flex; flex-direction: column; }
  .site-nav { margin-bottom: 0; }
  .site-content, .console-grid { grid-template-columns: 1fr; }
  .site-content { flex: 1; align-content: center; gap: clamp(28px, 7vh, 50px); padding: 34px 0 24px; }
  .site-title { margin-top: 15px; font-size: clamp(37px, 12vw, 54px); }
  .site-subtitle { font-size: 14px; line-height: 1.75; }
  .site-meta { margin-top: 22px; gap: 10px; flex-wrap: nowrap; justify-content: space-between; }
  .meta-chip { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
  .qr-card { width: min(100%, 286px); max-width: 310px; padding: 19px; justify-self: center; border-radius: 21px; }
  .qr-image-wrap { border-radius: 13px; }
  .site-footer { margin-top: auto; padding-top: 4px; }
  .console-grid { gap: 14px; }
  .site-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .site-list-title { grid-column: 1 / -1; }
  .site-item { padding: 8px; }
  .site-item-status { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .admin-layout { width: min(100% - 24px, 600px); padding-top: 17px; }
  .admin-topbar { margin-bottom: 22px; }
  .topbar-actions .btn:first-child { display: none; }
}

/* Live-code style control console */
.admin-topbar { height: 66px; margin: -28px 0 24px; padding: 0 22px; background: #fff; border-bottom: 1px solid #edf0f5; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.04em; }
.top-nav { align-self: stretch; display: flex; align-items: stretch; margin-left: 55px; }
.top-nav-item { display: grid; place-items: center; padding: 0 26px; color: var(--blue); font-size: 14px; font-weight: 600; border-bottom: 2px solid var(--blue); }
.topbar-user { display: flex; align-items: center; gap: 9px; color: #69748a; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #26b579; }
.avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #6e83b9; font-size: 12px; }
.admin-body-layout { display: grid; grid-template-columns: 194px minmax(0, 1fr); gap: 26px; }
.sidebar { padding-top: 5px; }
.sidebar-section-title { display: flex; align-items: center; gap: 9px; padding: 12px 14px; color: #36425a; font-weight: 700; font-size: 14px; }
.sidebar-icon { color: var(--blue); font-size: 16px; }.chevron { margin-left: auto; color: #aab3c4; }
.sidebar-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px 14px 13px 28px; border: 0; border-left: 3px solid transparent; background: transparent; color: #6d7890; text-align: left; font-size: 13px; }
.sidebar-item.active { color: var(--blue); border-left-color: var(--blue); background: #eef3ff; font-weight: 600; }.sidebar-item-icon { font-size: 14px; }
.admin-main { min-width: 0; }.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 6px 0 22px; }.breadcrumb { color: #9aa4b6; font-size: 12px; margin-bottom: 13px; }.page-heading h1 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.04em; }.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.list-panel { overflow: hidden; }.list-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }.count-label { color: #606b81; font-size: 13px; }.count-label strong { color: var(--ink); }.toolbar-right { display: flex; align-items: center; gap: 12px; }.sync-label { color: #27aa72; font-size: 12px; }.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #7c879a; font-size: 18px; }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; min-width: 690px; } th { padding: 13px 20px; text-align: left; color: #8a95a9; background: #fafbfc; font-size: 12px; font-weight: 600; } td { padding: 13px 20px; border-top: 1px solid #f0f2f6; color: #49556b; font-size: 13px; } .domain-col { width: 30%; }.time-col { width: 20%; }.action-col { width: 18%; }.domain-cell { display: flex; align-items: center; gap: 11px; }.domain-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: #eff3ff; font-size: 10px; font-weight: 700; }.domain-cell strong { display: block; color: #344058; font-weight: 600; }.domain-cell small { display: block; margin-top: 3px; color: #a0a9b8; font-size: 11px; }.qr-cell { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #edf0f5; border-radius: 8px; background: #fafbfe; }.qr-cell img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }.qr-empty { color: #adb5c4; font-size: 11px; }.state-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 100px; background: #f4f5f8; color: #8d98aa; font-size: 11px; }.state-pill i { width: 6px; height: 6px; border-radius: 50%; background: #aeb7c5; }.state-pill.ready { color: #199c67; background: #edfaf4; }.state-pill.ready i { background: #25b875; }.time-cell { color: #929db0; font-size: 12px; }.action-cell { white-space: nowrap; }.row-action { padding: 6px 11px; border: 1px solid #dbe2f2; border-radius: 7px; background: #fff; color: var(--blue); font-size: 12px; }.row-action + .row-action { margin-left: 7px; color: #e05f6e; border-color: #f0dfe3; }.page-footnote { margin: 13px 3px; color: #9da7b7; font-size: 12px; }
.visit-count { display: inline-flex; align-items: baseline; gap: 5px; color: #61708a; }
.visit-count strong { color: #33415f; font-size: 15px; }
.visit-count small { color: #9aa4b6; font-size: 11px; }
.visit-count span { color: #c3cad6; margin: 0 2px; }
.data-backdrop[hidden] { display: none !important; }
.data-backdrop { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; background: rgba(17, 27, 49, .52); }
.data-modal { width: min(980px, 100%); max-height: min(760px, calc(100vh - 32px)); overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(22, 35, 64, .24); }
.data-url { margin: 6px 0 0; color: var(--blue); font-size: 12px; }
.data-body { padding: 18px 22px 24px; }
.data-summary { margin-bottom: 14px; color: #68748a; font-size: 13px; }
.data-table-wrap { max-height: 500px; overflow: auto; }
.data-table-wrap table { min-width: 700px; }
.data-table-wrap td, .data-table-wrap th { white-space: nowrap; }
.qr-manage-row { display: flex; align-items: center; gap: 14px; min-height: 116px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qr-manage-row img { width: 100px; height: 100px; flex: 0 0 100px; object-fit: contain; border: 1px solid #edf0f5; border-radius: 8px; background: #fff; }
.qr-manage-row span { flex: 1; color: #536079; font-size: 13px; }
/* 访问上限不启用：始终不限量 */
#totalLimit, #dailyLimit, label[for="totalLimit"], label[for="dailyLimit"] { display: none !important; }
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(17, 27, 49, .46); }
.edit-modal { width: min(720px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(22, 35, 64, .24); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-kicker { color: var(--muted); font-size: 12px; }
.modal-head h2 { margin: 5px 0 0; font-size: 20px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f4f6fb; color: #667085; font-size: 22px; line-height: 1; }
.modal-content { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px; }
.modal-preview { text-align: center; }
.modal-preview-box { width: 200px; height: 200px; display: grid; place-items: center; margin: 0 auto 10px; border: 1px dashed #cad2e4; border-radius: 12px; background: #fafbfe; color: #8c96aa; font-size: 12px; overflow: hidden; }
.modal-preview-box img { width: 100%; height: 100%; object-fit: contain; }
.modal-preview-hint { color: #9aa4b6; font-size: 11px; line-height: 1.6; }
.modal-form { display: flex; flex-direction: column; gap: 9px; }
.form-label { color: #48536a; font-size: 12px; font-weight: 600; }
.upload-btn { display: inline-flex; align-items: center; justify-content: center; width: fit-content; margin-top: 9px; padding: 10px 14px; border: 1px solid #dbe2f2; border-radius: 9px; color: var(--blue); background: #fff; font-size: 12px; cursor: pointer; }
.upload-btn input { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .admin-topbar { margin: -17px 0 18px; padding: 0 13px; }.top-nav { margin-left: 15px; }.top-nav-item { padding: 0 13px; }.topbar-user { display: none; }.admin-body-layout { grid-template-columns: 1fr; gap: 12px; }.sidebar { padding: 0; }.sidebar-section-title { padding: 9px 11px; }.sidebar-item { padding: 10px 14px; }.page-heading { align-items: flex-start; }.page-heading .btn { display: none; }.modal-content { grid-template-columns: 1fr; }.modal-preview-box, .modal-preview-hint { margin-left: auto; margin-right: auto; }.modal-form { gap: 8px; } }
