/* Friendly store: the same controls and workflows, with a lighter visual language. */
:root {
  --primary: #58cc02;
  --primary-dark: #347800;
  --ink: #3c3c3c;
  --muted: #737b70;
  --line: #e5e8e1;
  --bg: #fff;
  --card: #fff;
  --ok: #347800;
  --warn: #9b6500;
  --danger: #c83640;
  --radius: 20px;
  --shadow: 0 4px 0 #e5e8e1;
  /* 主色系配套色：抽成变量，会员主题只换这一组即可整体变色 */
  --primary-border: #46a302;
  --primary-hover: #66d710;
  --primary-ink: #244e00;
  --primary-soft: #f6faef;
  --primary-line: #b6d895;
  --primary-ring: #d4e9bd;
  --primary-tint: #f7fdf0;
  --primary-tint-strong: #f1fce5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; padding-left: 228px; min-height: 100vh;
  display: flex; flex-direction: column;
  font-family: "Nunito", "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #1687bc; outline-offset: 4px; }
main:focus { outline: none; }
.container { width: 100%; max-width: 1190px; margin: 0 auto; padding: 0 38px; }
main.container { flex: 1; min-width: 0; }
.skip-link { position: fixed; top: -80px; left: 244px; z-index: 300; background: #fff; padding: 14px 20px; border: 2px solid #1687bc; border-radius: 12px; }
.skip-link:focus { top: 12px; }

/* ---------- Navigation ---------- */
.topbar {
  position: fixed; top: 0; bottom: 0; left: 0; width: 228px; z-index: 50;
  display: flex; flex-direction: column; align-items: stretch; gap: 28px;
  padding: 30px 18px; background: #fff; border-right: 2px solid var(--line);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 7px; }
.brand-mark { width: 52px; height: 52px; object-fit: contain; }
.brand-text { font-weight: 900; font-size: 25px; line-height: 1.15; color: var(--primary-dark); letter-spacing: -.7px; }
.brand-text small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 1px; margin-top: 7px; }
.nav { display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 800; }
.nav a { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 12px 15px; border: 2px solid transparent; border-radius: 14px; color: #6c7469; }
.nav a:hover { background: #f6f8f3; }
.nav a.active { background: var(--primary-tint-strong); border-color: var(--primary-line); color: var(--primary-dark); }
.nav-icon { width: 25px; height: 25px; flex-shrink: 0; color: #8eaa74; }
.nav a.active .nav-icon { color: #4ca900; }
.nav .nav-admin { margin-top: 15px; font-size: 13px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.nav .nav-admin .nav-icon { width: 21px; height: 21px; }
.admin-tag { color: var(--ok); background: var(--primary-tint-strong); padding: 10px 15px; border-radius: 12px; }
.account-slot { border-top: 2px solid var(--line); padding-top: 20px; }
.account-slot #authArea { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.account-slot #authArea > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 800; padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; }
.account-slot #authArea > a:first-child { flex: 1; color: #1485b6; background: #eaf7ff; border-color: #bce6fa; }
.admin-view .account-slot { display: none; }
.sidebar-foot { position: fixed; left: 20px; bottom: 25px; width: 188px; z-index: 51; font-size: 12px; }
.sidebar-note { font-weight: 700; color: #7e8876; margin-bottom: 14px; line-height: 1.8; }
.badge { display: inline-block; min-width: 20px; padding: 2px 7px; font-size: 11px; text-align: center; background: var(--primary); color: #274e00; border-radius: 999px; }

/* ---------- 通用 ---------- */
.loading, .empty { padding: 60px 0; text-align: center; color: var(--muted); }
.page { padding: 36px 0 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-dark); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.btn-primary { background: var(--primary); border-color: var(--primary-border); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-border); color: var(--primary-ink); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #f0c5c8; }
.btn-danger:hover { background: #fff0f1; border-color: #e58c93; color: #a32029; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 12px; border-radius: 12px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; font-size: 14px; font-family: inherit;
  border: 2px solid var(--line); border-radius: 12px; background: #f8faf6; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: #74bc3e; background: #fff; }
input[type="checkbox"], input[type="radio"] { min-height: auto; accent-color: #4ca600; }
input::placeholder, textarea::placeholder { color: #838b7e; }
label.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.field span { display: block; margin-bottom: 5px; }

/* ---------- Welcome and catalogue ---------- */
.home-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: #86957c; font-size: 10px; font-weight: 900; letter-spacing: 2px; }
.home-heading h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.home-order-link { font-size: 13px; font-weight: 800; color: #1485b6; white-space: nowrap; }
.home-order-link span { margin-left: 8px; }
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 32px; padding: 28px 34px; border: 2px solid var(--primary-line); border-bottom-width: 5px; border-radius: 24px; background: var(--primary-tint-strong); overflow: hidden; }
.hero-copy { position: relative; z-index: 1; }
.hero-label { color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.hero h2 { margin: 12px 0; font-size: clamp(26px, 2.7vw, 36px); font-weight: 900; line-height: 1.4; letter-spacing: -.6px; color: #315518; }
.hero p { margin: 0; color: #657e51; font-size: 13px; line-height: 1.8; }
.hero-art { width: 230px; flex-shrink: 0; position: relative; text-align: center; padding-top: 20px; }
.hero-art img { width: 100%; height: auto; display: block; }
.cow-greeting { display: inline-block; position: absolute; top: 0; right: 8px; padding: 8px 12px; border: 2px solid #c6e5a7; border-radius: 14px 14px 14px 3px; background: #fff; font-size: 11px; font-weight: 800; color: #56862d; transform: rotate(4deg); }
.journey { display: flex; gap: 20px; padding: 0; margin: 23px 0 0; list-style: none; counter-reset: journey; }
.journey li { display: flex; align-items: center; gap: 7px; color: #4c6b34; font-size: 11px; font-weight: 700; counter-increment: journey; }
.journey li::before { content: counter(journey); display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #fff; border: 1.5px solid #c2dfaa; color: #4a810f; font-size: 11px; font-weight: 900; }
.catalog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.catalog-heading h2 { margin: 0; font-size: 20px; font-weight: 900; }
.catalog-heading > span { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.home-page .toolbar { flex-wrap: nowrap; }
.search-wrap { display: flex; flex: 1; min-width: 0; position: relative; }
.search-wrap .search { padding-left: 43px; }
.search-icon { position: absolute; left: 16px; top: 6px; font-size: 27px; line-height: 32px; color: #85917a; pointer-events: none; }
.search { flex: 1; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 42px; padding: 8px 18px; font-size: 13px; font-weight: 800; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); }
.chip:hover { background: #f7faef; }
.chip.active { background: #eaf7ff; border-color: #b5e1f7; color: #117ea9; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product { min-width: 0; background: #fff; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.product:hover { transform: translateY(-3px); border-color: #acd77d; }
.product:active { transform: translateY(1px); }
.product-cover { height: 135px; position: relative; display: flex; align-items: center; justify-content: center; font-size: 55px; border-bottom: 2px solid #f1f3ee; }
.product-cover > span:first-child { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 25px; background: #ffffffb3; transform: rotate(-6deg); }
.product-type { position: absolute; top: 10px; left: 10px; padding: 4px 8px; border-radius: 7px; background: #ffffffd9; color: #647456; font-size: 10px; font-weight: 800; }
.product-body { padding: 19px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.product-name { font-size: 18px; font-weight: 900; line-height: 1.5; }
.product-desc { font-size: 12px; color: var(--muted); line-height: 1.7; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.price { color: var(--primary-dark); font-weight: 900; font-size: 21px; }
.price small { font-size: 13px; font-weight: 700; margin-right: 2px; }
.stock { font-size: 11px; color: var(--muted); }
.product-cta { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; padding-top: 13px; border-top: 2px solid #f1f3ee; color: #4d841d; font-size: 12px; font-weight: 800; }
.product-cta span { font-size: 18px; }

.detail { display: grid; grid-template-columns: 320px 1fr; gap: 28px; }
.detail-cover { height: 300px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 130px; }
.detail h1 { margin: 0 0 10px; font-size: 26px; }
.detail .price { font-size: 30px; }
.qty { display: flex; align-items: center; gap: 0; width: 130px; }
.qty button { width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }
.qty button:first-child { border-radius: 8px 0 0 8px; }
.qty button:last-child { border-radius: 0 8px 8px 0; }
.qty input { width: 56px; text-align: center; border-radius: 0; border-left: none; border-right: none; }

/* ---------- 购物车 / 订单 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.table td.num, .table th.num { text-align: right; }
.cart-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-emoji { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.cart-name { flex: 1; font-size: 14px; font-weight: 600; }
.cart-total { text-align: right; padding-top: 16px; font-size: 15px; }
.cart-total b { color: var(--primary-dark); font-size: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.status-pill.upstream-up { color:#13795b; background:#e7f8f1; }
.status-pill.upstream-down { color:#b42318; background:#feeceb; }
.status-pill.upstream-idle { color:#667085; background:#f2f4f7; }
.s-pending { background: #fff4e5; color: #b45309; }
.s-paid { background: #e0f2fe; color: #0369a1; }
.s-shipped { background: #ede9fe; color: #6d28d9; }
.s-done { background: #dcfce7; color: #15803d; }
.s-canceled { background: #f1f3f6; color: #6b7684; }

/* ---------- 后台 ---------- */
.login-box { max-width: 380px; margin: 70px auto; }
.login-box h2 { margin: 0 0 6px; }
.login-box .hint { font-size: 12px; color: var(--muted); margin: 0 0 18px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs button {
  padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.tabs button.active { color: var(--primary-dark); border-bottom-color: var(--primary-dark); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; }

.tool-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tool-row .grow { flex: 1; min-width: 160px; }

.modal { position: fixed; inset: 0; background: rgba(20, 24, 33, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; padding: 24px; }
.modal-box h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 14px; z-index: 200; box-shadow: var(--shadow);
}

.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 12px; text-align: center; background: #fff; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; gap: 12px; }
  .nav { gap: 12px; font-size: 13px; }
  .brand-text small { display: none; }
  .detail { grid-template-columns: 1fr; }
  .detail-cover { height: 200px; font-size: 90px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 24px; }
}

/* ---------- Pro 新增：表单/订单/卡密/个人中心 ---------- */
.form-row { margin-bottom: 14px; }
.form-row > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.auth-box { max-width: 400px; margin: 60px auto; }
.auth-box h2 { margin: 0 0 6px; }
.auth-box .hint { font-size: 12px; color: var(--muted); margin: 0 0 18px; line-height: 1.7; }
.auth-switch { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--primary-dark); font-weight: 600; }

.user-menu { position: relative; }
.user-menu > button { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 600; padding: 6px 2px; }
.user-dropdown { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 130px; padding: 6px; z-index: 60; }
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 13px; border: none; background: none; cursor: pointer; border-radius: 6px; color: var(--ink); }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); }

.order-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.order-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--muted); }
.order-items { font-size: 14px; line-height: 1.9; }
.order-items .row { display: flex; justify-content: space-between; gap: 10px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }

.card-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.card-key { background: #f5fce9; border: 1px dashed var(--primary); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-key button { border: none; background: none; color: var(--primary-dark); cursor: pointer; font-size: 12px; }

.pay-panel { background: linear-gradient(120deg, var(--primary-tint-strong), #fff); border: 1px solid var(--primary-ring); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.pay-panel .amount { font-size: 26px; font-weight: 700; color: var(--primary-dark); }

.notice-list { display: grid; gap: 14px; }
.notice-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.notice-item h3 { margin: 0 0 6px; font-size: 16px; }
.notice-item time { font-size: 12px; color: var(--muted); }
.notice-pin { font-size: 11px; background: var(--primary); color: var(--primary-ink); border-radius: 999px; padding: 2px 8px; margin-right: 8px; }

.article { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; line-height: 1.9; font-size: 15px; }

.me-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.me-side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.me-side .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 10px; }
.me-side .mail { font-size: 13px; color: var(--muted); word-break: break-all; }
.me-menu { margin-top: 14px; display: grid; gap: 4px; }
.me-menu a { padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.me-menu a.active { background: var(--primary-tint-strong); color: var(--primary-dark); font-weight: 600; }

.steps { display: flex; gap: 8px; align-items: center; margin: 20px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.steps b { color: var(--primary-dark); }
.steps .sep { color: var(--line); }

@media (max-width: 720px) {
  .me-grid { grid-template-columns: 1fr; }
}

/* ---------- 购物车 / 统一结算 ---------- */
.nav-cart { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.cart-badge {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 5px;
  font-style: normal; font-size: 11px; font-weight: 600; line-height: 17px;
  text-align: center; background: var(--primary); color: var(--primary-ink); border-radius: 999px;
}
.cart-badge[hidden] { display: none; }
.nav .nav-cart.active .cart-badge { background: var(--primary-dark); }

.cart-line {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.cart-line:last-child { border-bottom: none; }
.cart-line-main { flex: 1; min-width: 180px; }
.cart-line-name { font-size: 14px; font-weight: 600; line-height: 1.5; }
.cart-line-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.cart-line-price { min-width: 84px; text-align: right; font-weight: 600; }
.cart-line-dead { color: var(--muted); text-decoration: line-through; }
.cart-line .qty { width: 118px; }
.cart-line .qty button { width: 32px; height: 32px; }
.cart-line .qty input { width: 50px; padding: 6px 4px; }

.cart-summary {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; padding-top: 16px; margin-top: 6px;
  border-top: 1px solid var(--line);
}
.cart-summary .price { font-size: 24px; }

.course-block {
  border: 1px solid var(--primary-ring); background: var(--primary-tint);
  border-radius: var(--radius); padding: 16px; margin: 14px 0;
}
.course-block h4 { margin: 0 0 8px; font-size: 15px; }
.course-block .btn { margin-top: 4px; }
.course-hint { font-size: 12px; color: var(--muted); margin: 6px 0 12px; line-height: 1.7; }
.course-options label { display: block; margin: 8px 0; font-size: 14px; line-height: 1.6; }
.course-options input { width: auto; margin-right: 8px; }

@media (max-width: 720px) {
  .cart-line { align-items: flex-start; }
  .cart-line-price { min-width: 0; text-align: left; }
  .cart-summary .price { font-size: 20px; }

  /* 触控目标统一抬到 44pt：视觉尺寸不变，只扩热区 */
  .btn-sm { padding: 11px 14px; font-size: 13px; min-height: 44px; }
  .qty { width: 132px; }
  .qty button { width: 44px; height: 44px; }
  .cart-line .qty { width: 138px; }
  .cart-line .qty button { width: 44px; height: 44px; }
  .cart-line .qty input { min-height: 44px; }
  .card-key button { min-height: 44px; padding: 0 8px; }
  .step { padding: 5px 12px; }
}

/* ---------- 课程需求提交 ---------- */
.request-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--primary-ring); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.request-banner b { font-size: 15px; }
.request-item { padding: 12px 0; border-top: 1px dashed var(--line); }
.request-item:first-of-type { border-top: none; padding-top: 0; }
.request-reply { background: #f5fce9; border-left: 3px solid var(--primary); padding: 8px 10px; border-radius: 6px; margin-top: 6px; }
.form-row em { color: var(--danger); font-style: normal; }

/* ---------- 客服入口（全站可见） ---------- */
.support-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-label { font-size: 12px; color: var(--muted); }
.support-bar .btn { white-space: nowrap; }
.support-bar a.btn { color: var(--primary-ink); }

/* ---------- 登录方式切换 ---------- */
.auth-tabs { display: flex; gap: 6px; margin: 4px 0 16px; border-bottom: 1px solid var(--line); }
.auth-tabs .auth-tab {
  padding: 9px 14px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 14px; cursor: pointer; min-height: 44px;
}
.auth-tabs .auth-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary-dark); font-weight: 600; }

/* ---------- 订单处理进度 ---------- */
.prog-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.prog-title h3 { margin: 0; }
.prog-item { border-top: 1px dashed var(--line); padding: 12px 0; }
.prog-item:first-of-type { border-top: none; padding-top: 0; }
.prog-item:last-of-type { padding-bottom: 0; }
.prog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prog-name { font-size: 14px; font-weight: 600; }
.prog-line { font-size: 13px; line-height: 1.85; color: #3d4756; word-break: break-word; }
.prog-line b { font-weight: 600; color: var(--ink); }
.prog-line.page-sub { color: var(--muted); font-size: 12px; }
.step-track { display: flex; gap: 6px; margin: 9px 0 6px; flex-wrap: wrap; }
.step { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: #f1f3f6; color: #4a5463; }
.step.on { background: var(--primary-dark); color: #fff; font-weight: 600; }
.order-items .row { align-items: center; gap: 8px; }
.order-items .row .status-pill { margin-left: 4px; white-space: nowrap; }

/* ---------- Shared finishing and responsive shell ---------- */
.page-title { font-weight: 900; }
.page-sub { line-height: 1.8; }
.tabs, .auth-tabs { overflow-x: auto; scrollbar-width: thin; }
.tabs button, .auth-tabs .auth-tab { min-height: 46px; flex-shrink: 0; font-weight: 700; }
.tabs button.active, .auth-tabs .auth-tab.active { color: var(--primary-dark); border-color: var(--primary-dark); }
.order-card, .notice-item, .article, .stat, .me-side { border: 2px solid var(--line); box-shadow: var(--shadow); }
.status-pill { font-weight: 700; }
.step-track { gap: 7px; margin: 14px 0; }
.step { border: 2px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fafbf8; }
.step.on { border-color: var(--primary-line); background: var(--primary-tint-strong); color: var(--primary-dark); }
.request-banner { margin: 30px 0 0; border: 2px dashed #d7e5cb; border-radius: 18px; background: #fcfef9; padding: 20px; box-shadow: none; flex-wrap: nowrap; }
.request-banner > div { flex: 1; }
.request-banner b { font-size: 14px; }
.request-banner .page-sub { margin: 5px 0 0; font-size: 12px; }
.request-banner .btn { white-space: nowrap; }
.request-icon { display: grid; place-items: center; flex-shrink: 0; width: 43px; height: 43px; border-radius: 14px; background: #eaf7ff; color: #1687bc; font-size: 26px; }
.support-bar { gap: 10px; }
.support-label { width: 100%; font-weight: 800; font-size: 12px; }
.support-bar .page-sub { font-size: 10px; }
.auth-box { position: relative; margin: 45px auto; max-width: 440px; padding: 30px; }
.auth-box::before { content: ''; display: block; width: 100px; height: 92px; margin: 0 auto 15px; background: url('../img/niuniu.svg') center / contain no-repeat; }
.auth-box h2 { text-align: center; font-size: 23px; font-weight: 900; margin-bottom: 20px; }
.auth-tabs .auth-tab { flex: 1; }
.qty button { min-width: 40px; min-height: 44px; border: 2px solid var(--line); color: #526547; font-weight: 800; }
.qty input { min-height: 44px; }
.user-menu { min-width: 0; width: 100%; }
.user-menu > button { width: 100%; min-height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.user-dropdown { min-width: 160px; border-width: 2px; box-shadow: 0 5px 0 #e5e8e1; }
.user-dropdown a, .user-dropdown button { min-height: 44px; }
.toast { border-radius: 14px; padding: 14px 22px; font-weight: 700; }
.footer { margin-top: 15px; border-top: 2px solid #f0f2ec; background: #fcfdfb; font-size: 11px; }
.table td, .prog-line, .order-no { overflow-wrap: anywhere; }
@media (max-height: 760px) and (min-width: 1101px) {
  .sidebar-note { display: none; }
  .sidebar-foot { position: static; width: auto; margin: 0 38px 20px; }
  .sidebar-foot .support-label { width: auto; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  body { padding-left: 88px; }
  .topbar { width: 88px; padding: 24px 10px; gap: 24px; }
  .brand { justify-content: center; }
  .brand-text, .nav a > span, .nav-admin > span { display: none; }
  .nav a { justify-content: center; padding: 12px; }
  .account-slot #authArea { flex-direction: column; font-size: 11px; }
  .account-slot #authArea > a { padding: 8px; width: 100%; }
  .sidebar-foot { position: static; width: auto; margin: 0 38px 22px; }
  .sidebar-note { display: none; }
  .support-bar .support-label { width: auto; }
  .support-bar .page-sub { flex-basis: 100%; font-size: 11px; }
  .hero-art { width: 180px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-badge { position: absolute; top: 2px; right: 1px; }
  .user-dropdown { position: static; min-width: 0; width: 100%; margin-top: 6px; box-shadow: none; }
  .user-dropdown a, .user-dropdown button { padding: 8px 4px; font-size: 11px; word-break: keep-all; }
  .skip-link { left: 100px; }
}
@media (max-width: 720px) {
  body { padding: 76px 0 calc(80px + env(safe-area-inset-bottom)); }
  .container { padding: 0 18px; }
  .page { padding: 25px 0 36px; }
  .topbar { bottom: auto; width: 100%; height: 76px; padding: 10px 16px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; border-right: 0; border-bottom: 2px solid var(--line); overflow: visible; }
  .brand { gap: 5px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-text { font-size: 20px; }
  .brand-text small { display: none; }
  #storeNav { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 7px 9px calc(7px + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--line); }
  #storeNav > a { min-height: 58px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 4px; font-size: 10px; border-radius: 12px; }
  #storeNav .nav-icon { width: 23px; height: 23px; }
  #storeNav .nav-admin { position: fixed; top: 17px; right: 88px; width: 42px; min-height: 42px; margin: 0; padding: 9px; border: 0; border-radius: 10px; }
  #storeNav .nav-admin span { display: none; }
  .account-slot { border: 0; padding: 0; margin: 0; max-width: 72px; }
  .account-slot #authArea > a { padding: 8px 12px; font-size: 12px; }
  .account-slot #authArea > a + a { display: none; }
  .account-slot .user-menu > button { max-width: 72px; font-size: 12px; }
  .cart-badge { position: absolute; top: 1px; left: 56%; right: auto; }
  #adminNav { flex-direction: row; align-items: center; gap: 7px; font-size: 11px; }
  #adminNav a { padding: 8px; min-height: 44px; }
  #adminNav .admin-tag { display: none; }
  .home-heading { margin-bottom: 20px; gap: 8px; }
  .home-heading h1 { font-size: 21px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.8px; }
  .home-order-link { font-size: 11px; }
  .hero { display: block; padding: 22px; margin-bottom: 27px; border-radius: 20px; }
  .hero h2 { margin: 17px 0 12px; font-size: 25px; }
  .hero p { font-size: 12px; }
  .hero-label { font-size: 10px; }
  .hero-art { position: absolute; top: 10px; right: 10px; padding: 0; width: 68px; }
  .cow-greeting { display: none; }
  .journey { gap: 12px; flex-wrap: wrap; margin-top: 20px; }
  .journey li { font-size: 10px; gap: 5px; }
  .journey li::before { width: 21px; height: 21px; }
  .catalog-heading h2 { font-size: 18px; }
  .catalog-heading > span { font-size: 10px; }
  .toolbar .btn { padding: 10px 16px; }
  .lookup-fields { display: grid; grid-template-columns: minmax(0, 1fr); }
  .chips { gap: 7px; }
  .chip { min-height: 44px; font-size: 12px; padding: 8px 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product { border-radius: 16px; }
  .product-cover { height: 108px; font-size: 40px; }
  .product-cover > span:first-child { width: 65px; height: 65px; border-radius: 18px; }
  .product-type { top: 6px; left: 6px; font-size: 8px; padding: 3px 6px; }
  .product-body { padding: 12px; gap: 7px; }
  .product-name { font-size: 16px; }
  .product-desc { font-size: 11px; min-height: 36px; }
  .product-meta { flex-wrap: wrap; gap: 4px; }
  .price { font-size: 18px; }
  .stock { font-size: 10px; }
  .product-cta { font-size: 11px; padding-top: 9px; }
  .request-banner { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .request-banner > div { min-width: 200px; }
  .request-banner .btn { width: 100%; }
  .request-icon { width: 34px; height: 34px; border-radius: 11px; }
  .request-banner .page-sub { font-size: 11px; }
  .sidebar-foot { position: static; width: auto; margin: 0 18px 20px; }
  .sidebar-note { display: none; }
  .support-bar .page-sub { flex-basis: 100%; font-size: 11px; text-align: center; }
  .support-bar { justify-content: center; }
  .support-bar .support-label { width: auto; }
  .auth-box { margin: 6px auto; padding: 24px 20px; }
  .auth-box h2 { font-size: 21px; }
  .page-title { font-size: 23px; }
  .detail { gap: 20px; }
  .detail-cover { height: 190px; }
  .table { display: block; overflow-x: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cart-line-main { min-width: 140px; }
  .steps { line-height: 1.8; }
  .toast { max-width: calc(100% - 36px); width: max-content; bottom: calc(90px + env(safe-area-inset-bottom)); text-align: center; }
  .skip-link { left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .product:hover, .btn:active { transform: none; }
}

.membership-card { max-width: 760px; background: var(--primary-tint); }
.membership-card h2 { margin: 12px 0; font-size: 28px; }
.membership-card > .price { margin: 14px 0; font-size: 36px; }
.membership-rules { padding-left: 22px; line-height: 1.9; font-size: 14px; }
.membership-rules li { margin: 9px 0; }
.membership-choice { display: flex; align-items: flex-start; gap: 10px; padding: 15px; margin: 16px 0; border: 2px solid var(--primary-line); border-radius: 12px; background: var(--primary-tint-strong); font-size: 14px; line-height: 1.7; cursor: pointer; }
.membership-choice input { width: 20px; height: 20px; flex-shrink: 0; padding: 0; margin: 2px 0 0; }
.course-options input:disabled { cursor: not-allowed; }

/* ---------- 首页会员宣传位 ---------- */
.member-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: 26px 0 10px; padding: 24px 26px;
  border: 2px solid var(--primary-line); border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-tint-strong) 0%, #fbfef7 60%, #ffffff 100%);
  box-shadow: 0 10px 26px rgba(84, 130, 46, .12);
}
.member-promo-copy { flex: 1 1 320px; min-width: 0; }
.member-promo-copy h2 { margin: 8px 0 10px; font-size: 22px; color: var(--primary-dark); }
.member-promo-points { margin: 0; padding-left: 20px; line-height: 1.85; font-size: 14px; color: #3c4a33; }
.member-promo-points li { margin: 4px 0; }
.member-promo-side {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  flex: 0 1 auto; padding-left: 22px; border-left: 1px dashed #cfe3b8;
}
.member-promo-side .page-sub { margin: 0; }
.member-promo-price { color: var(--primary-dark); font-weight: 900; font-size: 30px; line-height: 1.1; }
.member-promo-price small { font-size: 12px; font-weight: 700; color: var(--muted); }
.member-promo-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #2f6b1f; color: #fff; font-size: 12px; font-weight: 800;
}
.member-promo-muted { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.member-promo-muted h2 { color: var(--muted); }

@media (max-width: 720px) {
  .member-promo { padding: 18px; gap: 16px; }
  .member-promo-copy h2 { font-size: 19px; }
  .member-promo-side { flex: 1 1 100%; padding-left: 0; padding-top: 14px; border-left: none; border-top: 1px dashed #cfe3b8; }
  .member-promo-price { font-size: 26px; }
}


/* ==========================================================================
   会员主题（多邻国 Super 紫）
   免费用户是品牌绿（多邻国基础色），成为会员后整体切成 Super 紫。
   只覆盖配色变量，所有组件自动跟随；状态色（--ok/--warn/--danger）不动，
   避免把"成功/警告"的语义也染色。
   ========================================================================== */
body.is-member {
  --primary: #ce82ff;
  --primary-dark: #8549ba;
  --primary-border: #a560e8;
  --primary-hover: #dda3ff;
  --primary-ink: #3f1a63;
  --primary-soft: #faf3ff;
  --primary-line: #cfa2ea;
  --primary-ring: #e3cdf5;
  --primary-tint: #f9f1ff;
  --primary-tint-strong: #f2e4fd;
  --line: #ece2f5;
  --shadow: 0 4px 0 #ece2f5;
}

/* 会员徽章（顶栏） */
.member-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  background: linear-gradient(135deg, #ce82ff, #a560e8);
  color: #fff; font-size: 12px; font-weight: 900; letter-spacing: .3px;
  border: 2px solid #8f47c9; border-bottom-width: 3px;
  white-space: nowrap;
}
.member-badge .crown { font-size: 13px; line-height: 1; }

/* 会员态下首页宣传位不再劝购，改成"已开通"的紫调 */
body.is-member .member-promo {
  border-color: var(--primary-line);
  background: linear-gradient(135deg, var(--primary-tint-strong) 0%, #fdfaff 60%, #ffffff 100%);
  box-shadow: 0 10px 26px rgba(133, 73, 186, .14);
}

@media (max-width: 720px) {
  .member-badge { padding: 5px 9px; font-size: 11px; }
}
