* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1e293b;
  --text-2: #475569;
  --text-3: #94a3b8;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --red: #ef4444;
  --amber: #f59e0b;
  --green: #16a34a;
  --shadow: 0 8px 28px rgba(15,23,42,.07);
  --radius: 14px;
}
body {
  min-height: 100vh; color: var(--text); background:
    radial-gradient(circle at 85% 0, rgba(37,99,235,.08), transparent 28%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
.container { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.topbar .container { min-height: 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.header { padding: 20px 0; background: var(--white); border-bottom: 1px solid var(--border-light); }
.header .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px;
  color: white; background: linear-gradient(135deg, var(--primary), #0ea5e9); font-size: 24px;
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
}
.logo h1 { color: var(--primary); font-size: 22px; }
.logo p { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.header-shortcuts { display: flex; align-items: center; gap: 10px; }
.header-shortcut {
  position: relative; height: 42px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); background: #fff;
  font-size: 13px; font-weight: 700;
}
.header-shortcut.active { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.commerce-badge {
  min-width: 19px; height: 19px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; color: white; background: var(--red); font-size: 11px; font-weight: 800;
}
.commerce-badge[hidden] { display: none; }
.page { padding: 28px 0 48px; }
.page-title-row { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.page-title { font-size: 24px; }
.page-subtitle { margin-top: 6px; color: var(--text-3); font-size: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.panel {
  border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--white);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  min-height: 54px; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-light);
}
.panel-head h3 { font-size: 15px; }
.panel-body { padding: 20px; }
.summary { position: sticky; top: 20px; padding: 20px; }
.summary h3 { margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid var(--border-light); font-size: 15px; }
.sum-row { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); font-size: 13px; }
.sum-row.total { margin-top: 16px; padding-top: 16px; align-items: center; border-top: 1px solid var(--border-light); color: var(--text); font-weight: 700; }
.sum-total { color: var(--red); font-size: 21px; font-weight: 800; text-align: right; }
.sum-note { margin: 12px 0 16px; color: var(--text-3); font-size: 12px; line-height: 1.7; }
.primary-btn {
  width: 100%; height: 46px; border: none; border-radius: 10px; color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); cursor: pointer;
  font-size: 14px; font-weight: 800; box-shadow: 0 8px 18px rgba(37,99,235,.18);
}
.primary-btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.secondary-btn {
  height: 38px; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 9px;
  color: var(--text-2); background: #fff; cursor: pointer; font-size: 13px; font-weight: 700;
}
.secondary-btn.primary { color: white; border-color: var(--primary); background: var(--primary); }
.secondary-btn.danger { color: var(--red); border-color: #fecaca; }
.empty-state {
  padding: 68px 20px; color: var(--text-3); text-align: center;
}
.empty-state .icon { margin-bottom: 14px; font-size: 56px; }
.empty-state p { margin-bottom: 20px; font-size: 14px; }
.empty-state a {
  height: 42px; padding: 0 24px; display: inline-flex; align-items: center; border-radius: 10px;
  color: white; background: var(--primary); font-size: 13px; font-weight: 700;
}
.notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #bbf7d0; border-radius: 11px; color: #166534; background: #f0fdf4; font-size: 13px; }
.notice.error { border-color: #fecaca; color: #991b1b; background: #fef2f2; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 12px; }
.field label { margin-bottom: 5px; display: block; color: var(--text-2); font-size: 12px; font-weight: 700; }
.field label span { color: var(--red); }
.field input, .field textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; outline: none; color: var(--text); font-size: 13px;
}
.field input { height: 39px; padding: 0 10px; }
.field textarea { min-height: 66px; padding: 9px 10px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.region-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.region-picker select {
  width: 100%; height: 39px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 9px;
  outline: none; color: var(--text); background: #fff; font-size: 13px;
}
.region-picker input {
  width: 100%; height: 39px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 9px;
  outline: none; color: var(--text); background: #fff; font-size: 13px;
}
.region-picker select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.region-picker input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.region-picker select:disabled { color: var(--text-3); background: #f8fafc; cursor: not-allowed; }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; }
.address-card { color: var(--text-2); font-size: 13px; line-height: 1.8; }
.address-card strong { color: var(--text); }
.address-card button { margin-left: 8px; border: none; color: var(--primary); background: none; cursor: pointer; font-weight: 700; }
.address-select {
  width: 100%; height: 39px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 9px;
  outline: none; color: var(--text); background: #fff; font-size: 13px;
}
.address-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.address-actions { display: flex; gap: 10px; }
.cover {
  flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe); font-size: 34px;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.qty-control { display: grid; grid-template-columns: 32px 42px 32px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-control button { border: none; color: var(--text-2); background: #f8fafc; cursor: pointer; font-size: 17px; }
.qty-control input { width: 42px; height: 31px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; outline: none; }
.footer { margin-top: 30px; padding: 32px 0 22px; color: rgba(255,255,255,.72); background: #0f172a; text-align: center; font-size: 12px; }
.footer p + p { margin-top: 9px; }
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 1000; max-width: 330px; padding: 12px 16px;
  border-radius: 10px; color: white; background: #0f172a; box-shadow: 0 12px 30px rgba(15,23,42,.24);
  font-size: 13px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 680px) {
  .topbar .container, .header .container, .page-title-row { align-items: flex-start; flex-direction: column; }
  .topbar .container { padding-top: 8px; padding-bottom: 8px; }
  .header-shortcuts { width: 100%; }
  .header-shortcut { flex: 1; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .region-picker { grid-template-columns: 1fr; gap: 8px; }
}
