/* 青野生活 · 示例商城 —— 设计变量与组件 */
:root {
  --paper: #f6f3ec;
  --paper-2: #fbf9f4;
  --ink: #1b1a17;
  --ink-2: #3f3b34;
  --muted: #78716a;
  --line: #e2ddd2;
  --line-strong: #cfc8ba;
  --accent: #2f5d47;
  --accent-2: #3f7459;
  --accent-soft: #e8efe9;
  --warm: #b96a3f;
  --danger: #a63a31;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(35, 30, 22, .06);
  --shadow-lg: 0 24px 60px rgba(35, 30, 22, .12);
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 243, 236, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 26px;
  height: 68px;
}
.brand { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: .16em; white-space: nowrap; }
.brand-en { font: 10px/1 var(--mono); letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; padding: 7px 12px; border-radius: 8px; font-size: 13.5px;
  color: var(--ink-2); transition: background .16s, color .16s;
}
.nav a:hover { background: #eee9de; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 93, 71, .1); }
.search input { border: 0; outline: 0; background: transparent; width: 132px; font-size: 13px; }
.search svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.8; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  background: var(--paper-2); cursor: pointer; font-size: 13px; color: var(--ink-2);
  transition: border-color .16s, color .16s, background .16s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font: 11px/18px var(--mono); text-align: center;
}

/* ---------- 首页 ---------- */
.hero { padding: 58px 0 30px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 44px; align-items: center; }
.eyebrow { font: 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.hero h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.22; letter-spacing: .02em; margin: 18px 0 16px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 460px; color: var(--muted); font-size: 15px; }
.hero-cta { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.hero-facts { display: flex; gap: 26px; margin-top: 38px; flex-wrap: wrap; }
.fact b { display: block; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.fact span { font-size: 12px; color: var(--muted); }

.hero-visual { position: relative; display: grid; gap: 14px; }
.hero-card {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .5);
}
.hero-card.big { aspect-ratio: 4 / 3; }
.hero-card.small { position: absolute; right: -10px; bottom: -22px; width: 156px; aspect-ratio: 1; box-shadow: var(--shadow-lg); }

/* ---------- 商品视觉占位 ---------- */
.visual {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(255, 255, 255, .55), transparent 58%),
    linear-gradient(148deg, var(--c1, #dfd7c9) 0%, var(--c2, #b3a892) 100%);
}
.visual.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visual.photo::after { display: none; }
.visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px);
  background-size: 4px 4px; opacity: .5; mix-blend-mode: multiply;
}
.visual .glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: clamp(44px, 5.2vw, 74px); color: rgba(38, 32, 24, .6);
  letter-spacing: .1em; text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
.visual .corner {
  position: absolute; left: 12px; top: 10px;
  font: 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(38, 32, 24, .62); text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

/* ---------- 分类条 ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 46px 0 20px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 25px; margin: 0; letter-spacing: .04em; }
.section-head .hint { font-size: 12.5px; color: var(--muted); }
.cats { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; }
.cat {
  flex: none; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: all .16s;
}
.cat:hover { border-color: var(--line-strong); }
.cat.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 商品网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 22px; }
.card { display: block; cursor: pointer; }
.card .thumb {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5;
  box-shadow: var(--shadow); transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover .thumb { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .badge {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 9px; border-radius: 999px;
  background: rgba(27, 26, 23, .72); color: #f4f1ea; font: 10.5px/1 var(--mono); letter-spacing: .1em;
}
.card .meta { padding: 12px 2px 0; }
.card h3 { margin: 0; font-size: 14.5px; font-weight: 500; letter-spacing: .01em; }
.card .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.price { font-family: var(--serif); font-size: 17px; }
.price .cur { font-size: 12px; margin-right: 1px; color: var(--muted); }
.stock-hint { font-size: 11.5px; color: var(--muted); }

/* ---------- 详情页 ---------- */
.crumbs { font-size: 12px; color: var(--muted); padding: 22px 0 0; }
.crumbs span { margin: 0 6px; }
.detail { display: grid; grid-template-columns: 1.02fr .98fr; gap: 42px; padding: 22px 0 40px; }
.gallery { display: grid; gap: 12px; }
.gallery .main { border-radius: 18px; overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow); }
.gallery .thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery .thumbs .visual { aspect-ratio: 1; border-radius: 12px; }
.gallery .thumbs > div { aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }

