@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #16221f;
  --muted: #78847f;
  --line: #e3e9e5;
  --paper: #f2f5f2;
  --panel: #fff;
  --green: #176b52;
  --green-dark: #10523f;
  --lime: #c5ed71;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', 'Noto Sans TC', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #dfe6e1; gap: 16px; }
.topbar-nav { display: flex; align-items: center; gap: 10px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #dbe3dc; border-radius: 6px; color: #4e5f57; text-decoration: none; font-size: 11px; font-weight: 600; background: #fff; transition: all .15s; }
.nav-link:hover { border-color: var(--green); color: var(--green); background: #f7faf7; }
.nav-link.active { border-color: var(--green); background: #edf5ed; color: var(--green); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700; letter-spacing: .03em; }
.brand-mark { width: 21px; height: 21px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; transform: rotate(-7deg); }
.brand-mark i { background: var(--green); border-radius: 2px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: #8db63c; }
.airgap { display: flex; align-items: center; gap: 8px; color: #5a6962; font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.airgap span, .state-pill i, .camera-badge i { width: 7px; height: 7px; display: inline-block; border-radius: 100%; background: #80b848; box-shadow: 0 0 0 3px #e6f1d9; }
.intro { padding: 43px 0 25px; }
.eyebrow { margin: 0 0 8px; color: #719081; font: 10px var(--mono); letter-spacing: .13em; }
.intro h1 { margin: 0; font-size: clamp(30px, 4vw, 43px); line-height: 1.25; letter-spacing: -.045em; }
.lede { margin: 11px 0 0; color: #6e7b75; font-size: 13px; }
.tabs { height: 57px; position: relative; display: flex; gap: 27px; border-bottom: 1px solid #dce4de; }
.tab { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 5px; border: 0; color: #7b8780; background: none; font-size: 13px; font-weight: 600; }
.tab.active { color: var(--green); }
.tab-icon { font-size: 16px; }
.tab-rail { position: absolute; bottom: -1px; left: 0; width: 106px; height: 2px; background: var(--green); transition: transform .2s; }
.tabs[data-active="receive"] .tab-rail { transform: translateX(132px); width: 100px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .92fr); gap: 18px; padding: 20px 0 40px; }
.panel { min-width: 0; padding: 24px; border: 1px solid #e5ebe6; border-radius: 10px; background: var(--panel); box-shadow: 0 6px 24px #233b2b08; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 21px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.step-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e0e7e1; border-radius: 50%; color: #91a098; font: 11px var(--mono); }
.dropzone { min-height: 142px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; border: 1px dashed #cbd8ce; border-radius: 7px; background: #fafcf9; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: var(--green); background: #f1f8ed; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-glyph { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--green); background: #eaf3e7; font-size: 20px; }
.drop-title { color: #45544d; font-size: 12px; }
.drop-title span { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.drop-subtitle { color: #99a49e; font-size: 10px; }
.file-details, .received-file { display: flex; align-items: center; gap: 11px; padding: 13px 12px; border: 1px solid #e4ebe5; border-radius: 7px; }
.file-details { margin-top: 12px; }
.file-icon { flex: 0 0 auto; width: 34px; height: 36px; display: grid; place-items: center; color: var(--green); background: #edf4ed; border-radius: 5px; font: 8px var(--mono); }
.file-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.file-copy strong { overflow: hidden; color: #35443c; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-copy span { color: #8b9890; font-size: 10px; }
.icon-button { width: 28px; height: 28px; border: 0; border-radius: 50%; color: #87948c; background: #f2f5f2; font-size: 19px; }
.settings { margin-top: 19px; border-top: 1px solid #edf0ed; }
.speed-card { margin-top: 16px; padding: 14px 16px; border: 1px solid #dce8dd; border-radius: 8px; background: #f6faf6; display: flex; flex-direction: column; gap: 10px; }
.speed-card-header { display: flex; justify-content: space-between; align-items: center; }
.speed-card-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #2d5543; }
.speed-card-title span.glyph { color: #5f9736; font-size: 14px; }
.speed-badge { padding: 3px 7px; border-radius: 4px; background: #e3f0df; color: #356848; font: 9px var(--mono); font-weight: 600; }
.speed-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 4px; border-top: 1px dashed #d5e2d7; }
.speed-metric-item { display: flex; flex-direction: column; gap: 3px; }
.speed-metric-label { font-size: 9px; color: #73847b; }
.speed-metric-val { font: 15px var(--mono); font-weight: 700; color: var(--green); letter-spacing: -.02em; }
.speed-metric-sub { font-size: 9px; color: #88998f; }
.speed-card-tip { margin: 0; font-size: 9px; line-height: 1.5; color: #6a7d73; }

/* Hub Index Page Cards */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0 60px; }
.hub-card { display: flex; flex-direction: column; justify-content: space-between; padding: 32px 28px; border: 1px solid #e1e8e2; border-radius: 12px; background: #fff; text-decoration: none; color: inherit; box-shadow: 0 8px 24px #1b382708; transition: transform .2s, border-color .2s, box-shadow .2s; }
.hub-card:hover { transform: translateY(-3px); border-color: var(--green); box-shadow: 0 12px 32px #176b5215; }
.hub-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.hub-glyph { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; font-size: 24px; background: #eaf4eb; color: var(--green); }
.hub-card:nth-child(2) .hub-glyph { background: #eef3fb; color: #2e62a8; }
.hub-card h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.hub-card p { margin: 0 0 24px; color: #697871; font-size: 13px; line-height: 1.6; }
.hub-card-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--green); }
.hub-card-cta span { font-size: 16px; transition: transform .15s; }
.hub-card:hover .hub-card-cta span { transform: translateX(4px); }
.setting-row { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid #edf0ed; }
.setting-label { display: flex; flex-direction: column; gap: 4px; }
.setting-label strong { font-size: 11px; font-weight: 600; }
.setting-label span { color: #9aa49e; font-size: 9px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 31px; height: 18px; position: relative; border-radius: 20px; background: #cad3cd; transition: background .2s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: white; transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(13px); }
.switch-label { min-width: 57px; color: var(--green); font: 9px var(--mono); }
.range-control { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.range-control input { width: 140px; height: 3px; accent-color: var(--green); }
.range-control output { color: #718078; font: 9px var(--mono); }
.action-row { display: flex; align-items: center; gap: 16px; margin-top: 19px; }
.button { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 5px; font-size: 11px; font-weight: 600; text-decoration: none; transition: background .15s, transform .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-primary span { font-size: 15px; }
.privacy-note { color: #96a29a; font-size: 9px; }
.lock { margin-right: 4px; color: #78a15a; }
.status-line { min-height: 15px; margin: 12px 0 0; color: #75837b; font-size: 10px; }
.display-panel { display: flex; flex-direction: column; }
.display-heading { margin-bottom: 12px; }
.state-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid #e5ebe6; border-radius: 20px; color: #839087; font: 9px var(--mono); }
.receive-heading-tools { display: flex; align-items: center; gap: 10px; }
.receive-mode-switch { gap: 6px; }
.state-pill i { width: 5px; height: 5px; background: #a9b4ad; box-shadow: none; }
.state-pill.live { color: var(--green); background: #f3f8ef; border-color: #e4eedc; }
.state-pill.live i { background: #86b64b; box-shadow: 0 0 0 3px #e2f0d7; }
.qr-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 9px 0 12px; }
.qr-frame { position: relative; width: min(100%, 330px); aspect-ratio: 1; display: grid; place-items: center; padding: 12px; border: 1px solid #edf0ed; border-radius: 7px; background: #fff; }
.qr-frame canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.qr-placeholder { position: absolute; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #a4afa8; background: repeating-linear-gradient(45deg, #fafbf9, #fafbf9 8px, #f7f9f6 8px, #f7f9f6 16px); text-align: center; font-size: 11px; line-height: 1.7; }
.placeholder-glyph { color: #b0c0b3; font-size: 40px; line-height: 1; }
.qr-caption { width: min(100%, 330px); display: flex; justify-content: space-between; margin-top: 10px; color: #9ba69f; font: 8px var(--mono); letter-spacing: .06em; }
.qr-caption b { color: #48564e; font-weight: 500; }
.transmit-controls { display: flex; gap: 8px; margin-top: 4px; }
.transmit-controls .button { flex: 1; }
.button-dark { color: white; background: #213b31; }
.button-dark:hover:not(:disabled) { background: #162b23; }
.button-outline { color: #55645b; border-color: #dfe7e0; background: #fff; }
.button-outline:hover:not(:disabled) { background: #f5f8f4; }
.progress-wrap { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #909d94; font-size: 9px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 5px; background: #edf1ed; }
.progress-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: #8ab846; transition: width .15s; }
.display-hint { margin: 12px 0 0; color: #9aa49e; font-size: 9px; line-height: 1.6; }
.receive-workspace { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.camera-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: #111a16; }
.camera-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; color: #c0cdc5; background: radial-gradient(ellipse at 50% 35%, #21382e, #101a15 72%); }
.camera-placeholder strong { font-size: 12px; }
.camera-placeholder span:last-child { color: #819189; font-size: 9px; }
.camera-glyph { color: #c5ed71; font-size: 37px; }
.camera-corners { position: absolute; inset: 13%; pointer-events: none; }
.camera-corners i { position: absolute; width: 20px; height: 20px; border-color: #c5ed71; border-style: solid; }
.camera-corners i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
.camera-corners i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
.camera-corners i:nth-child(3) { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.camera-corners i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.camera-badge { position: absolute; right: 10px; bottom: 9px; display: none; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 3px; color: #d7e4da; background: #07100db8; font: 8px var(--mono); }
.camera-badge.visible { display: flex; }
.camera-badge i { width: 5px; height: 5px; box-shadow: none; }
.camera-actions { display: flex; gap: 8px; margin-top: 14px; }
.camera-actions .button { min-width: 142px; }
.camera-actions select { min-width: 0; flex: 1; height: 40px; padding: 0 10px; border: 1px solid #e1e8e2; border-radius: 5px; color: #5e6d64; background: white; font-size: 10px; }
.receive-empty { min-height: 290px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; border: 1px dashed #e1e8e2; border-radius: 6px; color: #909d94; text-align: center; }
.empty-symbol { color: #a5be9b; font-size: 34px; }
.receive-empty strong { color: #5d6c63; font-size: 12px; }
.receive-empty span { font-size: 10px; }
.receive-details { padding: 2px 0 0; }
.receive-count { display: flex; align-items: baseline; gap: 5px; margin: 23px 0 12px; }
.receive-count strong { color: var(--green); font: 36px var(--mono); letter-spacing: -.06em; }
.receive-count span { color: #9ba69f; font-size: 10px; }
.receive-track { height: 6px; margin-bottom: 8px; }
.chunk-map { max-height: 104px; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; overflow: auto; margin-top: 14px; padding: 1px; }
.chunk-cell { aspect-ratio: 1; min-width: 3px; border-radius: 2px; background: #e9eeea; }
.chunk-cell.received { background: #8ab846; }
.download-area { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid #e0ebd9; border-radius: 6px; background: #f7fbf3; }
.verified-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #6f9e43; font-size: 12px; }
.download-area > div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.download-area strong { color: #476137; font-size: 10px; }
.download-area span:not(.verified-mark) { color: #87977d; font-size: 9px; }
.download-area .button { min-height: 34px; padding: 0 10px; font-size: 9px; white-space: nowrap; }
.text-button { margin-top: 16px; padding: 0; border: 0; color: #9aa59d; background: none; font-size: 9px; text-decoration: underline; text-underline-offset: 3px; }
.footer { display: flex; justify-content: space-between; padding: 15px 0 24px; border-top: 1px solid #dfe6e1; color: #9aa69f; font: 8px var(--mono); letter-spacing: .06em; }
.hidden { display: none !important; }

@media (max-width: 850px) {
  .shell { width: min(100% - 32px, 600px); }
  .workspace, .receive-workspace, .hub-grid { grid-template-columns: 1fr; }
  .display-panel { min-height: 610px; }
  .receive-empty { min-height: 220px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 24px); }
  .topbar { height: 62px; }
  .intro { padding-top: 32px; }
  .lede { max-width: 340px; line-height: 1.7; }
  .panel { padding: 17px; }
  .workspace { gap: 12px; padding-top: 14px; }
  .setting-label span { max-width: 170px; }
  .range-control input { width: 112px; }
  .display-panel { min-height: 0; }
  .qr-frame { width: min(100%, 320px); }
  .action-row { gap: 10px; }
  .privacy-note { font-size: 8px; }
  .footer span:last-child { max-width: 145px; text-align: right; }
  .download-area { flex-wrap: wrap; }
  .download-area .button { margin-left: 32px; }
}
