/* LinguaLive — Warm luxury theme */
:root {
  --bg: #120e0a;
  --panel: #1d1610;
  --panel2: #261c13;
  --line: #3d2d1e;
  --text: #f4e9da;
  --muted: #b3a189;
  --gold: #e2b255;
  --cinnabar: #a8322a;
  --cinnabar-hi: #d0463a;
  --ok: #5fbf94;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 500px at 50% -10%, #2a1d11 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 14px 16px 90px; }

/* ---------- Header ---------- */
header.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 4px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cinnabar), #6d1a14);
  display: flex; align-items: center; justify-content: center;
  color: #ffe9c9; box-shadow: var(--shadow);
}
.brand h1 { font-size: 1.25rem; letter-spacing: .5px; }
.brand small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #666; flex: none; }
.chip.live { color: #ffd9d4; border-color: var(--cinnabar-hi); }
.chip.live .dot { background: var(--cinnabar-hi); animation: pulse 1.1s ease-in-out infinite; }
.chip.busy .dot { background: var(--gold); }
.chip.ok .dot { background: var(--ok); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(208,70,58,.6);} 60% { box-shadow: 0 0 0 6px rgba(208,70,58,0);} }

/* ---------- Notice ---------- */
.notice {
  display: none; margin: 6px 0 14px; padding: 10px 14px;
  background: #33230f; border: 1px solid #6b4d1c; color: #f0d9a8;
  border-radius: 10px; font-size: .84rem;
}
.notice.show { display: block; }

/* ---------- Language bar ---------- */
.langbar {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.field label { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 5px; letter-spacing: .3px; }
select {
  width: 100%; appearance: none;
  background: var(--panel2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23e2b255' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>") no-repeat right 12px center;
  color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 34px 10px 12px; font-size: .95rem; cursor: pointer; max-width: 100%;
}
.swap {
  width: 46px; height: 46px; border-radius: 12px; cursor: pointer;
  background: var(--panel2); color: var(--gold);
  border: 1px solid var(--line); font-size: 1.15rem; line-height: 1;
}
.swap:hover { border-color: var(--gold); }

/* ---------- Mode tabs ---------- */
.modes { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.modeTab {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .86rem;
}
.modeTab.active { background: var(--panel2); color: var(--gold); border-color: #6b4d1c; }
.modeHint { color: var(--muted); font-size: .76rem; flex: 1 1 100%; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.card .cardHead {
  padding: 10px 14px; font-size: .78rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.card .cardHead b { color: var(--gold); font-weight: 600; }
.card .stage {
  min-height: 190px; padding: 16px 16px 10px; flex: 1;
  display: flex; flex-direction: column; gap: 10px;
}
.src {
  font-size: .95rem; color: var(--muted); min-height: 1.2em;
  border-left: 3px solid #5a4630; padding-left: 10px;
}
.src.interim { color: #8f7c63; font-style: italic; }
.dst {
  font-size: 1.65rem; font-weight: 600; line-height: 1.4; color: var(--text);
  overflow-wrap: break-word; word-break: break-word; flex: 1;
}
.dst .placeholder { color: #5d4f3d; font-weight: 400; font-size: .98rem; }
.big { font-size: 2.4rem; }
.dst:empty { display: none; }
.actions { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.micBtn {
  --s: 58px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--panel2); cursor: pointer;
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, background .2s, box-shadow .2s;
}
.micBtn:active { transform: scale(.94); }
.micBtn.listening {
  background: var(--cinnabar); border-color: var(--cinnabar-hi); color: #fff;
  box-shadow: 0 0 0 0 rgba(208,70,58,.55); animation: ring 1.2s infinite;
}
@keyframes ring { 0%{ box-shadow: 0 0 0 0 rgba(208,70,58,.5);} 100%{ box-shadow: 0 0 0 18px rgba(208,70,58,0);} }
.iconBtn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.iconBtn:hover { color: var(--gold); border-color: var(--gold); }
.iconBtn:disabled { opacity: .35; cursor: not-allowed; }
.holdTip { font-size: .74rem; color: var(--muted); flex: 1; }

.manual { display: flex; gap: 8px; padding: 0 14px 12px; }
.manual input {
  flex: 1; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: .9rem; min-width: 0;
}
.manual input:focus { outline: none; border-color: var(--gold); }
.manual button {
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: .85rem; white-space: nowrap;
}
.manual button:hover { background: #4a3a18; }
.card.sourceActive { border-color: var(--cinnabar-hi); box-shadow: 0 0 0 1px var(--cinnabar-hi), var(--shadow); }

/* ---------- Broadcast ---------- */
.broadPanel { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; align-items: center; gap: 14px; flex-wrap: wrap; }
.broadPanel.show { display: flex; }
.broadPanel p { flex: 1 1 220px; font-size: .85rem; color: var(--muted); min-width: 0; }
.broadBtn {
  background: linear-gradient(135deg, var(--cinnabar), #6d1a14); color: #ffe9c9;
  border: none; padding: 12px 22px; border-radius: 12px; font-size: .95rem; cursor: pointer;
  box-shadow: var(--shadow);
}
.broadBtn.running { background: #3d2813; color: var(--gold); border: 1px solid #6b4d1c; }

/* ---------- History / settings ---------- */
.panel2 { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
.panel2 summary {
  cursor: pointer; padding: 12px 16px; color: var(--muted); font-size: .86rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.panel2 summary::-webkit-details-marker { display: none; }
.panel2 summary .arrow { transition: transform .2s; color: var(--gold); }
.panel2[open] summary .arrow { transform: rotate(90deg); }
.panel2 .body { padding: 0 16px 14px; }
.histItem {
  border-top: 1px solid var(--line); padding: 9px 0; font-size: .86rem;
  display: flex; gap: 10px;
}
.histItem .mid { flex: 1; min-width: 0; }
.histItem .time { color: #6f5f49; font-size: .72rem; white-space: nowrap; }
.histItem .s { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.histItem .d { color: var(--text); margin-top: 2px; overflow-wrap: break-word; }
.histItem .play { flex: none; }
.row2 { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .86rem; flex-wrap: wrap; }
.row2 input[type=range] { width: 160px; accent-color: var(--gold); }
.row2 .val { color: var(--gold); min-width: 34px; text-align: right; }
.tiny { font-size: .74rem; color: var(--muted); padding: 10px 0 2px; line-height: 1.6; }
.setGrid { display: grid; gap: 8px; max-width: 620px; padding: 6px 0 2px; }
.setRow { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; }
.setRow label { font-size: .8rem; color: var(--muted); }
.setRow input {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 10px; font-size: .86rem; min-width: 0;
}
.setRow input:focus { outline: none; border-color: var(--gold); }
.modeTab:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 560px) {
  .setRow { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #31231a; border: 1px solid #6b4d1c; color: #f0d9a8;
  padding: 10px 18px; border-radius: 10px; font-size: .85rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 99; max-width: 92vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #3a1712; border-color: var(--cinnabar-hi); color: #ffd9d4; }

@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
  .langbar { grid-template-columns: 1fr 46px 1fr; }
  .dst { font-size: 1.45rem; }
  .big { font-size: 1.9rem; }
  .stage { min-height: 140px; }
}
