:root {
  --paper: #faf6f0;
  --paper-deep: #f2eae0;
  --white: #ffffff;
  --ink: #3a3530;
  --muted: #766c62;
  --line: #e8dcc8;
  --gold: #b08d57;
  --gold-soft: #c4a87a;
  --brown: #8a6a3f;
  --shadow: 0 22px 60px rgba(58, 53, 48, 0.08);
  --radius: 24px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Noto Serif TC", Georgia, serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; transform: translateY(-150%); background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; }

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.16; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.35rem, 6vw, 4.8rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
h3 { font-size: 1.22rem; }
p { margin: 0; }
.eyebrow { margin-bottom: 14px; color: var(--brown); font-size: .75rem; font-weight: 800; letter-spacing: .2em; }
.lede { max-width: 680px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.fine-print, .section-note { color: var(--muted); font-size: .82rem; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 19px; text-decoration: none; font-weight: 750; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button-primary { background: var(--brown); color: var(--white); }
.button-primary:hover { background: #745831; }
.button-secondary { border-color: var(--brown); background: transparent; color: var(--brown); }
.button-quiet { min-height: 44px; border-color: var(--line); background: var(--white); color: var(--ink); }
.button-full { width: 100%; }
.text-link { min-height: 44px; border: 0; background: transparent; color: var(--brown); padding: 6px 0; font-weight: 800; cursor: pointer; text-align: left; }

.wordmark { display: grid; gap: 1px; width: max-content; text-transform: uppercase; line-height: 1; }
.wordmark-kicker, .wordmark span { color: var(--brown); font-size: .68rem; font-weight: 800; letter-spacing: .24em; }
.wordmark strong { font-family: var(--serif); font-size: 1.42rem; font-weight: 500; letter-spacing: .03em; }
.compact-wordmark { display: grid; flex: 0 0 auto; min-height: 44px; align-content: center; line-height: 1; text-decoration: none; }
.compact-wordmark span { color: var(--brown); font-size: .58rem; font-weight: 800; letter-spacing: .2em; }
.compact-wordmark strong { margin-top: 4px; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }

.login-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 8vw, 110px); }
.login-card .wordmark { margin-bottom: clamp(44px, 9vh, 90px); }
.login-card h1 { max-width: 780px; }
.login-card .lede { margin-top: 25px; }
.stack-form { display: grid; gap: 18px; width: min(100%, 520px); margin-top: 38px; }
.login-card .fine-print { max-width: 520px; margin-top: 22px; }
.login-aside { display: flex; flex-direction: column; justify-content: center; gap: 18px; overflow: hidden; background: var(--brown); padding: clamp(30px, 6vw, 90px); }
.editorial-card { display: grid; grid-template-columns: 70px 1fr; align-items: end; min-height: 140px; border: 1px solid rgba(255,255,255,.28); padding: 25px; color: var(--white); }
.editorial-card-offset { transform: translateX(54px); }
.editorial-card span { align-self: start; font-family: var(--serif); font-size: 2.4rem; color: var(--gold-soft); }
.editorial-card p { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.45rem); line-height: 1.2; }

label { display: grid; gap: 7px; color: var(--ink); font-weight: 720; }
label > span { font-size: .9rem; }
input, textarea, select { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); padding: 12px 14px; }
textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9a8f83; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
.form-message { min-height: 1.6em; color: var(--brown); font-size: .9rem; font-weight: 700; }
.form-message.is-error, .global-message.is-error { color: #8a403c; }
.global-message { position: sticky; z-index: 9; top: 10px; min-height: 0; margin-bottom: 0; border-radius: 12px; background: var(--white); color: var(--brown); font-size: .9rem; font-weight: 750; box-shadow: var(--shadow); }
.global-message:not(:empty) { margin-bottom: 22px; padding: 12px 16px; }

.workspace { min-height: 100svh; }
.workspace-header { position: sticky; z-index: 20; top: 0; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(250,246,240,.96); padding: 12px clamp(18px, 4vw, 56px); backdrop-filter: blur(14px); }
.workspace-identity { display: flex; align-items: center; gap: 16px; font-size: .9rem; font-weight: 750; }
.workspace-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100svh - 78px); }
.workspace-nav { position: sticky; top: 78px; align-self: start; display: grid; gap: 5px; min-height: calc(100svh - 78px); border-right: 1px solid var(--line); padding: 34px 20px; }
.nav-item { display: grid; grid-template-columns: 34px 1fr; align-items: center; min-height: 50px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); padding: 9px 13px; text-align: left; cursor: pointer; }
.nav-item span { font-family: var(--serif); font-size: .78rem; }
.nav-item:hover, .nav-item.is-active { background: var(--paper-deep); color: var(--brown); }
.nav-item.is-active { font-weight: 800; }
.workspace-main { width: min(100%, 1320px); padding: clamp(34px, 6vw, 80px); }
.workspace-view { max-width: 1080px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.section-heading h1 { font-size: clamp(2.35rem, 5vw, 4.2rem); }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric { min-height: 170px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 25px; }
.metric strong { display: block; margin-top: 18px; font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 500; line-height: 1; }
.metric span { color: var(--muted); font-size: .83rem; font-weight: 750; letter-spacing: .08em; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 38px; }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow); }
.surface-accent { background: var(--brown); color: var(--white); }
.surface-accent .surface-number, .surface-accent .text-link { color: var(--gold-soft); }
.surface h2 { margin-bottom: 15px; }
.surface p + .text-link { margin-top: 18px; }
.surface-number { margin-bottom: 55px; color: var(--brown); font-family: var(--serif); font-size: 1.2rem; }
.form-surface { display: grid; gap: 22px; }
.compact-form { margin-bottom: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.switch-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; }
.switch-row span { display: grid; }
.switch-row small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.switch-row input, .consent-row input { width: 44px; min-height: 44px; accent-color: var(--brown); }
.switch-row-compact { align-self: end; min-height: 50px; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; }
.section-note { margin: 16px 0 30px; }

