/*
 * china-link UI（DESIGN.md §106-4）
 * §7-7 適用除外（創業者指示 2026-08-22）。Web フォントを配信せずシステムフォントを使う。
 * 外部 CDN 参照は置かない（CL-E2E-007）。
 */
:root {
  --bg: #101214;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --accent: #2f7d5c;
  --danger: #a83a3a;
  --field: #1c1f22;
  --border: #2c3034;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  min-height: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.screen.hidden { display: none; }

h1 { font-size: 1.4rem; margin: 8px 0 4px; letter-spacing: .04em; }
h2 { font-size: 1.15rem; margin: 8px 0; }

label { font-size: .85rem; color: var(--muted); }
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: .95rem;
  padding: 6px 0;
}
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.row { display: flex; gap: 8px; }
.row input { flex: 1 1 auto; min-width: 0; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--field);
  color: var(--fg);
  cursor: pointer;
  min-height: 48px;
}
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { flex: 0 0 auto; }

.hint { font-size: .8rem; color: var(--muted); margin: -4px 0 4px; }
.status { font-size: .85rem; color: var(--muted); min-height: 1.2em; margin: 4px 0; word-break: break-word; }

/* --- 通話画面 --- */
#call { padding: 0; max-width: none; gap: 0; }

.videos { position: relative; flex: 1 1 auto; background: #000; overflow: hidden; }
#remoteVideo {
  width: 100%; height: 100%; object-fit: contain; background: #000; display: block;
}
#localVideo {
  position: absolute;
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
  width: 28vw;
  max-width: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
  object-fit: cover;
}

#call .status {
  position: absolute; left: 12px; top: max(12px, env(safe-area-inset-top));
  background: rgba(0,0,0,.55); padding: 4px 8px; border-radius: 6px; color: var(--fg);
}

.controls {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  background: #16191c;
}
.ctl {
  flex: 1 1 0;
  font-size: 1.4rem;
  min-height: 60px;
  border-radius: 14px;
}
.ctl.off { opacity: .45; }
.ctl.danger { background: var(--danger); border-color: var(--danger); }