.detail h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 8px 0 6px; letter-spacing: .02em; }
.detail .subtitle { color: var(--muted); font-size: 13.5px; }
.detail .price-line { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 4px; }
.detail .price-line .price { font-size: 27px; color: var(--accent); }
.detail .price-line .tail { font-size: 12px; color: var(--muted); }
.spec-group { margin-top: 22px; }
.spec-group .label { font-size: 12px; color: var(--muted); margin-bottom: 9px; letter-spacing: .06em; }
.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2);
  cursor: pointer; font-size: 13px; transition: all .14s;
}
.opt:hover { border-color: var(--line-strong); }
.opt.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.opt.disabled { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

.buy-row { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--paper-2); }
.qty button { width: 36px; height: 42px; border: 0; background: transparent; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.qty button:hover { background: #eee9de; }
.qty span { min-width: 40px; text-align: center; font: 14px/1 var(--mono); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; font-size: 14px; letter-spacing: .02em; transition: all .16s; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: #f7f4ec; }
.btn.primary:hover { background: #274d3b; }
.btn.warm { background: var(--warm); color: #fff8f2; }
.btn.warm:hover { background: #a55c34; }
.btn.ghost { background: var(--paper-2); border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--line-strong); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 8px; }

.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.svc { display: grid; gap: 10px; margin-top: 24px; font-size: 12.5px; color: var(--muted); }
.svc div { display: flex; gap: 8px; align-items: center; }
.svc i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 26px; }
.spec-table td { padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table td:first-child { width: 96px; color: var(--muted); }
.desc { margin-top: 24px; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; line-height: 1.85; }
h3.block-title { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 34px 0 4px; letter-spacing: .04em; }

/* ---------- 购物车 / 结算 ---------- */
.page-title { font-family: var(--serif); font-weight: 500; font-size: 28px; padding: 30px 0 6px; letter-spacing: .03em; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding-bottom: 50px; align-items: start; }
.line {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; padding: 18px 0;
  border-bottom: 1px solid var(--line); align-items: center;
}
.line .thumb { width: 92px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.line h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: 500; }
.line .spec { font-size: 12px; color: var(--muted); }
.line .ops { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.line .link { font-size: 12px; color: var(--muted); cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.line .link:hover { color: var(--danger); }

.summary { position: sticky; top: 88px; }
.summary .row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; color: var(--ink-2); }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; font-size: 15px; }
.summary .row.total .price { font-size: 22px; color: var(--accent); }
.summary .note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }

.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.field input, .field select, .field textarea {
  height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-2); outline: 0; transition: border-color .16s, box-shadow .16s;
}
.field textarea { height: 88px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 93, 71, .1); }

.pay-methods { display: grid; gap: 10px; }
.pay-method {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); cursor: pointer;
}
.pay-method.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-method b { font-weight: 500; font-size: 14px; }
.pay-method small { color: var(--muted); font-size: 11.5px; }
.dot { width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 50%; position: relative; flex: none; }
.pay-method.on .dot { border-color: var(--accent); }
.pay-method.on .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }

/* ---------- 订单 ---------- */
.order {
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2);
  margin-bottom: 14px; overflow: hidden;
}
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #f2eee5; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.order-head .no { font-family: var(--mono); color: var(--ink-2); }
.badge-status { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line-strong); color: var(--ink-2); background: #fff; }
.badge-status.pending { color: var(--warm); border-color: #e3c4ae; background: #fdf1e7; }
.badge-status.paid { color: #2f6ea8; border-color: #bcd3e8; background: #eef6fd; }
.badge-status.shipped { color: var(--accent); border-color: #c2d7c8; background: var(--accent-soft); }
.badge-status.completed { color: #5b6b5a; border-color: #ccd4c9; background: #eef1ec; }
.badge-status.canceled { color: #8a8580; border-color: var(--line); background: #f3f1ec; }
.order-body { padding: 6px 18px 14px; }
.order-item { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.order-item:last-child { border-bottom: 0; }
.order-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.order-foot .actions { display: flex; gap: 9px; flex-wrap: wrap; }
.addr { font-size: 12.5px; color: var(--muted); padding: 6px 18px 0; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(24, 22, 18, .5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 60;
}
.modal {
  width: min(430px, 100%); background: var(--paper-2); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 26px; position: relative;
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 4px; }
.modal p.sub { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.modal .close { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(27, 26, 23, .9); color: #f4f1ea; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; z-index: 70; animation: rise .18s ease;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px) } to { opacity: 1; transform: translate(-50%, 0) } }

.empty { text-align: center; padding: 76px 0; color: var(--muted); }
.empty .big { font-family: var(--serif); font-size: 21px; color: var(--ink-2); margin-bottom: 8px; }

/* ---------- 后台 ---------- */
.admin-top { display: flex; gap: 10px; align-items: center; margin: 22px 0 6px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 500; }
.stat span { font-size: 12px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 11.5px; letter-spacing: .06em; }
.tbl input { height: 32px; width: 76px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 34px 0 46px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
.footer h4 { margin: 0 0 10px; font-size: 13px; font-weight: 500; letter-spacing: .08em; }
.footer p, .footer a { font-size: 12px; color: var(--muted); margin: 0 0 5px; display: block; }
.footer .copy { margin-top: 26px; font-size: 11.5px; color: #9a938a; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 40px; }
  .hero-visual { order: -1; }
  .hero-card.big { aspect-ratio: 16 / 10; }
  .hero-card.small { display: none; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .topbar-inner { gap: 14px; }
  .search input { width: 88px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 8px; height: 60px; }
  .brand-name { font-size: 19px; letter-spacing: .08em; }
  .search { flex: 1; min-width: 0; height: 34px; padding: 0 10px; gap: 6px; }
  .search input { width: 100%; min-width: 0; font-size: 12.5px; }
  .search input::placeholder { font-size: 12px; }
  .icon-btn { height: 34px; padding: 0 9px; font-size: 12.5px; gap: 4px; }
  .hero { padding-top: 24px; gap: 20px; }
  .hero-card.big { aspect-ratio: 4 / 3; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .nav { display: none; }
  .brand-en { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .line { grid-template-columns: 70px 1fr; }
  .line .ops { grid-column: 1 / -1; justify-content: space-between; }
  .form .two { grid-template-columns: 1fr; }
}
