/* ============================================================
   QR Transfer — 共享样式 (decimen 风格: 深色技术风)
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #070a11;
  --panel: #0e1420;
  --panel-strong: #121a29;
  --line: #1d2740;
  --line-bright: #34466f;
  --text: #dde6f5;
  --text-dim: #b9c6dd;
  --muted: #7c8aa8;
  --muted-dim: #5c6883;
  --accent: #58c8ff;
  --accent-hi: #8adaff;
  --accent-ink: #04121c;
  --green: #5fe0b0;
  --red: #ff7b72;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

/* ---------- 顶部品牌栏 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .3px;
}
.brand-logo { width: 26px; height: 26px; color: var(--accent); }
.brand small { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- 模式导航 (发送/接收) ---------- */
.mode-nav {
  display: flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.mode-nav a {
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 14px;
}
.mode-nav a:hover { color: var(--text); }
.mode-nav a.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ---------- 页面容器 ---------- */
.page { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Hero (首页) ---------- */
.hero { text-align: center; padding: 30px 10px 10px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; color: var(--text); }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto; }

/* ---------- 卡片 (首页 发送/接收) ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.card .kicker { color: var(--muted-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.card h2 { margin: 0; font-size: 20px; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card .action { margin-top: 8px; }

/* ---------- 按钮 ---------- */
.button, .action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
  text-align: center;
}
.button:hover, .action:hover { border-color: var(--line-bright); color: var(--text); }
.button.primary, .action.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.button.primary:hover, .action.primary:hover { background: var(--accent-hi); }
.button:disabled, .action:disabled { opacity: .5; cursor: not-allowed; }
.button.danger { background: transparent; border-color: var(--red); color: var(--red); }
.button.danger:hover { background: var(--red); color: var(--accent-ink); }
.button.block { width: 100%; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel h3 { margin: 0; font-size: 15px; color: var(--text); }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- 控件 ---------- */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); }
input[type=text], input[type=number], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=file] { display: none; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---------- 二维码显示区 ---------- */
.qr-stage {
  background: var(--viewport-bg, #000);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 200px;
  gap: 10px;
  flex-wrap: wrap;
}
.qr-stage canvas, .qr-stage img { background: #fff; image-rendering: pixelated; }

/* ---------- 状态 / 进度 ---------- */
.status { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--text-dim); font-size: 14px; }
.status.error { border-color: var(--red); color: var(--red); }
.status.good { border-color: var(--green); color: var(--green); }
.progress { height: 8px; background: var(--panel-strong); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); width: 0%; transition: width .2s; }

/* ---------- 视频 (接收端) ---------- */
.video-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
video { width: 100%; display: block; }

/* ---------- 元信息行 ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.meta b { color: var(--text); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer { width: 100%; max-width: 720px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted-dim); font-size: 12px; justify-content: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-lang select { background: var(--panel); color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; }

/* ---------- 响应式: 手机 ---------- */
@media (max-width: 680px) {
  body { padding: 14px; gap: 12px; }
  .cards { grid-template-columns: 1fr; }
  .fields, .fields.three { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .mode-nav a { padding: 6px 14px; font-size: 13px; }
}
/* 横屏矮屏 */
@media (max-height: 620px) and (orientation: landscape) {
  body { padding: 10px; gap: 8px; }
  .hero { padding-top: 10px; }
}
