:root {
  --ink: #17191d;
  --paper: #f3f1ec;
  --white: #fff;
  --line: #d8d4cb;
  --muted: #666a70;
  --cyan: #00a9c6;
  --magenta: #d62c71;
  --yellow: #f3bf24;
  --green: #327b68;
  --panel: #25282e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
body, button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select { letter-spacing: 0; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; color: #fff; background: #111; }
.skip-link:focus { top: 12px; }

.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 clamp(20px, 4vw, 64px); color: #fff; background: rgba(23, 25, 29, .96); border-bottom: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark { display: flex; width: 38px; height: 38px; overflow: hidden; transform: skew(-8deg); }
.brand-mark i { flex: 1; }
.brand-mark i:nth-child(1) { background: var(--cyan); }
.brand-mark i:nth-child(2) { background: var(--magenta); }
.brand-mark i:nth-child(3) { background: var(--yellow); }
.brand span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 1rem; letter-spacing: 0; }
.brand small { color: #aeb2ba; font-family: "Space Grotesk", sans-serif; font-size: .62rem; letter-spacing: .08em; }
.topbar nav { display: flex; align-items: center; gap: 30px; color: #c9ccd1; font-size: .86rem; font-weight: 600; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: #fff; }
.menu-button { display: none; min-height: 40px; padding: 0 12px; color: #fff; background: transparent; border: 1px solid #555a63; }

.hero { position: relative; min-height: min(680px, calc(100vh - 76px)); overflow: hidden; color: #fff; background: #d9dadb; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,10,12,.9) 0%, rgba(9,10,12,.66) 32%, rgba(9,10,12,.12) 66%, rgba(9,10,12,.06) 100%); }
.hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; width: min(1360px, calc(100% - 96px)); min-height: min(680px, calc(100vh - 76px)); margin: 0 auto; padding-bottom: 72px; }
.eyebrow { margin: 0 0 18px; color: #80d8e7; font-family: "Space Grotesk", sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.eyebrow.dark { color: #087d91; }
.hero h1 { margin: 0; max-width: 650px; font-size: clamp(3.8rem, 7.3vw, 7.8rem); line-height: .88; letter-spacing: 0; }
.hero h1 span { color: #f3c62d; }
.hero-content > p:not(.eyebrow) { max-width: 570px; margin: 28px 0 32px; color: #e7e8e9; font-size: 1.02rem; line-height: 1.8; }
.hero-action { display: inline-flex; align-items: center; justify-content: space-between; width: 210px; min-height: 50px; padding: 0 18px; color: #111; background: #fff; font-size: .86rem; font-weight: 800; }
.hero-action span { font-size: 1.1rem; }
.hero-data { position: absolute; z-index: 2; right: clamp(24px, 4vw, 64px); bottom: 24px; display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); color: #fff; background: rgba(23,25,29,.9); border: 1px solid rgba(255,255,255,.18); }
.hero-data div { min-width: 130px; padding: 16px 20px; border-right: 1px solid rgba(255,255,255,.14); }
.hero-data div:last-child { border-right: 0; }
.hero-data strong, .hero-data span { display: block; }
.hero-data strong { color: #f4ca3b; font: 700 1.08rem "Space Grotesk", sans-serif; }
.hero-data span { margin-top: 4px; color: #afb3b9; font-size: .7rem; }

.section { padding: 96px clamp(24px, 5vw, 80px); }
.section-title { display: grid; grid-template-columns: 1fr minmax(320px, 560px); align-items: end; gap: 50px; width: min(1360px, 100%); margin: 0 auto 40px; }
.section-title h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.08; }
.section-title > p { margin: 0; color: var(--muted); line-height: 1.8; }
.workbench { background: var(--paper); }
.workbench-grid { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(560px, 1.45fr); width: min(1360px, 100%); margin: 0 auto; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(30,31,34,.08); }
.control-panel { padding: clamp(24px, 3vw, 42px); background: #fff; }
.panel-heading { display: flex; align-items: center; gap: 13px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.panel-heading > span { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--ink); font: 700 .72rem "Space Grotesk", sans-serif; }
.panel-heading h3, .panel-heading p { margin: 0; }
.panel-heading h3 { font-size: 1.05rem; }
.panel-heading p { margin-top: 2px; color: #888d94; font: 600 .62rem "Space Grotesk", sans-serif; letter-spacing: .1em; }
fieldset { margin: 28px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 14px; color: #42454a; font-size: .8rem; font-weight: 800; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.photo-fieldset { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.capture-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid #bbb8b0; font-size: .76rem; font-weight: 800; cursor: pointer; }
.capture-button.primary-capture { color: #fff; background: var(--ink); border-color: var(--ink); }
.capture-button:focus-within, .capture-button:hover { box-shadow: inset 0 0 0 2px currentColor; }
.photo-stage { position: relative; display: grid; place-items: center; min-height: 190px; margin-top: 9px; overflow: hidden; background: #e6e3dc; border: 1px solid #cbc8c0; touch-action: none; cursor: crosshair; }
.photo-stage canvas { display: none; width: 100%; height: auto; max-height: 310px; object-fit: contain; }
.photo-stage.has-photo canvas { display: block; }
.photo-stage.has-photo .photo-empty { display: none; }
.photo-empty { display: grid; gap: 5px; color: #7f827f; text-align: center; }
.photo-empty strong { color: #56595d; font-size: .8rem; }
.photo-empty span { font: 600 .58rem "Space Grotesk", sans-serif; letter-spacing: .1em; }
.sample-point { position: absolute; left: 50%; top: 50%; display: none; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #15171a, 0 2px 10px rgba(0,0,0,.4); transform: translate(-50%, -50%); pointer-events: none; }
.sample-point::before, .sample-point::after { position: absolute; content: ""; left: 50%; top: 50%; background: #fff; transform: translate(-50%, -50%); }
.sample-point::before { width: 42px; height: 1px; }
.sample-point::after { width: 1px; height: 42px; }
.photo-stage.has-photo .sample-point { display: block; }
.photo-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; color: #777b80; font-size: .66rem; }
.photo-status strong { color: #202328; font: 700 .75rem "Space Grotesk", sans-serif; }
.record-save-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #d8d5cd; color: #777b80; font-size: .66rem; }
.record-save-status a { color: #087d91; font-weight: 800; }
.color-input-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.color-picker { position: relative; height: 69px; overflow: hidden; border: 1px solid #c9c7c1; }
.color-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-picker span { display: block; width: 100%; height: 100%; background: #3b7f82; }
.text-field { display: grid; gap: 7px; color: #595d63; font-size: .75rem; font-weight: 700; }
.text-field input, .text-field select { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: #f8f7f4; border: 1px solid #d1cec6; border-radius: 0; outline: none; }
.text-field input:focus, .text-field select:focus { border-color: #087d91; box-shadow: 0 0 0 3px rgba(0,169,198,.12); }
.hex-field input { height: 45px; font: 700 1.08rem "Space Grotesk", sans-serif; text-transform: uppercase; }
.swatch-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 10px; }
.swatch-presets button { aspect-ratio: 1.3; background: var(--swatch); border: 2px solid #fff; outline: 1px solid #c9c7c1; }
.swatch-presets button:hover, .swatch-presets button:focus-visible { outline: 3px solid #222; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; }
.input-unit { position: relative; }
.input-unit input { padding-right: 38px; }
.input-unit b { position: absolute; right: 12px; top: 11px; color: #787b80; }
.form-actions { display: flex; gap: 9px; margin-top: 30px; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); font-size: .82rem; font-weight: 800; }
.button.primary { flex: 1; color: #fff; background: var(--ink); }
.button.secondary { color: var(--ink); background: #fff; }
.button:hover, .button:focus-visible { box-shadow: inset 0 0 0 2px currentColor; outline: none; }

.formula-panel { min-width: 0; padding: clamp(24px, 3vw, 42px); color: #f5f5f5; background: var(--panel); }
.panel-heading.inverse { border-color: #474b53; }
.panel-heading.inverse > span { color: #111; background: #f3c62d; }
.panel-heading.inverse p b { color: #b9bdc5; }
.print-button { margin-left: auto; min-height: 36px; padding: 0 12px; color: #fff; background: transparent; border: 1px solid #626771; font-size: .74rem; font-weight: 700; }
.target-stage { display: grid; grid-template-columns: 210px 1fr; gap: 28px; margin: 30px 0; }
.target-sample { display: flex; flex-direction: column; justify-content: flex-end; min-height: 142px; padding: 16px; color: #fff; background: #3b7f82; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.target-sample span { font-size: .7rem; }
.target-sample strong { font: 700 1.2rem "Space Grotesk", sans-serif; }
.target-meta { display: grid; align-content: start; }
.target-meta > p { margin: 0 0 6px; color: #9da1a9; font-size: .7rem; }
.target-meta > input { min-width: 0; padding: 0 0 10px; color: #fff; background: transparent; border: 0; border-bottom: 1px solid #4e525a; outline: 0; font-size: 1.25rem; font-weight: 700; }
.target-meta dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 0; }
.target-meta dl div { min-width: 0; }
.target-meta dt { color: #92969e; font-size: .65rem; }
.target-meta dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: .8rem; font-weight: 700; }
.mix-direction { margin: 0 0 26px; padding: 18px 20px; color: #17191d; background: #f2c934; }
.mix-direction > p:first-child { margin: 0 0 5px; font-size: .65rem; font-weight: 800; }
.mix-direction h4 { margin: 0; font-size: 1.05rem; }
.mix-direction > p:not(:first-child) { margin: 7px 0 14px; color: #47412a; font-size: .72rem; line-height: 1.6; }
.mix-direction > div { display: flex; flex-wrap: wrap; gap: 6px; }
.direction-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 4px 8px; color: #fff; background: #24272c; font-size: .67rem; font-weight: 700; }
.direction-chip i { width: 9px; height: 9px; background: var(--pigment); border: 1px solid rgba(255,255,255,.35); }
.formula-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 8px; color: #8f949d; border-bottom: 1px solid #4c5058; font-size: .67rem; text-align: left; }
td { padding: 12px 8px; border-bottom: 1px solid #3c4047; font-size: .84rem; }
th:nth-child(n+3), td:nth-child(n+3) { text-align: right; }
.pigment-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.pigment-dot { width: 11px; height: 11px; background: var(--pigment); border: 1px solid rgba(255,255,255,.32); }
.formula-footer { margin-top: 22px; }
.formula-footer > div { display: flex; justify-content: space-between; color: #fff; }
.formula-footer > div span { color: #9da1a9; }
.formula-footer > p { margin: 18px 0 0; padding: 14px 16px; color: #b8bbc1; background: #30343a; border-left: 3px solid #f3c62d; font-size: .72rem; line-height: 1.65; }
.formula-footer > p b { color: #f3c62d; }

.correction { color: #fff; background: #17191d; }
.section-title.light > p { color: #afb3b9; }
.correction-layout { display: grid; grid-template-columns: minmax(380px, .9fr) minmax(500px, 1.1fr); gap: 30px; width: min(1360px, 100%); margin: 0 auto; }
.compare-block { display: grid; grid-template-columns: 1fr 96px 1fr; min-height: 320px; }
.compare-swatch { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; padding: 22px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.compare-swatch.target { background: #3b7f82; }
.compare-swatch.current { background: #497b75; }
.compare-swatch span { font-size: .72rem; }
.compare-swatch b, .compare-swatch input[type="text"] { color: #fff; font: 700 1.05rem "Space Grotesk", sans-serif; }
.compare-swatch input[type="color"] { width: 44px; height: 44px; margin: 0 0 auto; padding: 0; background: transparent; border: 1px solid rgba(255,255,255,.65); }
.compare-swatch input[type="text"] { width: 100%; padding: 2px 0; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.52); outline: 0; text-transform: uppercase; }
.compare-arrow { display: grid; place-content: center; gap: 3px; color: #92969e; background: #272a30; text-align: center; }
.compare-arrow span { font-size: .65rem; }
.compare-arrow strong { color: #fff; font: 700 .88rem "Space Grotesk", sans-serif; }
.correction-result { padding: clamp(24px, 3vw, 38px); background: #25282e; border: 1px solid #41454d; }
.correction-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #444850; }
.correction-head > div { display: grid; color: #9fa3aa; font-size: .7rem; }
.correction-head strong { color: #fff; font-size: 1.1rem; }
.correction-head input { width: 74px; padding: 0; color: #fff; background: transparent; border: 0; border-bottom: 1px solid #737881; outline: 0; font: 700 1.1rem "Space Grotesk", sans-serif; }
.light-button { color: #111; background: #fff; border-color: #fff; }
.correction-advice { margin: 23px 0 16px; }
.correction-advice span { color: #8f949d; font-size: .68rem; }
.correction-advice h3 { margin: 5px 0 7px; font-size: 1.35rem; }
.correction-advice p { margin: 0; color: #bdc0c5; font-size: .82rem; line-height: 1.65; }
.dose-list { display: grid; gap: 8px; }
.dose-row { display: grid; grid-template-columns: 13px 1fr auto auto; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; background: #30343b; }
.dose-row i { width: 10px; height: 10px; background: var(--pigment); }
.dose-row span { font-size: .78rem; font-weight: 700; }
.dose-row small { color: #9fa3aa; }
.dose-row strong { min-width: 58px; text-align: right; }
.correction-note { margin: 16px 0 0; color: #92969e; font-size: .69rem; line-height: 1.65; }

.guide { background: #f7f6f2; }
.workflow { display: grid; grid-template-columns: repeat(5, 1fr); width: min(1360px, 100%); margin: 0 auto; padding: 0; list-style: none; border-top: 1px solid #bbb8b0; }
.workflow li { padding: 26px 20px 8px 0; border-right: 1px solid #d4d1c9; }
.workflow li + li { padding-left: 20px; }
.workflow li:last-child { border-right: 0; }
.workflow li > span { color: #008fa6; font: 700 .72rem "Space Grotesk", sans-serif; }
.workflow h3 { margin: 38px 0 12px; font-size: 1.03rem; }
.workflow p { margin: 0; color: #696c70; font-size: .78rem; line-height: 1.7; }
.limits { display: grid; grid-template-columns: 220px 1fr; gap: 24px; width: min(1360px, 100%); margin: 62px auto 0; padding: 24px 28px; color: #fff; background: #25282e; }
.limits strong { color: #f3c62d; }
.limits p { margin: 0; color: #c1c4c9; font-size: .78rem; line-height: 1.7; }
footer { display: flex; align-items: center; gap: 30px; min-height: 110px; padding: 24px clamp(24px, 5vw, 80px); color: #fff; background: #111317; }
footer a { font-weight: 800; }
footer p { margin: 0; color: #8f949d; font: 600 .65rem "Space Grotesk", sans-serif; letter-spacing: .08em; }
footer span { margin-left: auto; color: #afb3b9; font-size: .75rem; }

@media (max-width: 1050px) {
  .workbench-grid, .correction-layout { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: repeat(3, 1fr); }
  .workflow li:nth-child(3) { border-right: 0; }
  .topbar nav { gap: 18px; }
}

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 16px; }
  .topbar nav { position: absolute; left: 0; right: 0; top: 64px; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: #17191d; border-bottom: 1px solid #40434a; }
  .topbar nav.is-open { display: flex; }
  .topbar nav a { padding: 12px 4px; border-bottom: 1px solid #30333a; }
  .menu-button { display: block; }
  .hero { min-height: 640px; }
  .hero > img { object-position: 68% center; }
  .hero-overlay { background: linear-gradient(90deg, rgba(9,10,12,.9), rgba(9,10,12,.5)); }
  .hero-content { width: calc(100% - 36px); min-height: 560px; padding-bottom: 20px; }
  .hero h1 { font-size: clamp(3.4rem, 18vw, 5.2rem); }
  .hero-data { left: 18px; right: 18px; bottom: 16px; grid-template-columns: repeat(3, 1fr); }
  .hero-data div { min-width: 0; padding: 12px 10px; }
  .section { padding: 70px 16px; }
  .section-title { grid-template-columns: 1fr; gap: 18px; margin-bottom: 28px; }
  .section-title > p { font-size: .86rem; }
  .workbench-grid { border: 0; }
  .control-panel, .formula-panel { padding: 24px 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .photo-stage { min-height: 210px; }
  .target-stage { grid-template-columns: 1fr; }
  .target-sample { min-height: 120px; }
  .target-meta dl { gap: 7px; }
  .compare-block { grid-template-columns: 1fr 66px 1fr; min-height: 260px; }
  .compare-swatch { padding: 14px 10px; }
  .correction-head { align-items: flex-start; flex-direction: column; }
  .workflow { grid-template-columns: 1fr; }
  .workflow li, .workflow li + li { padding: 22px 0; border-right: 0; border-bottom: 1px solid #d4d1c9; }
  .workflow h3 { margin: 16px 0 8px; }
  .limits { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  footer span { margin-left: 0; }
}

@media print {
  .topbar, .hero, .control-panel, .correction, .guide, footer, .print-button, .section-title { display: none !important; }
  .section { padding: 0; }
  .workbench-grid { display: block; border: 0; box-shadow: none; }
  .formula-panel { color: #111; background: #fff; }
  .panel-heading.inverse, td, th { border-color: #bbb; }
  .panel-heading.inverse h3, .target-meta > input, .target-meta dd, .formula-footer > div { color: #111; }
  .formula-footer > p { color: #333; background: #f2f2f2; }
}
