:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: #121316;
  color: #f1f1f4;
  --panel: #191b20;
  --line: #2e3038;
  --text-muted: #a8aab5;
  --accent: #ff705e;
  --accent-hover: #ff897a;
  --good: #7bd5af;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p, dl, dd { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(100% - 4.5rem, 76rem); margin-inline: auto; }

.topbar { border-bottom: 1px solid #282a31; background: #141519; }
.topbar-inner { min-height: 4.125rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.wordmark { display: flex; align-items: center; gap: .7rem; font-size: 1.2rem; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.brand-icon { width: 1.9rem; height: 1.9rem; background: var(--accent); border-radius: .49rem; display: grid; place-items: center; position: relative; }
.brand-icon::before { content: ""; width: 1.1rem; height: .79rem; border: 1.65px solid #241715; border-radius: .2rem; }
.brand-icon::after { content: ""; position: absolute; width: .3rem; height: .3rem; background: #241715; border-radius: 50%; }
.privacy { display: flex; align-items: center; gap: .38rem; color: var(--text-muted); font-size: .875rem; }
.privacy .icon { color: var(--good); width: 1rem; height: 1rem; }

main.shell { padding-block: 2.45rem 3.5rem; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.45rem; }
h1 { font-size: clamp(1.85rem, 3.8vw, 2.45rem); letter-spacing: .025em; line-height: 1.18; font-weight: 760; }
.title-row p { color: var(--text-muted); font-size: 1rem; margin-top: .54rem; line-height: 1.6; }
.state-badge { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; min-height: 2.1rem; padding-inline: .8rem; background: #1c1e24; border: 1px solid #333640; border-radius: 999px; white-space: nowrap; font-size: .875rem; color: #d0d2db; margin-bottom: .09rem; }
.state-badge strong { font-weight: 600; }
.state-badge span, .clock-dot { width: .46rem; height: .46rem; border-radius: 50%; background: #858998; flex: none; }
.state-badge[data-state="recording"] { color: #ffd0c9; border-color: #79483f; background: #332320; }
.state-badge[data-state="recording"] span, .clock-dot[data-state="recording"] { background: var(--accent); box-shadow: 0 0 0 3px #ff705e20; }
.state-badge[data-state="paused"] span, .clock-dot[data-state="paused"] { background: #f1c589; }
.state-badge[data-state="ready"] span { background: var(--good); }
.compatibility { padding: .75rem 1rem; border: 1px solid #704439; background: #30211f; color: #ffd9cd; border-radius: .7rem; margin-bottom: 1rem; line-height: 1.55; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 19rem); align-items: start; gap: 1.15rem; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: .86rem; box-shadow: 0 12px 35px #07080b30; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: 1rem 1.1rem; min-height: 3.45rem; }
.panel-header h2 { font-size: 1rem; font-weight: 690; white-space: nowrap; }
.preview-meta { font-size: .875rem; color: var(--text-muted); text-align: right; line-height: 1.35; }
.preview { position: relative; display: grid; place-items: center; width: calc(100% - 1.52rem); min-width: 0; aspect-ratio: 16 / 9; min-height: 18.5rem; margin-inline: .76rem; border: 1px solid #292b34; border-radius: .62rem; overflow: hidden; background: #0b0c0f; }
.preview[data-mode="idle"] { background: radial-gradient(ellipse at 50% 32%, #24252d60, transparent 70%), linear-gradient(#24252d7d 1px, transparent 1px), linear-gradient(90deg, #24252d7d 1px, transparent 1px), #121318; background-size: auto, 28px 28px, 28px 28px, auto; background-position: center; }
.preview-empty { padding: 1.2rem .6rem; text-align: center; display: grid; justify-items: center; }
.capture-art { display: grid; place-items: center; position: relative; width: 5.5rem; height: 5.5rem; margin-bottom: 1.35rem; border: 1px solid #34323c; border-radius: .95rem; background: #1b1c24; box-shadow: 0 10px 30px #08091080; }
.capture-art .icon { width: 2.65rem; height: 2.65rem; color: #ffc2b8; stroke-width: 1.35; }
.capture-art i { position: absolute; width: .66rem; height: .66rem; border-color: #ff8c7b; border-style: solid; border-width: 0; }
.capture-art i:nth-child(1) { top: .53rem; left: .53rem; border-width: 1px 0 0 1px; border-top-left-radius: .15rem; }
.capture-art i:nth-child(2) { top: .53rem; right: .53rem; border-width: 1px 1px 0 0; border-top-right-radius: .15rem; }
.capture-art i:nth-child(3) { bottom: .53rem; right: .53rem; border-width: 0 1px 1px 0; border-bottom-right-radius: .15rem; }
.capture-art i:nth-child(4) { bottom: .53rem; left: .53rem; border-width: 0 0 1px 1px; border-bottom-left-radius: .15rem; }
.capture-art span { position: absolute; top: 2.3rem; left: 2.5rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); }
.empty-title { font-size: 1.3rem; font-weight: 700; letter-spacing: .025em; }
.empty-copy { color: var(--text-muted); font-size: .9rem; line-height: 1.6; margin-top: .45rem; }
.sources { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .45rem; margin-top: 1.18rem; }
.sources span { display: inline-flex; align-items: center; gap: .34rem; padding: .32rem .57rem; border: 1px solid #383a44; border-radius: .32rem; background: #1b1d23; color: #c9cbd5; white-space: nowrap; font-size: .875rem; }
.sources .icon { width: .95rem; height: .95rem; color: #a7a9b6; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.paused-overlay { position: absolute; top: .85rem; left: .85rem; display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem; background: #1b1713ed; color: #f8d7ab; border: 1px solid #936941; border-radius: .4rem; font-size: .875rem; }
.paused-overlay .icon { width: 1rem; height: 1rem; }

.controlbar { min-height: 4.8rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1rem; padding: .85rem 1.1rem; }
.controls, .clock { display: flex; align-items: center; gap: .58rem; }
.controls { justify-content: flex-end; flex-wrap: wrap; }
.clock { min-height: 2.75rem; }
.timer { font-size: 1.1rem; font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .04em; color: #e6e7ee; }
.clock-caption { color: var(--text-muted); font-size: .875rem; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .53rem .94rem; border: 1px solid transparent; border-radius: .51rem; font-size: .9375rem; font-weight: 675; line-height: 1.25; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s; }
.button.primary { color: #1d1414; background: var(--accent); border-color: #ff8b7c; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { color: #e2e3eb; background: #23252c; border-color: #393c47; }
.button.secondary:hover:not(:disabled) { background: #30323c; border-color: #545866; }
.button:disabled { opacity: .53; cursor: default; }
.button .icon { width: 1.15rem; height: 1.15rem; }
.notice { margin: 0 .95rem .9rem; border: 1px solid #47434b; background: #25252c; color: #e4e2ed; padding: .65rem .75rem; border-radius: .49rem; font-size: .9rem; line-height: 1.55; }
.notice[data-tone="warning"] { border-color: #67513b; background: #2b241d; color: #f3d2a6; }
.notice[data-tone="error"] { border-color: #744841; background: #2c211f; color: #ffccc3; }

.side { display: grid; gap: 1.05rem; }
.settings .panel-header, .output .panel-header { border-bottom: 1px solid var(--line); }
.audio-body { padding-inline: 1.05rem; }
.audio-row { padding-block: .95rem; }
.audio-row + .audio-row { border-top: 1px solid var(--line); }
.audio-heading { display: flex; align-items: center; gap: .62rem; }
.audio-icon { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border: 1px solid #363842; border-radius: .48rem; color: #cecfdb; background: #24262d; }
.audio-icon .icon { width: 1.05rem; height: 1.05rem; }
.audio-text { display: grid; gap: .22rem; flex: 1; min-width: 0; }
.audio-text label { font-size: .9375rem; font-weight: 680; line-height: 1.3; cursor: pointer; }
.audio-text span { color: var(--text-muted); font-size: .875rem; line-height: 1.45; }
.switch { appearance: none; display: grid; align-items: center; position: relative; flex: none; width: 2.34rem; height: 1.38rem; padding: 0; margin: 0; background: #41444f; border: 1px solid #575a69; border-radius: 1rem; cursor: pointer; transition: background-color .15s, border-color .15s; }
.switch::before { content: ""; width: .87rem; height: .87rem; margin-left: .19rem; border-radius: 50%; background: #e8e8ed; transition: transform .15s; }
.switch:checked { background: var(--accent); border-color: #ff8c7c; }
.switch:checked::before { transform: translateX(.98rem); background: #231719; }
.switch:disabled { opacity: .67; cursor: default; }
.audio-level { display: flex; align-items: center; gap: .55rem; margin: .65rem 0 0 2.87rem; }
.level-track { height: .275rem; position: relative; flex: 1; min-width: 1rem; border-radius: 5rem; background: #383a45; overflow: hidden; }
.level-track > span { position: absolute; inset: 0; background: var(--good); transform: scaleX(0); transform-origin: left; }
.audio-status { min-width: 3em; color: var(--text-muted); font-size: .8125rem; text-align: right; white-space: nowrap; }
.audio-status[data-active="true"] { color: var(--good); }
.audio-tip { border-top: 1px solid var(--line); padding: .85rem 1.05rem; color: var(--text-muted); font-size: .875rem; line-height: 1.6; }
.output-settings { display: grid; gap: .4rem; padding: .85rem 1.05rem .8rem; border-bottom: 1px solid var(--line); }
.output-settings label { font-size: .875rem; color: #dedfe7; font-weight: 600; }
.output-settings label:not(:first-child) { margin-top: .22rem; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap::after { content: ""; position: absolute; right: .92rem; top: 50%; width: .42rem; height: .42rem; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: translateY(-68%) rotate(45deg); pointer-events: none; }
.output-settings select { appearance: none; width: 100%; min-height: 2.55rem; border: 1px solid #393c47; border-radius: .45rem; padding: .42rem 1.8rem .42rem .65rem; background: #23252c; color: #f1f1f4; font-size: .875rem; cursor: pointer; }
.output-settings select:hover:not(:disabled) { border-color: #5b5e6a; }
.output-settings select:disabled { cursor: default; opacity: .65; }
.size-estimate { display: grid; gap: .17rem; line-height: 1.45; margin-top: .25rem; font-size: .8125rem; }
.size-estimate output { color: #f8b4a9; font-size: .875rem; font-weight: 650; }
.size-estimate span { color: var(--text-muted); }
.output dl { padding: .72rem 1.05rem .33rem; }
.output dl div { min-height: 2rem; display: flex; justify-content: space-between; align-items: baseline; gap: .65rem; font-size: .875rem; }
.output dt { color: var(--text-muted); }
.output dd { color: #e6e7ef; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
footer { text-align: right; margin-top: 1rem; font-size: .8125rem; }
footer a { color: var(--text-muted); text-underline-offset: .16em; }

dialog { width: min(100% - 2rem, 26rem); border: 1px solid #41434f; border-radius: .85rem; background: var(--panel); color: #f5f5fa; padding: 1.3rem; }
dialog::backdrop { background: #08090bcf; }
dialog h2 { font-size: 1.2rem; }
dialog p { margin-top: .65rem; color: var(--text-muted); line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

@media (max-width: 910px) {
  .shell { width: calc(100% - 2rem); }
  .workspace { grid-template-columns: minmax(0, 1fr) 16.5rem; gap: .85rem; }
  .preview { min-height: 16rem; }
  .controlbar { padding-inline: .8rem; }
  .clock-caption { display: none; }
}
@media (max-width: 690px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; }
  main.shell { padding-top: 1.4rem; }
  .title-row { margin-bottom: 1rem; }
  .preview { min-height: 15.5rem; }
  .capture-art { width: 4.4rem; height: 4.4rem; margin-bottom: .85rem; }
  .capture-art span { top: 1.74rem; left: 1.94rem; }
}
@media (max-width: 540px) {
  .side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .settings .audio-body { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
  .settings .audio-row { min-width: 0; }
  .audio-row + .audio-row { border-top: 0; }
  .audio-icon { display: none; }
  .audio-level { margin-left: 0; }
  .audio-text span { font-size: .8125rem; }
  .title-row { align-items: start; }
  .state-badge { margin-top: .12rem; padding-inline: .56rem; }
  .controls { flex: auto; }
  .controlbar { padding-inline: .7rem; }
  .controlbar .button { padding-inline: .62rem; }
  .preview-meta { font-size: .8125rem; }
  .topbar-inner { min-height: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
