/* face-relay 共享样式 —— 深色，单色强调，移动优先 */
:root {
  --bg: #080b10;
  --bg2: #0e141c;
  --bg3: #141c26;
  --line: #1d2836;
  --line2: #2a3849;
  --fg: #e8eef5;
  --dim: #7e8c9d;
  --dim2: #55616f;
  --acc: #3ecf8e;
  --acc-d: #1f7d55;
  --blue: #4aa8ff;
  --warn: #f0b429;
  --err: #f0575a;
  --r: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 50% -18%, #12202e 0%, transparent 62%),
    var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--dim); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }

.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }

/* ── 布局 ── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 18px 64px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.01em; }
.brand i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--acc);
  box-shadow: 0 0 12px var(--acc-d); display: block;
}
.grid { display: grid; gap: 14px; }
@media (min-width: 880px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.wide { grid-template-columns: minmax(0, 1.42fr) minmax(300px, 1fr); }
}

/* ── 卡片 ── */
.card {
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

/* ── 按钮 ── */
button, .btn {
  appearance: none; border: 1px solid var(--line2); background: var(--bg3);
  color: var(--fg); font: inherit; font-size: 14px; font-weight: 550;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  transition: background 0.13s, border-color 0.13s, transform 0.06s, opacity 0.13s;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled), .btn:hover { background: #1b2532; border-color: #37485e; }
button:active:not(:disabled) { transform: scale(0.985); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary {
  background: linear-gradient(180deg, #3ecf8e, #2fae76);
  border-color: #2fae76; color: #04240f; font-weight: 650;
}
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #4de0a0, #34bd82); }
button.danger { border-color: #52282b; color: #ff9b9d; background: #1d1214; }
button.danger:hover:not(:disabled) { background: #291518; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 表单 ── */
input:not([type]), input[type="text"], input[type="password"], input[type="search"] {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--line2); background: #0a1017; color: var(--fg);
  font: inherit; font-size: 14px;
}
input:focus { outline: none; border-color: var(--acc-d); box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.11); }
textarea {
  width: 100%; min-height: 66px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line2); background: #0a1017; color: var(--fg);
  font: 12.5px/1.5 var(--mono); resize: vertical; word-break: break-all;
}

/* ── 状态徽标 ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--dim); background: #0c131b;
}
.badge.on { color: var(--acc); border-color: var(--acc-d); background: rgba(62, 207, 142, 0.09); }
.badge.warn { color: var(--warn); border-color: #5c431a; background: rgba(240, 180, 41, 0.09); }
.badge.err { color: var(--err); border-color: #5a2225; background: rgba(240, 87, 90, 0.09); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: block; }

/* ── 数据行 ── */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.kv > div { background: #0b1118; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.kv label { display: block; font-size: 11px; color: var(--dim2); letter-spacing: 0.03em; margin-bottom: 2px; }
.kv b { font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.lines { display: grid; gap: 0; border-top: 1px solid var(--line); }
.lines > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.lines > div > span:first-child { color: var(--dim); }
.lines > div > span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── 日志 ── */
.log {
  font: 12px/1.55 var(--mono); color: var(--dim);
  background: #070b10; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; height: 168px; overflow: auto; white-space: pre-wrap;
  word-break: break-all;
}
.log .ok { color: var(--acc); }
.log .bad { color: var(--err); }
.log .ts { color: var(--dim2); }

/* ── 提示条 ── */
.note {
  border-radius: 10px; padding: 11px 14px; font-size: 13px; line-height: 1.55;
  border: 1px solid var(--line2); background: #0c131b; color: var(--dim);
}
.note.warn { border-color: #5c431a; background: rgba(240, 180, 41, 0.07); color: #e8c477; }
.note.err { border-color: #5a2225; background: rgba(240, 87, 90, 0.07); color: #f09a9c; }
.note.ok { border-color: var(--acc-d); background: rgba(62, 207, 142, 0.07); color: #7fe0b6; }
.note b { color: var(--fg); }

/* ── 号主端：全屏等待页 ── */
.page-go .wrap {
  max-width: 460px; min-height: 100dvh; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}
.page-go h1 { font-size: 20px; line-height: 1.45; }
.page-go .sub { color: var(--dim); font-size: 13.5px; margin-top: 9px; max-width: 330px; }
.page-go .meta { display: flex; gap: 26px; margin-top: 30px; }
.page-go .meta > div { text-align: center; }
.page-go .meta label { display: block; font-size: 11px; color: var(--dim2); margin-bottom: 1px; }
.page-go .meta b { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.page-go .foot { margin-top: 34px; font-size: 11.5px; color: var(--dim2); max-width: 320px; line-height: 1.65; }

.ring { width: 60px; height: 60px; margin-bottom: 26px; position: relative; }
.ring span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid #18222e; border-top-color: var(--acc);
  animation: spin 0.95s linear infinite;
}
.ring.done span { animation: none; border-color: var(--acc); }
.ring.wait span { border-top-color: var(--dim2); }
@keyframes spin { to { transform: rotate(360deg); } }

.meter { width: 200px; height: 3px; border-radius: 2px; background: #17212c; margin-top: 22px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0%; background: var(--acc); transition: width 0.18s linear; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #16202c; border: 1px solid var(--line2); color: var(--fg);
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 操作端 ── */
.preview {
  position: relative; background: #05080c; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
}
.preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.preview .ph { color: var(--dim2); font-size: 13px; text-align: center; padding: 20px; line-height: 1.7; }
.chip {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font: 11.5px var(--mono); padding: 3px 9px; border-radius: 999px;
  background: rgba(6, 10, 14, 0.82); border: 1px solid var(--line2); color: var(--dim);
}
.chip.ok { color: var(--acc); border-color: var(--acc-d); }

.seg { display: inline-flex; background: #0a1017; border: 1px solid var(--line2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; color: var(--dim); border-radius: 8px; }
.seg button.active { background: var(--bg3); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.seg button:hover:not(.active) { background: transparent; color: var(--fg); }

.hit { animation: hitflash 0.6s ease-out; }
@keyframes hitflash { 0% { box-shadow: 0 0 0 0 rgba(62,207,142,0.5); } 100% { box-shadow: 0 0 0 14px rgba(62,207,142,0); } }
