:root {
  --ink: #111314;
  --paper: #fffdf8;
  --wash: #f3f0e8;
  --line: #d9d0c3;
  --muted: #6a645e;
  --green: #0f6b58;
  --mint: #d9efe6;
  --tomato: #d84e34;
  --yellow: #f6c851;
  --blue: #385f8a;
  --coal: #191b1c;
  --white: #ffffff;
  --shadow: 0 18px 44px rgba(17, 19, 20, .13);
  --tight: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 19, 20, .04) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(#fffdf8, #f5f1e8 52%, #eef6f2);
  font-family: var(--tight);
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(246, 200, 81, .2), transparent 24%),
    radial-gradient(circle at 84% 4%, rgba(56, 95, 138, .18), transparent 22%),
    radial-gradient(circle at 80% 72%, rgba(15, 107, 88, .13), transparent 24%);
  z-index: -1;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.shell { width: min(1180px, calc(100% - 34px)); margin: 0 auto; }

.top-strip {
  background: var(--coal);
  color: rgba(255, 255, 255, .86);
  font-size: 13px;
}
.top-strip .shell {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.top-strip b { color: var(--yellow); }
.site-header, .admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav, .admin-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
}
.brand-mark.image {
  overflow: hidden;
  background: var(--paper);
}
.brand-mark.image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand strong { display: block; font-size: 20px; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.nav-links, .admin-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}
.btn, .ghost, .square, .mini {
  min-height: 42px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(17, 19, 20, .2);
  transition: transform .16s ease, box-shadow .16s ease;
}
.ghost { background: var(--white); color: var(--ink); }
.square {
  width: 44px;
  padding: 0;
  background: var(--yellow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}
.mini {
  min-height: 34px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
  box-shadow: none;
  font-size: 13px;
}
.mini.danger { background: #ffe5df; color: #8f2415; }
.btn:hover, .ghost:hover, .square:hover, .mini:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 rgba(17, 19, 20, .22);
}

.hero {
  padding: 44px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .96fr);
  gap: 36px;
  align-items: stretch;
}
.hero-image-section {
  padding-top: 12px;
}
.hero-image-section img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(17, 19, 20, .14);
}
.hero-main, .deal-board, .product, .scenario, .proof-panel, .checkout-panel, .table-card, .product-form, .login-card, .admin-hero {
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(17, 19, 20, .14);
}
.hero-main {
  background: rgba(255, 255, 255, .76);
  padding: clamp(24px, 4vw, 46px);
  min-height: 565px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}
