/* 共用語彙讓行銷頁與工作區保持同一品牌；顏色集中以支援明暗主題。 */
/* 自行託管字型，避免外部樣式表阻擋頁面互動，離線時仍有系統字型。 */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/instrument-sans-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/space-grotesk-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); }
:root {
    --paper: #f6f7fa;
    --surface: #ffffff;
    --ink: #142637;
    --muted: #5e6c79;
    --line: #d9e1e8;
    --highlight: #ffe5b5;
    --soft: #eaf0f6;
    --accent: #173d62;
    --primary: #173d62;
    --primary-hover: #0d2b49;
    --primary-text: #ffffff;
    --brand-navy: #152c43;
    --display: 'Space Grotesk', 'Instrument Sans', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    color-scheme: light;
}
html.dark {
    --paper: #101c27;
    --surface: #1a2a3a;
    --ink: #edf2f7;
    --muted: #abbccd;
    --line: #354b60;
    --soft: #22374b;
    --accent: #ffd28c;
    --primary: #ffd28c;
    --primary-hover: #ffe5b5;
    --primary-text: #152c43;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { text-decoration: none; }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--highlight); color: var(--brand-navy); }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 100; padding: 12px 20px; background: var(--ink); color: var(--paper); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -1px; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; font-weight: 500; line-height: 1.6; letter-spacing: 1.5px; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--accent); }
.arrow { width: 18px; height: 18px; flex-shrink: 0; transition: transform 180ms ease; }
a:hover > .arrow, button:hover > .arrow { transform: translate(3px, -3px); }
.site-button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 48px; padding: 13px 20px; background: var(--primary); color: var(--primary-text); border: 1px solid var(--primary); border-radius: 6px; font-size: 13px; font-weight: 600; transition: background 180ms ease, transform 180ms ease; }
.site-button:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-2px); }
.site-button.secondary { color: var(--ink); border-color: var(--line); background: transparent; }
.site-button.secondary:hover { background: var(--soft); }
.site-link { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--ink); }
.site-container { width: min(1248px, calc(100% - 96px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 24px; }
.marketing-nav { display: flex; align-items: center; gap: 34px; }
.marketing-nav > a { color: var(--muted); font-size: 13px; transition: color 180ms ease; }
.marketing-nav > a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 24px; }
.header-actions .site-button { min-height: 40px; padding: 9px 16px; }
/* 公開文件維持行銷頁的閱讀風格，權限指令只在自身區域捲動。 */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 72px; padding-top: 56px; padding-bottom: 80px; }
.docs-sidebar { align-self: start; position: sticky; top: 120px; }
.docs-nav { display: grid; gap: 6px; margin: 24px 0; }
.docs-nav a { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; padding: 12px 14px; border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--ink); background: var(--soft); }
.docs-nav a[aria-current] { color: var(--ink); background: var(--soft); border-left-color: var(--accent); font-weight: 600; }
.docs-sidebar-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-bottom: 24px; }
.docs-article { min-width: 0; max-width: 760px; }
.docs-heading { padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.docs-heading h1 { font-family: var(--display); font-size: clamp(36px, 4.3vw, 58px); line-height: 1.12; letter-spacing: -2px; font-weight: 500; margin: 20px 0; }
.docs-lead { font-size: 18px; line-height: 1.8; color: var(--muted); }
.docs-reviewed { font-family: var(--mono); color: var(--muted); font-size: 11px; margin-top: 24px; }
.docs-article section { margin: 40px 0; }
.docs-article section h2 { font-family: var(--display); font-size: 25px; line-height: 1.4; letter-spacing: -.6px; margin: 0 0 16px; font-weight: 500; }
.docs-article section p, .docs-article section li { font-size: 15px; line-height: 1.9; margin: 0 0 16px; }
.docs-article section a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.docs-article section ul { padding-left: 22px; list-style: disc; }
.docs-article section code { font-family: var(--mono); font-size: .82em; background: var(--soft); padding: 2px 4px; border-radius: 3px; overflow-wrap: anywhere; }
.docs-steps { padding: 0; list-style: none; counter-reset: docs-step; }
.docs-steps li { position: relative; padding: 16px 0 16px 48px; border-bottom: 1px solid var(--line); counter-increment: docs-step; }
.docs-steps li::before { content: '0' counter(docs-step); position: absolute; left: 0; top: 18px; color: var(--accent); font: 12px var(--mono); }
.docs-steps li strong, .docs-steps li span { display: block; }
.docs-steps li span { color: var(--muted); margin-top: 6px; }
.docs-callout { padding: 22px 24px; border-left: 3px solid #b98a43; border-radius: 0 8px 8px 0; background: #fff4df; margin: 24px 0; }
.docs-callout p:last-child { margin-bottom: 0; }
.docs-faq { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.docs-faq summary { font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.7; }
.docs-faq p { padding-top: 16px; }
.docs-next { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 24px; }
.docs-page .permission-guide { margin: 40px 0; border: 1px solid var(--line); box-shadow: none; }
.docs-page .permission-guide pre { max-width: 100%; }
.landing-doc-links { display: flex; flex-wrap: wrap; gap: 18px; }
.landing-doc-links a { color: var(--muted); font-size: 12px; }
.landing-doc-links a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 1023px) {
    .docs-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 767px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 24px; }
    .docs-sidebar { position: static; }
    .docs-nav { margin: 12px 0; }
    .docs-nav a { padding: 8px 12px; }
    .docs-sidebar-note, .docs-sidebar > .site-link { display: none; }
    .docs-heading { margin-bottom: 28px; }
    .docs-lead { font-size: 16px; }
    .docs-page .permission-guide { padding: 16px; }
    .docs-page .brand { font-size: 18px; }
    .docs-callout { padding: 18px; }
    .landing-doc-links { justify-content: center; }
}
/* Hero 的資料圖形是產品敘事的一部分，固定比例避免載入時位移。 */
.hero { padding: 72px 0 52px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.hero .eyebrow { margin: 0 0 28px; }
.hero h1 { font-family: var(--display); font-size: clamp(52px, 5.8vw, 84px); font-weight: 500; line-height: 1.05; letter-spacing: -5px; margin: 0 0 26px; }
.hero h1 span { display: block; }
.hero h1 .hero-emphasis { color: var(--accent); }
.hero-description { max-width: 440px; font-size: 16px; line-height: 1.75; color: var(--muted); margin: 0 0 30px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.hero-note { margin: 18px 0 0; font-size: 11px; color: var(--muted); }
.warehouse-art { position: relative; padding: 28px; background: #e6edf3; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.art-heading { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.art-heading span:last-child { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #5c7d9a; }
.warehouse-map { width: 100%; height: auto; margin: 28px 0 0; overflow: visible; }
.map-block { transition: opacity 400ms ease; }
.map-block:hover { opacity: .55; }
.map-scan { animation: scan 9s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateX(0); opacity: .1; } 45% { opacity: .7; } 80% { transform: translateX(330px); opacity: .1; } }
.art-caption { display: flex; gap: 20px; font-family: var(--mono); font-size: 9px; color: var(--muted); margin: 16px 0 24px; }
.art-caption span { display: inline-flex; align-items: center; gap: 7px; }
.legend-square { width: 7px; height: 7px; background: #5c7d9a; }
.legend-square.idle { background: #b98a43; }
.art-insight { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--brand-navy); border-radius: 6px; color: #fff; }
.art-insight p { margin: 0; font-size: 12px; color: #c7cbd3; }
.art-insight strong { display: block; font-family: var(--display); font-size: 28px; font-weight: 500; color: var(--highlight); letter-spacing: -1px; line-height: 1.3; }
.art-insight .arrow { width: 28px; height: 28px; color: var(--highlight); }
.hero-bottom { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-bottom p { margin: 0; color: var(--muted); font-size: 11px; }
.hero-principles { display: flex; gap: 36px; }
.hero-principles > span { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 11px; }
.hero-principles svg { width: 14px; height: 14px; }
.landing-section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: end; margin-bottom: 42px; }
.section-heading .eyebrow { margin: 0 0 20px; }
.section-heading h2, .trust-heading h2 { font-family: var(--display); font-size: clamp(34px, 3.5vw, 48px); font-weight: 500; line-height: 1.12; letter-spacing: -2.3px; margin: 0; }
.section-heading > p { margin: 0 0 4px; max-width: 400px; font-size: 15px; color: var(--muted); line-height: 1.8; }
.demo-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.demo-toolbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.demo-title { display: flex; align-items: center; gap: 12px; }
.demo-title > span { width: 34px; height: 34px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; }
.demo-title svg { width: 17px; height: 17px; }
.demo-title h3 { font-size: 14px; font-weight: 600; margin: 0; }
.demo-title p { font-family: var(--mono); font-size: 10px; color: var(--muted); margin: 4px 0 0; }
.demo-filters { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.demo-filters button { cursor: pointer; min-height: 36px; border: 0; padding: 6px 14px; font-size: 12px; color: var(--muted); background: transparent; border-radius: 4px; }
.demo-filters button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.demo-table { width: 100%; border-collapse: collapse; text-align: left; }
.demo-table th { padding: 14px 28px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; }
.demo-table td { padding: 20px 28px; border-top: 1px solid var(--line); font-size: 13px; }
.demo-table td:first-child { font-family: var(--mono); font-size: 12px; }
.demo-table td:first-child span { display: block; margin-top: 6px; font-family: 'Instrument Sans', sans-serif; font-size: 11px; color: var(--muted); }
.demo-table td:nth-child(2) { color: var(--muted); font-size: 12px; }
.days-pill { display: inline-block; border: 1px solid #e0d2ba; border-radius: 4px; padding: 5px 9px; background: #fbf5e9; color: #80571d; font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.demo-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.demo-table th:last-child { text-align: right; }
.demo-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid var(--line); padding: 16px 28px; color: var(--muted); font-size: 11px; }
.demo-footer > p { margin: 0; }
.demo-footer strong { color: var(--ink); font-weight: 500; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 40px; }
.feature-strip article { position: relative; padding-left: 28px; }
.feature-strip article > span { position: absolute; left: 0; top: 2px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.feature-strip h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.feature-strip p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.workflow-section { background: var(--brand-navy); color: #edf2f7; border-color: var(--brand-navy); }
.workflow-section .eyebrow { color: #c7cbd3; }
.workflow-section .eyebrow::before { background: var(--highlight); }
.workflow-section .section-heading > p { color: #c7cbd3; }
.workflow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 56px; }
.workflow-steps article { padding: 0 36px; border-left: 1px solid #586271; }
.workflow-steps article:first-child { border-left: 0; padding-left: 0; }
.workflow-steps article:last-child { padding-right: 0; }
.step-index { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.step-index > span { font-family: var(--display); font-size: 36px; letter-spacing: -2px; color: var(--highlight); }
.step-index svg { width: 24px; height: 24px; color: #c7cbd3; }
.workflow-steps h3 { font-family: var(--display); font-size: 21px; font-weight: 400; margin: 0 0 14px; letter-spacing: -.7px; }
.workflow-steps p { color: #c7cbd3; font-size: 13px; line-height: 1.8; margin: 0; }
.trust-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 100px; }
.trust-heading .eyebrow { margin: 0 0 20px; }
.trust-heading p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 22px 0 0; max-width: 350px; }
.trust-details { display: grid; gap: 0; }
.trust-details details { border-bottom: 1px solid var(--line); }
.trust-details details:first-child { border-top: 1px solid var(--line); }
.trust-details summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; cursor: pointer; font-size: 15px; font-weight: 500; list-style: none; }
.trust-details summary::-webkit-details-marker { display: none; }
.trust-details summary::after { content: '+'; font-family: var(--mono); font-size: 18px; font-weight: 400; }
.trust-details details[open] summary::after { content: '−'; }
.trust-details details p { margin: 0 32px 24px 0; color: var(--muted); line-height: 1.8; font-size: 13px; }
.trust-details code { font-size: 11px; overflow-wrap: anywhere; }
.final-cta { padding: 0 0 80px; }
.cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 48px; padding: 54px 56px; background: var(--highlight); color: var(--brand-navy); border-radius: 10px; }
.cta-panel .eyebrow::before { background: var(--brand-navy); }
.cta-panel h2 { font-family: var(--display); font-size: 42px; font-weight: 500; line-height: 1.15; letter-spacing: -2px; margin: 16px 0 12px; }
.cta-panel p { margin: 0; font-size: 13px; color: var(--brand-navy); }
.cta-panel .site-button { white-space: nowrap; }
.site-footer { padding: 28px 0 32px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer-inner .brand { font-size: 15px; letter-spacing: -.5px; }
.footer-inner .brand-mark { width: 24px; height: 24px; }
.footer-inner p { margin: 0; font-family: var(--mono); font-size: 9px; color: var(--muted); }
/* 內容預設可見，漸進增強失敗或停用 JavaScript 時仍能閱讀與操作。 */
@media (prefers-reduced-motion: no-preference) {
    .reveal.is-visible { animation: reveal-in 650ms cubic-bezier(.2,.7,.2,1) both; }
    @keyframes reveal-in { from { opacity: .45; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
}
/* 工作區保留資料密度，透過標題與邊界建立層級。 */
.app-header { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 40; }
.app-header-inner { display: flex; align-items: center; gap: 40px; min-height: 76px; }
.app-header .brand { font-size: 18px; }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a, .app-nav button { position: relative; color: var(--muted); min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 12px; font-weight: 500; border-radius: 6px; transition: background 150ms ease; cursor: pointer; }
.app-nav svg { width: 15px; height: 15px; }
.app-nav a:hover, .app-nav button:hover { background: var(--paper); color: var(--ink); }
.logout-error { position: absolute; top: 100%; right: 24px; padding: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; box-shadow: 0 4px 20px #101c2712; }
.app-nav a[aria-current="page"] { background: var(--soft); color: var(--ink); }
.app-nav a[aria-current="page"]::after { content: ''; position: absolute; bottom: -17px; height: 2px; background: var(--accent); left: 14px; right: 14px; }
.app-account { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.app-account-name { font-size: 11px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; min-width: 40px; min-height: 40px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--soft); }
.app-main { padding-top: 48px; padding-bottom: 80px; min-height: calc(100vh - 155px); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 32px; }
.page-heading .eyebrow { color: var(--muted); margin: 0 0 12px; }
.page-heading h1 { font-family: var(--display); font-size: 36px; font-weight: 500; line-height: 1.16; letter-spacing: -1.8px; margin: 0; overflow-wrap: anywhere; }
.page-heading p:not(.eyebrow) { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; flex-shrink: 0; }
.app-surface { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.section-bar h2 { font-size: 14px; font-weight: 600; margin: 0; }
.section-bar p { color: var(--muted); font-family: var(--mono); font-size: 10px; margin: 0; }
.report-section-bar { padding-left: 0; padding-right: 0; border-bottom: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.metric p { font-size: 11px; color: var(--muted); margin: 0; }
.metric strong { font-family: var(--display); font-size: 32px; font-weight: 500; letter-spacing: -1.3px; line-height: 1.3; display: block; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11px; color: var(--muted); }
.metric-highlight { background: var(--soft); border-color: var(--line); }
.report-card { border: 1px solid var(--line); box-shadow: none; }
.report-card > summary { min-height: 92px; }
.report-card > summary h2 { font-family: var(--display); font-size: 16px; letter-spacing: -.3px; }
.report-card .report-meta { display: block; margin: 7px 0 0; font-family: var(--mono); font-size: 10px; }
.report-card a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.report-summary { color: var(--muted); font-size: 11px; }
/* 定位脈絡讓讀屏器專用的絕對定位標籤留在表格內，避免撐寬手機頁面。 */
.table-scroll { position: relative; overflow-x: auto; width: 100%; }
.app-main table th { font-weight: 500; font-size: 10px; letter-spacing: .6px; }
.app-main table td { font-size: 12px; }
.app-main table td, .app-main table th { padding: 18px 24px; }
.app-main table td:first-child { color: var(--ink); }
.connection-project { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.connection-id { display: block; font-size: 10px; color: var(--muted); margin-top: 7px; font-family: var(--mono); overflow-wrap: anywhere; }
.app-main .shadow, .app-main .shadow-sm { box-shadow: none; }
.app-main .bg-white.rounded-lg { border: 1px solid var(--line); border-radius: 10px; }
.app-main a.bg-blue-600, .app-main button.bg-blue-600 { background: var(--primary); color: var(--primary-text); }
.app-main a.bg-blue-600:hover, .app-main button.bg-blue-600:hover { background: var(--primary-hover); }
.app-main .inline-flex.border.rounded-md { min-height: 42px; padding: 11px 16px; font-size: 12px; border-radius: 6px; }
.app-main input:not([type="hidden"]):not([type="checkbox"]), .app-main select, .app-main textarea { min-height: 46px; font-size: 14px; }
.app-main input[type="file"] { padding: 20px; font-size: 12px; }
.app-main input[type="file"]::file-selector-button { background: var(--primary); padding: 11px 16px; margin-right: 14px; color: var(--primary-text); border-radius: 4px; }
.app-main label { font-size: 12px; margin-bottom: 9px; }
.app-main pre { font-family: var(--mono); }
.table-metrics > div { border: 1px solid var(--line); }
.table-metrics .text-lg { font-family: var(--display); font-size: 24px; letter-spacing: -.7px; line-height: 1.3; }
.app-main p a, .app-main li a { text-decoration: underline; text-underline-offset: 3px; }
.permission-guide > p { font-size: 13px; line-height: 1.8; }
.permission-guide :not(pre) > code { color: var(--ink); background: var(--soft); font-size: .85em; }
.permission-guide .bg-green-500 { background: var(--highlight); color: var(--brand-navy); }
.app-footer { border-top: 1px solid var(--line); padding: 22px 0; }
.app-footer .footer-inner p { font-size: 9px; }
.app-footer a { color: var(--muted); font-size: 11px; }
.empty-state { padding: 64px 32px; text-align: center; }
.empty-illustration { width: 144px; height: 104px; margin: 0 auto 24px; color: var(--ink); }
.empty-state h2 { font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: -.8px; margin: 0 0 12px; }
.empty-state p { max-width: 380px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-state .empty-action { margin-top: 24px; }
.setup-aside { padding: 30px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.setup-aside h2 { font-family: var(--display); font-size: 26px; letter-spacing: -1px; font-weight: 500; margin: 0 0 18px; }
.setup-aside p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0 0 22px; }
.setup-aside .setup-fact { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.setup-aside .setup-fact strong { font-size: 13px; color: var(--ink); display: block; margin-bottom: 6px; }
.mobile-nav { display: none; }
.mobile-menu-toggle { display: none; }
@media (max-width: 1100px) {
    .hero-grid { gap: 36px; }
    .hero h1 { font-size: clamp(44px, 5.8vw, 64px); letter-spacing: -3px; }
    .app-header-inner { gap: 20px; }
    .app-account-name { display: none; }
    .trust-layout { gap: 48px; }
}
@media (max-width: 800px) {
    .site-container { width: calc(100% - 48px); }
    .site-header-inner { height: 68px; }
    .marketing-nav { display: none; }
    .hero { padding: 48px 0 36px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero h1 { font-size: clamp(50px, 9vw, 76px); letter-spacing: -3px; }
    .hero-description { max-width: 500px; }
    .warehouse-art { max-width: 540px; width: 100%; justify-self: center; }
    .hero-bottom { margin-top: 32px; flex-wrap: wrap; gap: 18px; }
    .hero-principles { gap: 20px; }
    .landing-section { padding: 64px 0; }
    .section-heading { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
    .section-heading > p { max-width: 480px; }
    .feature-strip { gap: 24px; }
    .workflow-steps article { padding: 0 20px; }
    .workflow-steps h3 { font-size: 18px; }
    .trust-layout { grid-template-columns: 1fr; gap: 32px; }
    .cta-panel { padding: 36px; }
    .cta-panel h2 { font-size: 34px; }
    .app-header-inner { min-height: 68px; }
    .app-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .mobile-nav { display: block; position: absolute; left: 0; right: 0; top: 68px; padding: 12px 24px 20px; border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 20px #101c270a; }
    .mobile-nav a, .mobile-nav button { display: flex; width: 100%; min-height: 46px; align-items: center; padding: 12px; color: var(--muted); font-size: 14px; border-radius: 4px; cursor: pointer; }
    .mobile-nav a[aria-current="page"] { background: var(--soft); color: var(--ink); }
    .mobile-nav svg { width: 16px; height: 16px; margin-right: 12px; }
    .app-main { padding-top: 32px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
    .page-heading h1 { font-size: 32px; }
    .heading-actions { flex-wrap: wrap; flex-shrink: 1; }
}
@media (max-width: 540px) {
    .site-container { width: calc(100% - 40px); }
    .brand { font-size: 17px; gap: 8px; }
    .brand-mark { width: 28px; height: 28px; }
    .header-actions { gap: 12px; }
    .header-actions .site-link { font-size: 12px; }
    .header-actions .site-button { padding: 9px 12px; gap: 10px; font-size: 11px; }
    .header-start { display: none; }
    .hero h1 { font-size: clamp(34px, 10.3vw, 48px); letter-spacing: -2px; }
    .hero-description { font-size: 14px; }
    .hero-actions { gap: 18px; }
    .hero-actions .site-button { gap: 16px; padding: 13px 16px; }
    .warehouse-art { padding: 20px; }
    .art-caption { gap: 14px; font-size: 8px; }
    .hero-principles { flex-wrap: wrap; gap: 12px 20px; }
    .hero-bottom > p { display: none; }
    .section-heading h2, .trust-heading h2 { font-size: 35px; letter-spacing: -1.7px; }
    .section-heading > p { font-size: 14px; }
    .demo-toolbar { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
    .demo-table th, .demo-table td { padding: 15px 16px; }
    .demo-table th:nth-child(2), .demo-table td:nth-child(2) { display: none; }
    .demo-table th { font-size: 9px; }
    .demo-table td:first-child { font-size: 10px; overflow-wrap: anywhere; }
    .demo-table td:first-child span { font-size: 10px; }
    .demo-table td:last-child { font-size: 11px; }
    .demo-footer { padding: 16px; align-items: flex-start; flex-direction: column; gap: 8px; font-size: 10px; }
    .feature-strip { grid-template-columns: 1fr; gap: 28px; margin-top: 32px; }
    .workflow-steps { grid-template-columns: 1fr; margin-top: 32px; }
    .workflow-steps article, .workflow-steps article:first-child, .workflow-steps article:last-child { padding: 24px 0; border-left: 0; border-top: 1px solid #586271; }
    .step-index { margin-bottom: 16px; }
    .workflow-steps h3 { font-size: 22px; }
    .cta-panel { flex-direction: column; align-items: flex-start; gap: 28px; padding: 28px; }
    .cta-panel h2 { font-size: 32px; }
    .final-cta { padding-bottom: 48px; }
    .footer-inner { flex-wrap: wrap; gap: 16px; }
    .app-account { gap: 8px; }
    .app-header .brand { font-size: 17px; }
    .metric-grid { gap: 8px; }
    .metric { padding: 16px 12px; }
    .metric p { font-size: 10px; }
    .metric strong { font-size: 26px; }
    .metric small { font-size: 10px; line-height: 1.5; display: block; }
    .report-card > summary { padding: 20px; }
    .report-card > div { padding: 20px; }
    .app-main table th, .app-main table td { padding: 14px 18px; }
    .app-main table { min-width: 520px; }
    .app-main .detail-table { min-width: 0; }
    .app-main .detail-table th { width: 112px; }
    .app-main .detail-table td { overflow-wrap: anywhere; }
    .empty-state { padding: 40px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 查詢摘要沿用既有表面與字級，小螢幕只在資料表內捲動。 */
.query-cost-section { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.query-cost-section .section-bar { flex-wrap: wrap; gap: 10px; }
.query-section-title, .query-detail-section h2 { font-family: var(--display); font-size: 20px; margin: 0 0 16px; }
.query-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 10px 0; overflow-wrap: anywhere; }
.query-warning { color: var(--ink); border-left: 3px solid var(--accent); padding-left: 12px; }
.query-pattern-list { display: grid; gap: 12px; margin: 20px 0; }
.query-pattern { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.query-pattern-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 15px; }
.query-pattern-heading strong { font-family: var(--mono); font-size: 14px; }
.query-pattern-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.query-pattern-grid dt { color: var(--muted); font-size: 11px; }
.query-pattern-grid dd { color: var(--ink); font-size: 13px; margin: 6px 0 0; overflow-wrap: anywhere; }
.query-pattern-grid small { display: block; color: var(--muted); margin-top: 4px; }
.query-detail-section { padding: 24px; margin-top: 24px; min-width: 0; }
.query-table { width: 100%; font-size: 13px; text-align: left; }
.query-table th, .query-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.query-table th { color: var(--muted); font-weight: 500; }
.query-identity, .query-job-id { overflow-wrap: anywhere; word-break: break-word; }
.query-table .query-identity { min-width: 180px; max-width: 300px; }
.query-execution { border-top: 1px solid var(--line); }
.query-execution summary { display: grid; gap: 8px; padding: 20px 0; cursor: pointer; font-size: 13px; }
.query-execution summary span:last-child { color: var(--accent); }
.query-execution-body { padding-bottom: 20px; }
.query-sql-block { min-width: 0; padding-top: 8px; }
.query-sql-text { margin: 12px 0 0; padding: 20px; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow: auto; max-height: 360px; }
.query-copy-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer; }
.query-copy-button:hover { border-color: var(--accent); }
.query-pagination { margin-top: 24px; }
.query-metrics .metric strong { overflow-wrap: anywhere; font-size: clamp(20px, 3vw, 30px); }
.query-period { display: block; margin-top: 8px; }
@media (max-width: 479px) {
    .query-metrics { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .query-pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .query-detail-section { padding: 18px; }
}
