:root {
  --ink: #302725;
  --muted: #8b7c77;
  --wine: #704b43;
  --wine-dark: #56372f;
  --blush: #eadcd5;
  --paper: #fbf8f5;
  --line: #e8ded9;
  --green: #3d7659;
  --amber: #a66a27;
  --red: #a8453f;
  --shadow: 0 20px 60px rgba(72, 45, 37, .11);
  --surface: #fff;
  --soft: #f7f3f1;
  --hero-start: #ecddd5;
  --hero-mid: #f6eeea;
  --hero-end: #d9c0b4;
  --radius: 20px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
.site-footer { max-width: 1240px; margin: auto; padding: 20px 24px 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; line-height: 1.7; }
.site-footer a, .privacy-content a { color: var(--wine); overflow-wrap: anywhere; }
.privacy-content { padding: 28px; line-height: 1.8; }
.privacy-content h3 { margin-top: 24px; font-size: 17px; }
.site-footer button, .site-footer a { min-height: 44px; display: inline-flex; align-items: center; }
:focus-visible { outline: 3px solid var(--wine); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1240px)/2)); border-bottom: 1px solid rgba(112,75,67,.12); background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--wine); color: #fff; font: 700 22px Georgia, serif; box-shadow: inset 0 0 0 5px rgba(255,255,255,.1); }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 20px Georgia, "Songti SC", serif; letter-spacing: .16em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; letter-spacing: .08em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.theme-picker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.theme-picker select { border: 1px solid var(--line); border-radius: 9px; padding: 8px 28px 8px 10px; color: var(--ink); background: var(--surface); outline: 0; }
.view-switch { display: flex; padding: 4px; background: #efe8e4; border-radius: 12px; }
.switch-btn { border: 0; padding: 9px 16px; border-radius: 9px; background: transparent; color: #756762; font-size: 13px; }
.switch-btn.active { color: #fff; background: var(--wine); box-shadow: 0 5px 15px rgba(91,64,55,.2); }
main { max-width: 1240px; margin: auto; padding: 0 24px 70px; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.hero { min-height: 430px; display: flex; align-items: center; justify-content: space-between; gap: 50px; padding: 58px 7%; margin-top: 28px; border-radius: calc(var(--radius) + 14px); overflow: hidden; background: radial-gradient(circle at 82% 28%, rgba(255,255,255,.75) 0 3%, transparent 24%), linear-gradient(125deg, var(--hero-start) 0%, var(--hero-mid) 54%, var(--hero-end) 100%); position: relative; }
.hero::before { content: ""; position: absolute; width: 360px; height: 360px; border: 1px solid rgba(112,75,67,.16); border-radius: 50%; right: -80px; bottom: -130px; }
.hero-copy { max-width: 560px; position: relative; z-index: 2; }
.eyebrow { display: block; color: var(--wine); font-size: 11px; font-weight: 700; letter-spacing: .22em; margin-bottom: 12px; }
h1, h2, p { margin-top: 0; }
.hero h1 { font: 500 clamp(42px, 6vw, 72px)/1.1 Georgia, "Songti SC", serif; letter-spacing: -.03em; margin-bottom: 22px; }
.hero h1 em { color: var(--wine); font-style: italic; }
.hero p { max-width: 460px; color: #71625d; line-height: 1.8; }
.hero-orbit { width: 270px; height: 270px; border: 16px solid rgba(112,75,67,.8); border-radius: 50%; position: relative; flex: none; box-shadow: 0 25px 50px rgba(90,55,44,.18), inset 0 0 0 8px rgba(255,255,255,.35); }
.hero-orbit::before, .hero-orbit::after, .hero-orbit span::before, .hero-orbit span::after { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(145deg, #f5ece7, #a77b6b); box-shadow: 0 5px 10px rgba(76,46,37,.25); }
.hero-orbit::before { left: -19px; top: 105px; }.hero-orbit::after { right: -19px; top: 105px; }.hero-orbit span::before { top: -19px; left: 105px; }.hero-orbit span::after { bottom: -19px; left: 105px; }
.hero-orbit i { position: absolute; inset: 0; display: grid; place-items: center; color: var(--wine); font-size: 42px; font-style: normal; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) - 2px); box-shadow: 0 10px 30px rgba(65,43,35,.05); }
.customer-toolbar { margin: 28px 0; padding: 16px; display: flex; align-items: center; gap: 20px; }
.search-box { display: flex; align-items: center; gap: 10px; min-width: 280px; flex: 1; padding: 11px 15px; background: var(--soft); border-radius: 11px; }
.search-box span { color: var(--wine); font-size: 22px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 8px 13px; font-size: 12px; }
.chip.active { color: #fff; background: var(--wine); border-color: var(--wine); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .25s; cursor: pointer; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.product-photo { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; background: #eadfd9; }
.product-body { padding: 20px; }
.product-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-code { font-weight: 750; letter-spacing: .08em; }
.product-price { color: var(--wine); font: 700 21px Georgia, serif; }
.product-category { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.empty { grid-column: 1/-1; padding: 90px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 48px 0 26px; }
.admin-heading h1 { font: 500 42px Georgia, "Songti SC", serif; margin-bottom: 7px; }
.admin-heading p { color: var(--muted); margin-bottom: 0; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 650; font-size: 13px; }
.btn.primary { color: #fff; background: var(--wine); }.btn.primary:hover { background: var(--wine-dark); }
.btn.light { color: var(--wine); background: var(--blush); }.btn.ghost { color: #6f625d; background: transparent; border: 1px solid var(--line); }
.btn.danger { color: var(--red); background: #f9e8e6; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stat { padding: 20px; border-radius: calc(var(--radius) - 3px); background: var(--surface); border: 1px solid var(--line); }
.stat strong { display: block; font: 700 34px Georgia, serif; color: var(--wine); }
.stat span { color: var(--muted); font-size: 12px; }
.admin-toolbar { display: flex; gap: 12px; margin: 20px 0; padding: 12px; }
.admin-toolbar select { border: 0; background: var(--soft); border-radius: 11px; padding: 0 16px; color: var(--ink); outline: 0; }
.admin-list { display: grid; gap: 12px; }
.admin-item { display: grid; grid-template-columns: 104px 1fr auto; gap: 18px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) - 3px); }
.admin-thumb { width: 104px; height: 86px; object-fit: cover; border-radius: 12px; background: #eee2dc; }
.admin-main { min-width: 0; }
.admin-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-title strong { letter-spacing: .05em; }.admin-title .price { color: var(--wine); font-weight: 700; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.badge.available { color: var(--green); background: #e7f2eb; }.badge.sold { color: var(--amber); background: #f7ebdc; }.badge.hidden { color: #68656d; background: #ecebed; }.badge.deleted { color: var(--red); background: #f8e7e5; }
.admin-meta, .private-data { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private-data { color: #6d5147; }
.admin-actions { max-width: 310px; display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.modal { width: min(720px, calc(100% - 28px)); max-height: 90vh; overflow: auto; border: 0; border-radius: 24px; padding: 0; color: var(--ink); box-shadow: 0 30px 100px rgba(44,26,21,.35); }
.modal::backdrop { background: rgba(43,30,27,.52); backdrop-filter: blur(5px); }
.form-modal form, .detail-modal > div { padding: 30px; }
.modal-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.modal-header h2 { font: 600 30px Georgia, "Songti SC", serif; margin-bottom: 4px; }
.modal-header p { color: var(--muted); margin: 0; }
.modal-close { border: 0; background: #f2ece9; color: #725e56; border-radius: 50%; width: 36px; height: 36px; font-size: 24px; line-height: 1; flex: none; }
.detail-modal > .modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.detail-image { width: 100%; max-height: 480px; object-fit: cover; border-radius: 18px; background: #eee; }
.detail-info { padding: 22px 2px 0; }.detail-info h2 { font: 600 30px Georgia, serif; }.detail-info .detail-price { float: right; color: var(--wine); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid label { display: block; }.form-grid label.full { grid-column: 1/-1; }
.form-grid label > span { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: #665752; }
.form-grid input, .form-grid textarea, .form-grid select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: 0; color: var(--ink); background: var(--surface); }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: #a78679; box-shadow: 0 0 0 3px rgba(112,75,67,.09); }
.form-grid textarea { min-height: 90px; resize: vertical; }
.image-editor { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 13px; border-radius: 14px; background: #f8f4f2; }
.image-editor img { width: 112px; height: 90px; object-fit: cover; border-radius: 10px; background: #e7dcd6; }
.image-editor p { color: var(--muted); font-size: 12px; margin: 5px 0 0; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.access-modal { width: min(980px, calc(100% - 28px)); }
.access-content { padding: 30px; }
.access-list { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.access-row { display: grid; grid-template-columns: 180px 150px minmax(220px, 1fr); gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 12px; }
.access-row:last-child { border-bottom: 0; }
.access-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-head { position: sticky; top: 0; z-index: 1; color: var(--muted); font-weight: 700; background: var(--soft); }
.access-content .modal-header p { max-width: 660px; line-height: 1.6; }
.privacy-note { margin-top: 20px; padding: 13px; border-radius: 12px; color: #65534c; background: #f7f0eb; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 999px; color: #fff; background: #302725; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 方案二：现代极简 */
body[data-theme="minimal"] {
  --ink: #111;
  --muted: #6d6d6d;
  --wine: #111;
  --wine-dark: #333;
  --blush: #ededed;
  --paper: #f5f5f3;
  --line: #d8d8d5;
  --surface: #fff;
  --soft: #f0f0ee;
  --hero-start: #fff;
  --hero-mid: #f3f3f0;
  --hero-end: #deded9;
  --radius: 8px;
  --shadow: 0 18px 55px rgba(0,0,0,.1);
}
body[data-theme="minimal"] .brand-mark { border-radius: 8px; box-shadow: none; }
body[data-theme="minimal"] .hero h1, body[data-theme="minimal"] .admin-heading h1 { font-family: Inter, "Microsoft YaHei", sans-serif; font-weight: 800; letter-spacing: -.06em; }
body[data-theme="minimal"] .hero-orbit { border: 3px solid #111; box-shadow: none; }
body[data-theme="minimal"] .product-card:hover { transform: translateY(-3px); }
body[data-theme="minimal"] .eyebrow { letter-spacing: .3em; color: #111; }

/* 方案三：暗夜鎏金 */
body[data-theme="noir"] {
  --ink: #f4ead8;
  --muted: #b7aa98;
  --wine: #c5a35f;
  --wine-dark: #a98748;
  --blush: #3d3428;
  --paper: #151513;
  --line: #3a352c;
  --surface: #211f1b;
  --soft: #2b2823;
  --hero-start: #1d1c19;
  --hero-mid: #29251d;
  --hero-end: #554226;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0,0,0,.42);
}
body[data-theme="noir"] .topbar { border-bottom-color: #39342b; }
body[data-theme="noir"] .view-switch { background: #2b2823; }
body[data-theme="noir"] .hero::before { border-color: rgba(216,183,111,.28); }
body[data-theme="noir"] .hero-orbit { border-color: #b99552; box-shadow: 0 25px 60px rgba(0,0,0,.45), inset 0 0 0 8px rgba(255,255,255,.05); }
body[data-theme="noir"] .hero p, body[data-theme="noir"] .form-grid label > span { color: var(--muted); }
body[data-theme="noir"] .modal { background: var(--surface); color: var(--ink); }
body[data-theme="noir"] .modal-close, body[data-theme="noir"] .image-editor, body[data-theme="noir"] .privacy-note { background: var(--soft); color: var(--ink); }
body[data-theme="noir"] .btn.ghost { color: var(--muted); }
body[data-theme="noir"] .search-box input { color: var(--ink); }

/* 方案四：森系清透 */
body[data-theme="forest"] {
  --ink: #26362f;
  --muted: #718078;
  --wine: #557462;
  --wine-dark: #3e594a;
  --blush: #dfeae3;
  --paper: #f3f7f2;
  --line: #d8e3da;
  --surface: #fcfffc;
  --soft: #eaf2ec;
  --hero-start: #dae9df;
  --hero-mid: #eff5ef;
  --hero-end: #c9ddcf;
  --radius: 26px;
  --shadow: 0 20px 60px rgba(48,83,61,.12);
}
body[data-theme="forest"] .brand-mark { background: linear-gradient(145deg, #6c8e78, #3f5e4d); }
body[data-theme="forest"] .hero { border: 1px solid rgba(85,116,98,.12); }
body[data-theme="forest"] .hero-orbit { border-color: #789780; }
body[data-theme="forest"] .hero-orbit::before, body[data-theme="forest"] .hero-orbit::after, body[data-theme="forest"] .hero-orbit span::before, body[data-theme="forest"] .hero-orbit span::after { background: linear-gradient(145deg, #eef7ef, #6e947b); }

@media (max-width: 820px) {
  .topbar { padding: 0 16px; height: 72px; }.brand small, .theme-picker > span { display: none; }.switch-btn { padding: 8px 10px; }.topbar-actions { gap: 7px; }.theme-picker select { width: 112px; }
  main { padding: 0 14px 50px; }.hero { min-height: 360px; padding: 38px 26px; }.hero-orbit { width: 150px; height: 150px; border-width: 10px; }.hero-orbit::before, .hero-orbit::after, .hero-orbit span::before, .hero-orbit span::after { display: none; }
  .customer-toolbar { align-items: stretch; flex-direction: column; }.search-box { min-width: 0; }.product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .admin-heading { align-items: flex-start; flex-direction: column; }.heading-actions { justify-content: flex-start; }.stats { grid-template-columns: repeat(2, 1fr); }
  .admin-item { grid-template-columns: 78px 1fr; }.admin-thumb { width: 78px; height: 78px; }.admin-actions { grid-column: 1/-1; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .brand strong { display: none; }.brand-mark { width: 38px; height: 38px; }.switch-btn { font-size: 11px; padding: 8px 7px; }.theme-picker select { width: 102px; padding-left: 7px; font-size: 11px; }
  .hero { min-height: 335px; margin-top: 14px; }.hero h1 { font-size: 42px; }.hero-orbit { position: absolute; right: -55px; bottom: -35px; opacity: .55; }
  .product-body { padding: 14px; }.product-price { font-size: 17px; }.admin-toolbar { flex-direction: column; }.admin-toolbar select { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }.form-grid label.full { grid-column: auto; }.modal { border-radius: 18px; }.form-modal form, .detail-modal > div, .access-content { padding: 22px; }.access-row { grid-template-columns: 1fr; gap: 4px; }.access-head { display: none; }
}
