:root {
  --ink: #1a1612;
  --ink-soft: #3a322b;
  --resin: #4a3426;
  --amber: #b08968;
  --gold: #c9a66b;
  --paper: #f6f1e8;
  --mist: #ebe4d8;
  --cream: #fbf8f3;
  --sage: #5d6b5c;
  --line: rgba(26, 22, 18, 0.12);
  --white: #fffdf9;
  --danger: #8a3a2a;
  --ok: #3d5c45;
  --shadow: 0 18px 50px rgba(26, 22, 18, 0.12);
  --serif: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --sans: "Outfit", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  background: var(--ink);
  color: var(--mist);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 22px; letter-spacing: 0.18em;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: #f4eee4; flex-shrink: 0;
}
.brand-name { letter-spacing: 0.18em; }
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; gap: 16px;
  position: relative;
}
.brand { font-weight: 500; font-size: 24px; }
.brand span.brand-name { display: inline; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-links a { opacity: 0.78; }
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn, .lang-btn, .ghost, .btn {
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; font-size: 12px; letter-spacing: 0.08em;
}
.btn {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  text-transform: uppercase;
}
.btn:hover { background: var(--resin); }
.btn.gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.ghost:hover { background: var(--mist); }
.cart-count {
  display: inline-flex; min-width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-size: 11px;
  align-items: center; justify-content: center; margin-left: 4px;
}
.menu-toggle { display: none; }
.nav-extra { display: none; }

.hero {
  min-height: 86vh; display: grid; grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
}
.hero-copy { padding: 80px 8vw 60px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--amber); margin-bottom: 18px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; }
h1 { font-size: clamp(42px, 6vw, 78px); }
h2 { font-size: clamp(30px, 4vw, 48px); }
h3 { font-size: 26px; }
.lede { margin: 22px 0 32px; max-width: 34em; color: var(--ink-soft); font-size: 17px; }
.hero-visual { position: relative; overflow: hidden; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; min-height: 520px; }
.hero-caption {
  position: absolute; left: 24px; bottom: 24px; color: var(--paper);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  text-shadow: 0 8px 24px rgba(0,0,0,.4);
}

