:root {
  --paper: #fff;
  --page: #f2f6f4;
  --ink: #182c27;
  --muted: #536c64;
  --line: #d6e2de;
  --teal: #075d51;
  --tint: #e1f0eb;
  --alert: #9d392b;
  --alert-bg: #fceae5;
  --warn: #805116;
  --warn-bg: #fff1d7;
  font: 16px/1.5 "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:is(button,a,input,textarea,select,summary):focus-visible { outline: 2px solid #17856f; outline-offset: 3px; }
input, textarea, select {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #bfcfc9;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: #647a72; }
textarea { resize: vertical; }
label { display: grid; gap: 5px; min-width: 0; font-size: .875rem; font-weight: 600; }
label :is(input,textarea,select) { font-weight: 400; }
.muted, .hint, .subline { color: var(--muted); }
.hint, .subline, .muted { font-size: .875rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  border: 1px solid #bbcbc5;
  border-radius: 8px;
  padding: 6px 13px;
  background: var(--paper);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--page); }
.btn.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.btn.primary:hover { background: #064a41; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px 9px 9px 3px;
  background: var(--teal);
  color: #fff;
  font-size: .875rem;
}
.fields { display: grid; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.top-gap { margin-top: 14px; }
.form-status { color: var(--alert); font-size: .875rem; min-height: 1.5em; }

.review-page { background: linear-gradient(155deg,#daebe4 0%,#f3f7f5 35%,#f3f7f5 100%); min-height: 100vh; }
.review-shell { max-width: 560px; margin: auto; padding: 27px 16px 36px; }
.review-header { margin-bottom: 20px; }
.review-header .brand { color: var(--teal); font-size: .875rem; }
.review-header h1 { margin-top: 13px; font-size: clamp(1.75rem, 5.8vw, 2.4rem); letter-spacing: .02em; }
.review-header p { color: var(--muted); margin-top: 4px; }
.public-panel { margin-bottom: 12px; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.identity-grid { display: grid; grid-template-columns: .9fr 1.2fr; gap: 12px; }
.review-page :is(input,textarea) { font-size: 1rem; }
.rating-heading { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; padding-bottom: 5px; }
.rating-heading h2 { font-size: 1rem; }
.rating-heading span, .review-note small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.rating-row { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 10px 0 11px; min-width: 0; }
.rating-row legend { padding: 0; float: left; width: 100%; margin-bottom: 4px; font-size: .9rem; font-weight: 600; }
.stars { clear: left; display: flex; gap: 5px; }
.star { position: relative; display: grid; place-items: center; flex: 0 1 47px; min-height: 44px; cursor: pointer; }
.star input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.star span { display: grid; place-items: center; width: 100%; height: 40px; color: #607970; border-radius: 8px; background: #eff5f2; font-size: 1.5rem; line-height: 1; }
.star:has(input:checked) span, .star:has(~ .star input:checked) span { color: #824c0a; background: #f9e8c7; }
.star:has(input:focus-visible) span { outline: 2px solid #17856f; outline-offset: 2px; }
.review-note { margin-top: 12px; grid-template-columns: auto 1fr; align-items: center; }
.review-note textarea { grid-column: 1 / -1; }
.public-submit { width: 100%; min-height: 47px; font-size: 1rem; }
.review-page .form-status { margin-top: 6px; }
.review-success { padding: 29px 20px; text-align: center; }
.review-success :is(h2,p) { margin-top: 6px; }
.success-mark { display: grid; place-items: center; margin: 0 auto; width: 46px; height: 46px; border-radius: 50%; background: var(--tint); color: var(--teal); font-size: 1.4rem; }

.login-shell {
  max-width: 420px;
  margin: min(15vh, 105px) auto 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}
.login-shell h1 { margin: 16px 0; font-size: 1.6rem; }
.login-shell form { display: grid; gap: 12px; }
.admin-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; gap: 22px; max-width: 1420px; min-height: 62px; margin: auto; padding: 0 25px; }
.admin-header nav { display: flex; align-self: stretch; gap: 4px; }
.admin-header nav button { padding: 0 12px; min-height: 41px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: .875rem; white-space: nowrap; }
.admin-header nav button[aria-current] { color: var(--teal); border-bottom-color: var(--teal); font-weight: 700; }
.nav-count { border-radius: 20px; padding: 1px 6px; background: var(--tint); color: var(--teal); font-size: .75rem; }
.signout { margin-left: auto; white-space: nowrap; }
.admin-main { max-width: 1420px; padding: 25px; margin: auto; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 17px; }
.admin-heading h1 { font-size: clamp(1.6rem,3vw,2.1rem); line-height: 1.3; }
.admin-heading p { margin-top: 4px; }
.heading-actions, .inline-field { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-field select { width: auto; min-width: 104px; }
.admin-status { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); color: var(--teal); margin-bottom: 12px; }
.admin-status.error { color: var(--alert); background: var(--alert-bg); }
.split { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); align-items: start; gap: 14px; }
.settings-split { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); }
.panel { border: 1px solid var(--line); border-radius: 12px; min-width: 0; background: var(--paper); }
.panel-header { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.panel-header h2 { font-size: 1rem; }
.panel-body { padding: 14px 15px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .875rem; }
tr:last-child td { border-bottom: 0; }
th { font-size: .82rem; font-weight: 600; color: var(--muted); background: #f7faf8; white-space: nowrap; }
:is(th,td):first-child { padding-left: 14px; }
:is(th,td):last-child { padding-right: 14px; }
tr.selected { background: #eef7f3; }
.subline { font-size: .78rem; margin-top: 2px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-button, .pills button { padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--teal); font-size: .875rem; font-weight: 600; }
.text-button { padding-inline: 0; text-align: left; }
.text-button:hover { text-decoration: underline; }
.badge { display: inline-block; border-radius: 6px; background: #edf3f0; color: #415c52; padding: 3px 6px; white-space: nowrap; font-size: .77rem; font-weight: 600; }
.badge.success { color: var(--teal); background: var(--tint); }
.badge.warning { color: var(--warn); background: var(--warn-bg); }
.badge.danger { color: var(--alert); background: var(--alert-bg); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 9px 11px; }
.pills button { color: var(--muted); min-height: 34px; }
.pills button[aria-pressed="true"] { background: var(--tint); color: var(--teal); }
.pills span { font-variant-numeric: tabular-nums; }
.linked { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; color: var(--muted); font-size: .875rem; }
.detail-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 10px; }
.facts dt { color: var(--muted); font-size: .79rem; }
.facts dd { font-size: .895rem; overflow-wrap: anywhere; }
.note-box { padding: 9px 10px; border-radius: 7px; background: var(--page); margin-bottom: 12px; }
.note-box p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; font-size: .875rem; }
.message-text { white-space: pre-wrap; font-size: .9rem; }
.message-text + .hint { margin: 8px 0 10px; }
.empty { margin: 0; padding: 15px; color: var(--muted); font-size: .875rem; }
.setting-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 9px 10px 12px; }
.setting-group legend { padding: 0 5px; color: var(--muted); font-size: .875rem; }
.add-store { padding: 12px 15px 15px; border-top: 1px solid var(--line); }
.add-store summary { color: var(--teal); font-weight: 600; }
.add-store form { margin-top: 10px; }
dialog { border: 1px solid var(--line); border-radius: 13px; color: var(--ink); padding: 0; max-width: min(420px,calc(100% - 24px)); }
dialog::backdrop { background: #14312bb3; }
.dialog-body { display: grid; justify-items: center; gap: 10px; padding: 18px; }
.dialog-body h2 { font-size: 1.03rem; }
.dialog-body img { max-width: 100%; height: auto; }
.link-text { color: var(--muted); user-select: text; overflow-wrap: anywhere; max-width: 100%; text-align: center; }

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  .header-inner { padding: 8px 12px 0; gap: 4px 10px; flex-wrap: wrap; }
  .admin-header nav { order: 3; width: 100%; gap: 2px; }
  .admin-header nav button { padding-inline: 6px; }
  .admin-heading { align-items: start; flex-direction: column; }
  .admin-main { padding: 16px 12px; }
  .login-shell { margin: 22px 12px; }
  .setting-group { grid-template-columns: minmax(0,1fr); }
  :is(th,td):first-child { padding-left: 9px; }
  :is(th,td):last-child { padding-right: 9px; }
}
@media (max-width: 350px) {
  .identity-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .public-panel { padding-inline: 11px; }
}