.record-list { display: grid; gap: 12px; }
.record-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--white); padding: 20px 22px; }
.record-card h3 { margin-bottom: 5px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .85rem; }
.record-description { margin-top: 9px; color: var(--muted); font-size: .9rem; white-space: pre-wrap; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.record-actions .button { min-height: 44px; padding: 8px 14px; font-size: .84rem; }
.empty-record { border: 1px dashed var(--line); border-radius: 18px; padding: 38px 24px; color: var(--muted); text-align: center; }
.status-badge { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; background: var(--paper-deep); color: var(--brown); padding: 3px 10px; font-size: .75rem; font-weight: 800; }
.status-badge.status-cancelled { color: var(--muted); }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -18px 0 25px; color: var(--muted); font-size: .82rem; }
.status-legend span { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-soft); }
.dot-confirmed { background: var(--brown); }.dot-completed { background: var(--ink); }.dot-cancelled { background: var(--line); }

.store-header { width: min(1180px, calc(100% - 36px)); min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: auto; border-bottom: 1px solid var(--line); }
.store-header-note { color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .08em; }
.store-body main, .document-main { width: min(1180px, calc(100% - 36px)); margin: auto; }
.store-hero { min-height: 58svh; display: flex; flex-direction: column; justify-content: end; border-bottom: 1px solid var(--line); padding: clamp(70px, 12vw, 150px) 0 clamp(54px, 8vw, 90px); }
.store-hero h1 { max-width: 980px; font-size: clamp(3rem, 9vw, 7.8rem); }
.store-tagline { max-width: 720px; margin-top: 20px; color: var(--brown); font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 2rem); }
.store-note { max-width: 720px; margin-top: 17px; color: var(--muted); white-space: pre-wrap; }
.store-grid { display: grid; gap: 90px; padding: 80px 0 110px; }
.section-index { display: grid; grid-template-columns: 60px 1fr; align-items: baseline; margin-bottom: 28px; }
.section-index span { color: var(--brown); font-family: var(--serif); font-size: 1rem; }
.service-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-choice { min-height: 240px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--white); padding: 25px; }
.service-category { width: max-content; margin-bottom: 22px; border-radius: 999px; background: var(--paper-deep); color: var(--brown); padding: 4px 10px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.service-choice p { margin-top: 12px; color: var(--muted); }
.service-choice-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 30px; color: var(--brown); font-size: .82rem; font-weight: 800; }
.notice-banner { margin-bottom: 18px; border-left: 3px solid var(--gold); background: var(--paper-deep); padding: 14px 17px; color: var(--brown); font-weight: 700; }
.service-context { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-deep); padding: 17px; }
.service-context strong { color: var(--brown); }
.service-context p { color: var(--muted); font-size: .9rem; }
.consent-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; color: var(--muted); font-weight: 500; }
.consent-row a { display: inline-flex; min-height: 44px; align-items: center; color: var(--brown); font-weight: 750; }
.store-footer { width: min(1180px, calc(100% - 36px)); min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.store-footer a { min-height: 44px; display: inline-flex; align-items: center; }
.demo-readonly-badge { min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--paper-deep); color: var(--brown); padding: 7px 13px; font-size: .78rem; font-weight: 800; }
.demo-notice { margin-bottom: 30px; }
.demo-record-card h3 { margin-top: 10px; }
.demo-slot-surface { margin-top: 24px; }
.demo-slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.demo-slot-grid span { min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-deep); color: var(--brown); font-weight: 750; }
.document-main { padding: clamp(70px, 10vw, 130px) 0; }
.document-main > h1 { max-width: 840px; }
.document-main > .lede { margin: 24px 0 44px; }
.prose { max-width: 840px; }
.prose h2 { margin: 34px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--muted); }
.empty-state { width: min(760px, calc(100% - 36px)); margin: auto; padding: 100px 0; text-align: center; }
.empty-state h1 { margin-bottom: 18px; }
.empty-state .button { margin-top: 28px; }
.page-not-found { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { min-height: 470px; }
  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-nav { position: sticky; z-index: 15; top: 78px; grid-template-columns: repeat(6, minmax(92px, 1fr)); min-height: 0; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); background: var(--paper); padding: 8px 12px; }
  .nav-item { grid-template-columns: 1fr; min-height: 58px; text-align: center; }
  .nav-item span { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  h1 { font-size: clamp(2.25rem, 12vw, 3.4rem); }
  .login-card { padding: 30px 20px 56px; }
  .login-card .wordmark { margin-bottom: 65px; }
  .login-aside { min-height: 420px; padding: 28px 20px; }
  .editorial-card { grid-template-columns: 50px 1fr; min-height: 105px; padding: 20px; }
  .editorial-card-offset { transform: translateX(18px); }
  .workspace-header { min-height: 72px; padding: 10px 16px; }
  .workspace-identity { gap: 8px; }
  .workspace-identity > span { display: none; }
  .demo-workspace-body .workspace-identity > span { display: inline-flex; }
  .workspace-nav { top: 72px; grid-template-columns: repeat(6, minmax(82px, 1fr)); }
  .nav-item { padding: 7px 9px; font-size: .78rem; }
  .workspace-main { padding: 32px 16px 60px; }
  .section-heading { display: grid; align-items: start; margin-bottom: 28px; }
  .section-heading .button { justify-self: start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 138px; padding: 18px; }
  .metric strong { font-size: 2.85rem; }
  .split-grid, .form-grid { grid-template-columns: 1fr; }
  .surface { border-radius: 18px; padding: 20px; }
  .surface-number { margin-bottom: 38px; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form .button { grid-column: 1 / -1; }
  .record-card { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .record-actions { justify-content: flex-start; }
  .store-header { min-height: 72px; }
  .store-hero { min-height: 54svh; }
  .store-grid { gap: 62px; padding: 58px 0 80px; }
  .section-index { grid-template-columns: 42px 1fr; }
  .service-choice-grid { grid-template-columns: 1fr; }
  .demo-slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-choice { min-height: 205px; }
  .store-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 22px 0; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 116px; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .button { grid-column: auto; }
  .demo-readonly-badge { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
