:root {
  --ink: #1a3131;
  --muted: #5b6f6d;
  --accent: #14736f;
  --accent-dark: #0e605c;
  --bg: #f5f8f7;
  --panel: #ffffff;
  --line: #ccdad5;
  --danger: #a03e2c;
  --header-bg: #e4f0e9;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid #d5e4dc;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: bold;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
}

.nav { display: flex; gap: 20px; flex: 1; }
.nav a { color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--accent); text-decoration: none; }

.auth-area { display: flex; align-items: center; gap: 10px; }
.auth-area .who { color: var(--muted); font-size: 13px; }

.demo-badge {
  background: #fdf1dc;
  color: #8a5c12;
  border: 1px solid #efd9ac;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.demo-hint {
  background: #fdf6e8;
  border: 1px dashed #efd9ac;
  border-radius: 8px;
  padding: 8px 12px;
  color: #7a5410;
  font-size: 12.5px;
  margin: 0 0 10px;
  display: none;
}

button {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.ghost:hover { background: #e7f0ec; }
button:disabled { opacity: .55; cursor: default; }

.hero {
  background: linear-gradient(180deg, #e4f0e9 0%, #f5f8f7 100%);
  border-bottom: 1px solid #dbe9e2;
}

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 48px;
}

.hero h1 { font-size: 34px; margin: 0 0 12px; line-height: 1.3; }
.hero p.tagline { color: var(--muted); font-size: 16px; margin: 0 0 26px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions button { padding: 11px 26px; font-size: 14px; }

.feature-strip {
  max-width: 1080px;
  margin: -28px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  position: relative;
}

.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(26, 49, 49, .05);
}
.feature strong { display: block; font-size: 14px; margin-bottom: 4px; }
.feature span { color: var(--muted); font-size: 12.5px; }

main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 44px 24px 20px; flex: 1 0 auto; }

section { margin-bottom: 52px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 21px; margin: 0; }
.section-head .hint { color: var(--muted); font-size: 13px; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.product {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product:hover { box-shadow: 0 8px 24px rgba(26, 49, 49, .08); transform: translateY(-2px); }

.product h3 { margin: 0; font-size: 17px; }
.product .spec { color: var(--muted); font-size: 13px; }
.product .os-tag {
  display: inline-block;
  align-self: flex-start;
  background: #e8f2ee;
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

.price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.price { font-size: 28px; font-weight: bold; color: var(--accent); }
.price-unit { color: var(--muted); font-size: 13px; }

.product .buy { margin-top: 8px; }

.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.machine {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.machine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.machine-head h3 { margin: 0; font-size: 15px; }
.machine .meta { color: var(--muted); font-size: 12.5px; }
.machine .actions { margin-top: 6px; display: flex; gap: 8px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef3f1;
  color: var(--muted);
  white-space: nowrap;
}
.pill.active, .pill.completed { background: #dff0e8; color: #14603f; }
.pill.provisioning, .pill.paid { background: #fdf1dc; color: #8a5c12; }
.pill.expired, .pill.cancelled { background: #fbe6e1; color: var(--danger); }
.pill.free { background: #e8eefc; color: #2c4f9e; }

.empty-box {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

.guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.step .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: bold;
  margin-bottom: 10px;
}
.step strong { display: block; margin-bottom: 4px; font-size: 14px; }
.step span { color: var(--muted); font-size: 12.5px; }

.notice {
  background: #fffaf0;
  border: 1px solid #f0dbb6;
  border-radius: var(--radius);
  padding: 14px 18px;
  color: #7a5410;
  font-size: 13px;
}

footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: auto;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.footer-inner a { color: var(--muted); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(26, 49, 49, .35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-mask.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  padding: 26px 26px 22px;
  box-shadow: 0 18px 50px rgba(15, 40, 40, .25);
  max-height: 88vh;
  overflow: auto;
}
.modal.wide { max-width: 520px; }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.modal .close-row { text-align: right; margin-top: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfdfc;
  outline: none;
}
.field input:focus { border-color: var(--accent); }

.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.kv { display: grid; grid-template-columns: 108px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.otp-box {
  background: #fdf6e8;
  border: 1px solid #efd9ac;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.otp-box .label { color: #8a5c12; font-size: 12px; margin-bottom: 6px; }
.otp-box .code {
  font-family: Consolas, monospace;
  font-size: 20px;
  letter-spacing: 2px;
  color: #5c3d05;
  user-select: all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: #1a3131;
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all .22s ease;
  z-index: 80;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .feature-strip { grid-template-columns: repeat(2, 1fr); margin-top: 20px; }
  .guide { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .hero h1 { font-size: 26px; }
}

@media (max-width: 520px) {
  .feature-strip, .guide { grid-template-columns: 1fr; }
  .topbar-inner { gap: 12px; }
}

/* ---------- 购物中心 / 购物车 ---------- */
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}
.cart-link:hover { background: #e7f0ec; text-decoration: none; }
.cart-link.active { border-color: var(--accent); color: var(--accent); }

.cart-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.cart-badge.hidden { display: none; }

.catalog-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.catalog-tools input,
.catalog-tools select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.catalog-tools input { width: 210px; }
.catalog-tools input:focus,
.catalog-tools select:focus { border-color: var(--accent); }

.product-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.product-actions button { padding: 9px 0; }
.product-actions .buy { margin-top: 0; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 20px; align-items: start; }
.cart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 116px 96px 52px;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e7eeeb;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-main { min-width: 0; }
.cart-item-main h3 { margin: 2px 0; font-size: 15px; }
.cart-item-main .spec { color: var(--muted); font-size: 12.5px; }
.cart-item-main .os-tag {
  display: inline-block;
  background: #e8f2ee;
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11.5px;
}
.cart-unit { color: var(--muted); font-size: 12px; text-align: right; }
.cart-unit strong { color: var(--ink); font-size: 14px; }
.qty {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 0;
  font-size: 15px;
  line-height: 1.2;
}
.qty button:hover { background: #e7f0ec; }
.qty span { min-width: 30px; text-align: center; font-size: 13px; }
.line-total { font-weight: bold; color: var(--accent); text-align: right; }
.remove {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 4px;
  font-size: 12.5px;
}
.remove:hover { background: none; color: var(--danger); text-decoration: underline; }

.cart-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 86px;
}
.cart-summary h3 { font-size: 15px; margin: 0 0 14px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.summary-total .money { font-size: 26px; font-weight: bold; color: var(--accent); }
.cart-summary .checkout { width: 100%; margin-top: 14px; padding: 11px; font-size: 14px; }
.cart-summary .clear {
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.cart-summary .clear:hover { background: none; color: var(--danger); }

.cart-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.6; }

.order-lines {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
  max-height: 190px;
  overflow: auto;
}
.order-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.order-line code { color: var(--ink); background: #f0f4f2; padding: 1px 6px; border-radius: 4px; word-break: break-all; }

@media (max-width: 960px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 1024px) {
  .topbar-inner { gap: 18px; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; gap: 12px; }
  .auth-area { margin-left: auto; }
  .cart-link { padding: 5px 12px; }
}

@media (max-width: 640px) {
  .cart-item { grid-template-columns: 1fr auto; }
  .cart-item-main { grid-column: 1 / -1; }
  .cart-unit { text-align: left; }
  .line-total { text-align: left; }
  .remove { justify-self: end; }
  .catalog-tools { width: 100%; }
  .catalog-tools input { flex: 1; width: auto; }
  .section-head { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .topbar-inner { padding: 10px 14px; }
  .cart-link { padding: 5px 10px; }
  .hero-inner { padding: 40px 20px 36px; }
  main { padding: 32px 16px 16px; }
  .cart-item { padding: 14px; gap: 10px; }
  .modal { padding: 22px 18px 18px; }
}

/* ---------- 用户中心 ---------- */
.hidden { display: none !important; }
.nav a.active { color: var(--accent); font-weight: bold; }
.account-login { max-width: 620px; margin: 40px auto; }
.account-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.account-hero h2 { margin: 0 0 4px; font-size: 24px; }
.account-hero .muted { margin: 0; }
.account-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ghost-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
.ghost-link:hover { background: #e7f0ec; text-decoration: none; }
.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.account-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.account-stat .n { font-size: 24px; font-weight: bold; color: var(--accent); }
.account-stat .t { color: var(--muted); font-size: 12px; margin-top: 3px; }
.account-panel { margin-top: 18px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.account-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.account-card h3 { margin: 0 0 12px; font-size: 16px; }
.account-card h2 { margin: 0 0 8px; font-size: 20px; }
.small { font-size: 12px; }
.tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e7eeeb; vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: normal; font-size: 12px; }
.data-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button { padding: 4px 12px; font-size: 12px; }
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item { border-bottom: 1px solid #e7eeeb; padding-bottom: 8px; }
.activity-item:last-child { border-bottom: none; }
.activity-time { color: var(--muted); font-size: 12px; }
.activity-text { font-size: 13px; }
.mini-machine { border-bottom: 1px solid #e7eeeb; padding: 10px 0; }
.mini-machine:last-child { border-bottom: none; }
.mini-machine-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.mini-machine .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 700px) {
  .account-hero { align-items: flex-start; flex-direction: column; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }
}