section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.muted { color: var(--ink-soft); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.card {
  background: var(--white); border: 1px solid var(--line); overflow: hidden;
}
.card .media {
  display:flex; align-items:center; justify-content:center;
  aspect-ratio:1/1; background:#f4eee4; overflow:hidden;
}
.card .media img, .card img {
  width:100%; height:100%;
  object-fit:contain; object-position:center;
  background:#f4eee4;
}
.card-body { padding: 20px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-actions .btn {
  min-height: 40px;
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 8px 14px;
}
.price { font-family: var(--serif); font-size: 22px; }
.tag { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage); }
.quote-band {
  background: var(--ink); color: var(--paper); text-align: center; padding: 72px 20px;
  font-family: var(--serif); font-size: clamp(24px, 3vw, 38px); line-height: 1.35;
}
.quote-band small { display: block; margin-top: 18px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

.page-hero {
  padding: 72px 0 24px;
}
.about-hero { padding: 40px 0 8px; }
.about-hero .lede { margin-bottom: 0; }
.about-band { padding: 40px 0 72px; }
.about-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  margin: 8px 0 18px;
}
.about-lede {
  max-width: none !important;
  width: 100%;
  margin: 0 0 28px;
  white-space: nowrap;
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.4;
}
.about-photo {
  width: 100%;
  height: min(520px, 56vw);
  object-fit: cover;
  display: block;
  margin: 0 0 36px;
}
.about-copy { padding-top: 0; }
.about-copy p:first-child { margin-top: 0; }
.about-copy p, .about-copy li {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 21px;
  line-height: 1.5;
}
@media (min-width: 901px) {
  .about-copy { padding-top: 0; }
}
.prose { max-width: 720px; }
.prose p, .prose li { margin-bottom: 14px; color: var(--ink-soft); }
.prose h3 { margin: 28px 0 10px; }
.timeline { border-left: 1px solid var(--line); padding-left: 24px; }
.timeline article { margin-bottom: 28px; position: relative; }
.timeline article::before {
  content: ""; width: 9px; height: 9px; background: var(--gold); border-radius: 50%;
  position: absolute; left: -29px; top: 8px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-bottom: 80px; }
.pdp .photo {
  display:flex; align-items:center; justify-content:center;
  aspect-ratio:1/1; background:#f4eee4; overflow:hidden;
}
.pdp .photo img, .pdp img {
  width:100%; height:100%; max-width:100%;
  object-fit:contain; object-position:center;
  background:#f4eee4;
}
.spec { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec th { width: 38%; color: var(--ink-soft); font-weight: 400; }

.checkout-page { max-width: 640px; padding: 28px 0 72px; min-width: 0; overflow-x: clip; }
.checkout-page h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 40px); margin: 0 0 20px; }
.checkout-col { min-width: 0; }
@media (min-width: 901px) {
  .checkout-page {
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px);
    gap: 48px;
    align-items: start;
  }
  .checkout-box { margin-top: 0; position: sticky; top: 88px; }
  .cart-item {
    grid-template-columns: 110px minmax(0, 1fr) auto;
    align-items: center;
  }
  .cart-item-price { margin: 0; text-align: right; min-width: 88px; }
}
.cart-list { display: flex; flex-direction: column; gap: 0; }
.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.cart-item img {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #f4eee4;
}
.cart-item-body { min-width: 0; }
.cart-item-body strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.qty-row { display: inline-flex; align-items: center; gap: 0; margin: 10px 0 8px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; max-width: 100%; }
.qty-btn {
  width: 36px; height: 36px; border: 0; background: transparent; font-size: 18px; line-height: 1; color: var(--ink);
}
.qty-input {
  width: 48px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; background: #fff; padding: 0; font-size: 15px; -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-price { font-family: var(--serif); font-size: 20px; margin: 6px 0 10px; }
.cart-totals {
  margin-top: 8px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--ink);
}
.cart-totals p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
  color: var(--ink-soft);
}
.cart-grand {
  margin-top: 10px !important;
  color: var(--ink) !important;
  font-size: 22px;
  font-family: var(--serif);
}
.cart-grand strong { font-size: 28px; font-weight: 500; }
.checkout-box { background: var(--white); border: 1px solid var(--line); padding: 24px; margin-top: 20px; }
.account-shell { max-width: 460px; margin: 0 auto; padding: 8px 0 80px; }
.account-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 36px 32px 32px;
  box-shadow: var(--shadow);
}
.account-card h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 8px;
}
.account-card .lede { margin-bottom: 22px; }
.account-switch {
  display: flex;
  gap: 22px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
.account-switch button {
  background: none; border: 0; padding: 0 0 12px;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); cursor: pointer;
}
.account-switch button[aria-pressed="true"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}
.account-card label { margin-top: 16px; }
.account-card .btn { width: 100%; margin-top: 22px; }
.pass-wrap { display: flex; gap: 8px; align-items: center; }
.pass-wrap input { flex: 1; }
.pass-wrap .pass-toggle { margin: 0; min-height: 40px; white-space: nowrap; }
.account-foot {
  margin-top: 18px; text-align: center; font-size: 14px; color: var(--ink-soft);
}
.account-foot button {
  background: none; border: 0; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  font-size: 14px;
}
.account-signed { text-align: center; padding: 48px 24px 80px; }
.account-signed p { margin: 8px 0 20px; }
@media (max-width: 600px) {
  .account-card { padding: 28px 20px; }
  .account-switch { gap: 14px; }
  .account-switch button { font-size: 12px; letter-spacing: 0.04em; }
}
label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: var(--cream); color: var(--ink);
}
.notice { background: #f3ead8; border: 1px solid var(--gold); padding: 14px 16px; font-size: 14px; margin: 16px 0; }
.ok-box { background: #e8f0ea; border: 1px solid var(--ok); padding: 14px 16px; }
.warn { color: var(--danger); font-size: 13px; }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.social { display: grid; gap: 10px; margin: 16px 0 24px; }
.social button { width: 100%; }

.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 70vh; }
.side { background: var(--ink); color: var(--paper); padding: 28px 18px; }
.side a { display: block; padding: 10px 8px; opacity: 0.75; font-size: 13px; }
.side a.active, .side a:hover { opacity: 1; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--white); }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.badge { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--mist); }
.badge.ship { background: #e4ece8; color: var(--ok); }
.badge.done { background: #ece6d8; }
.badge.wait { background: #f3e2d8; color: var(--danger); }

footer.site { background: var(--ink); color: var(--mist); padding: 56px 0 28px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
footer a { opacity: 0.8; }
footer a:hover { opacity: 1; }
.fine { margin-top: 32px; font-size: 12px; opacity: 0.65; }

.hidden { display: none !important; }
.view { display: none; }
.view.on { display: block; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; background: var(--paper); }
.login-card { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); padding: 32px; }
.admin-app { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.admin-side { background: var(--ink); color: var(--paper); padding: 28px 16px; }
.admin-side a, .admin-side button.linkish {
  display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit;
  padding: 10px 8px; opacity: 0.72; cursor: pointer; font-size: 13px;
}
.admin-side a.active, .admin-side button.linkish.active, .admin-side a:hover, .admin-side button.linkish:hover { opacity: 1; }
.admin-main { padding: 28px; overflow: auto; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; text-transform: none; letter-spacing: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .hero, .grid-3, .grid-2, .pdp, .auth-grid, .admin, .foot-grid, .about-layout {
    grid-template-columns: 1fr;
  }
  .about-photo { height: auto; max-height: 360px; }
  .about-lede { white-space: normal; font-size: 16px; }
  .pdp { gap: 20px; padding-bottom: 48px; }
  .pdp .photo { width: 100%; background: #f4eee4; }
  .pdp .photo img, .pdp img {
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    background: #f4eee4;
  }
  .wrap { width: min(1180px, calc(100% - 24px)); }
  .topbar { font-size: 10px; letter-spacing: 0.04em; padding: 8px 10px; }
  .brand { font-size: 18px; letter-spacing: 0.1em; min-width: 0; }
  .brand span { display: none; }
  .brand-name { display: inline; letter-spacing: 0.18em; }
  .brand-mark { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
  .nav { padding: 10px 0; gap: 8px; }
  .nav-actions { gap: 4px; flex-shrink: 0; }
  .nav-actions .ghost[data-go="account"],
  .nav-actions .ghost[data-go="cart"] { display: none; }
  .lang-btn, .ghost, .btn { padding: 7px 9px; font-size: 11px; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
    background: var(--cream);
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-extra { display: block; }
  .menu-toggle { display: inline-flex; }
  .hero-copy { padding: 48px 24px; }
  .checkout-page { max-width: none; padding: 12px 0 96px; display: block; }
  .checkout-box { padding: 18px 16px; margin-top: 20px; position: static; }
  .cart-item { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .cart-item img { max-width: 80px; }
  .cart-item-price { grid-column: 2; margin: 0 0 4px; font-size: 18px; }
  .cart-item-body strong { font-size: 15px; overflow-wrap: anywhere; }
  .checkout-box .btn { width: 100%; }
  .qty-btn { width: 44px; height: 44px; }
  .qty-input { width: 52px; height: 44px; font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  .cart-grand { font-size: 20px; }
  .cart-grand strong { font-size: 24px; }
  #payBtn, #resendConfirm { min-height: 48px; }
  .stat-row, .form-grid, .admin-app { grid-template-columns: 1fr; }
}