.hero-main::after {
  content: "ADMIN";
  position: absolute;
  right: -32px;
  top: 42px;
  transform: rotate(12deg);
  font-size: clamp(64px, 10vw, 132px);
  font-weight: 900;
  color: rgba(216, 78, 52, .08);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  padding: 8px 11px;
  background: var(--mint);
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 24px;
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 88px);
  line-height: .98;
}
.hero-copy {
  margin: 24px 0 26px;
  max-width: 700px;
  color: #3d3935;
  font-size: 18px;
  line-height: 1.8;
}
.hero-copy b { color: var(--tomato); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.promise-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 36px;
}
.promise {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px;
  min-height: 96px;
}
.promise strong { display: block; font-size: 26px; color: var(--green); margin-bottom: 5px; }
.promise span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.deal-board {
  background: var(--coal);
  color: var(--white);
  padding: 18px;
  min-height: 565px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.board-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  padding-bottom: 14px;
}
.board-head h2 { margin: 0; font-size: 22px; }
.board-head span, .deal-price b { color: var(--yellow); font-weight: 900; }
.deal-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
}
.deal-item img { width: 108px; height: 108px; object-fit: cover; }
.deal-item h3 { margin: 2px 0 8px; font-size: 17px; line-height: 1.32; }
.deal-data { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid currentColor;
  font-size: 12px;
}
.pill.green { color: #7de0bf; }
.pill.yellow { color: var(--yellow); }
.pill.red { color: #ff8b72; }
.pill.blue { color: #9fc6ef; }
.deal-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.deal-price b { font-size: 24px; }
.deal-price s { color: rgba(255, 255, 255, .5); font-size: 13px; }

section { padding: 66px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 28px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 62px);
  line-height: 1.02;
}
.section-head p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.75; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.filter-btn {
  border: 2px solid var(--ink);
  background: var(--white);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}
.filter-btn.active { background: var(--yellow); box-shadow: 4px 4px 0 rgba(17, 19, 20, .2); }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.product {
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.product-media {
  position: relative;
  border-bottom: 2px solid var(--ink);
  background: var(--wash);
  overflow: hidden;
}
.product-media img { width: 100%; aspect-ratio: 1 / .86; object-fit: cover; }
.discount, .expiry {
  position: absolute;
  border: 2px solid var(--ink);
  font-weight: 900;
  padding: 7px 8px;
  font-size: 12px;
}
.discount { left: 10px; top: 10px; background: var(--tomato); color: var(--white); }
.expiry { right: 10px; bottom: 10px; background: var(--yellow); }
.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}
.product h3 { margin: 0; font-size: 19px; line-height: 1.32; }
.note { color: var(--muted); font-size: 13px; line-height: 1.58; min-height: 62px; }
.date-row, .price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.date-row span { color: var(--muted); font-size: 12px; }
.date-row b { color: var(--green); font-size: 13px; }
.price-row strong { font-size: 24px; color: var(--tomato); }
.price-row s { color: #938981; font-size: 13px; }
.add-btn {
  min-height: 42px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
}
.rules-band {
  background: var(--coal);
  color: var(--white);
  padding: 66px 0;
  margin-top: 20px;
}
.rules-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 44px;
}
.rules-layout h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 1.05;
}
.rules-layout p { margin: 0; color: rgba(255, 255, 255, .72); line-height: 1.8; }
.rule-list { display: grid; gap: 12px; }
.rule {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
}
.rule span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-weight: 900;
}
.rule h3 { margin: 0 0 7px; font-size: 19px; }
.checkout { padding-bottom: 78px; }
.checkout-panel {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: var(--white);
  padding: clamp(24px, 4vw, 42px);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  align-items: center;
}
.checkout-panel h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.02;
}
.checkout-panel p { margin: 0; color: rgba(255, 255, 255, .8); line-height: 1.8; }
.order-box { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .3); padding: 18px; }
.order-box label { display: block; margin-bottom: 8px; color: rgba(255, 255, 255, .75); font-size: 13px; }
.wechat-line { display: flex; align-items: stretch; margin-bottom: 12px; }
.wechat-line input { min-width: 0; width: 100%; border: 0; padding: 12px; background: var(--white); color: var(--ink); font-weight: 900; }
.wechat-line button { border: 0; background: var(--yellow); color: var(--ink); padding: 0 12px; cursor: pointer; font-weight: 900; }
.cart-summary { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .83); font-size: 14px; line-height: 1.6; }
footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: 13px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.empty { color: var(--muted); line-height: 1.7; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(120px);
  background: var(--coal);
  color: var(--white);
  padding: 12px 18px;
  box-shadow: var(--shadow);
  z-index: 50;
  transition: transform .2s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.admin-page {
  background:
    linear-gradient(90deg, rgba(17, 19, 20, .035) 1px, transparent 1px) 0 0 / 48px 48px,
    #f7f3ea;
}
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  background: var(--white);
  padding: 28px;
}
.login-card h1 { font-size: 38px; margin-top: 22px; }
.login-card p { color: var(--muted); line-height: 1.7; }
.login-card label, .product-form label {
  display: grid;
  gap: 8px;
  color: #34302d;
  font-weight: 800;
  margin-top: 14px;
}
.login-card input, .product-form input, .product-form textarea {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px;
}
.product-form textarea { min-height: 92px; resize: vertical; }
.login-card .btn, .login-card .full { width: 100%; margin-top: 14px; }
.error, .notice {
  background: #ffe5df;
  color: #8f2415;
  border: 1px solid #e8a092;
  padding: 12px;
  margin: 12px 0;
}
.notice { background: var(--mint); color: var(--green); border-color: #84b9a8; }
.muted { color: var(--muted); line-height: 1.7; margin: 6px 0 18px; }
.admin-main { padding: 34px 0 76px; }
.admin-hero {
  background: var(--white);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}
.admin-hero h1 { font-size: clamp(36px, 5vw, 62px); }
.admin-hero p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
.admin-stats {
  min-width: 150px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 18px;
  text-align: center;
}
.admin-stats b { display: block; font-size: 42px; }
.table-card, .product-form {
  background: var(--white);
  padding: 18px;
}
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  vertical-align: middle;
}
th { background: var(--wash); font-size: 13px; }
td small { display: block; color: var(--muted); margin-top: 5px; }
.admin-product {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
}
.admin-product img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.state {
  display: inline-block;
  border: 1px solid var(--green);
  color: var(--green);
  background: var(--mint);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.row-actions form, .admin-actions form { margin: 0; }
.product-form { max-width: 980px; }
.settings-form { max-width: none; }
.image-settings { margin-bottom: 22px; }
.image-settings h2,
.settings-group h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.15;
}
.image-preview-grid {
  display: grid;
  grid-template-columns: 180px minmax(220px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.image-preview-grid div {
  display: grid;
  gap: 8px;
}
.image-preview-grid span {
  color: var(--muted);
  font-size: 13px;
}
.image-preview-grid img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper);
}
.image-preview-grid .brand-mark {
  width: 72px;
  height: 72px;
}
.upload-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.settings-group {
  padding: 0 0 24px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.check {
  display: flex !important;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px !important;
}
.check input { width: auto; }
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 1040px) {
  .hero, .rules-layout, .checkout-panel { grid-template-columns: 1fr; }
  .hero-main, .deal-board { min-height: auto; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links { display: none; }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1180px); }
  .top-strip .shell { align-items: flex-start; flex-direction: column; padding: 9px 0; gap: 4px; }
  .nav, .admin-nav { min-height: 66px; }
  .brand { min-width: 0; }
  .brand strong { font-size: 17px; }
  .brand small { display: none; }
  .site-header .btn, .admin-actions .ghost { display: none; }
  h1 { font-size: clamp(40px, 12vw, 58px); }
  .hero { padding-top: 26px; }
  .hero-main { padding: 22px; }
  .hero-copy { font-size: 16px; }
  .promise-row, .product-grid, .form-grid { grid-template-columns: 1fr; }
  .deal-item { grid-template-columns: 88px 1fr; }
  .deal-item img { width: 88px; height: 88px; }
  .section-head { display: block; }
  .section-head p { margin-top: 12px; }
  section { padding: 52px 0; }
  .admin-hero { display: block; }
  .admin-stats { margin-top: 16px; }
  .admin-actions { gap: 8px; }
}
