/* 数桥同声传译网页版 — 对齐直播版 Pro 深绿科技风 */

:root {
  --bg0: #121212;
  --bg1: #141414;
  --bg2: #1a1a1a;
  --panel: #1e1e1e;
  --panel2: #252525;
  --stroke: rgba(0, 230, 118, 0.22);
  --stroke2: rgba(255, 255, 255, 0.08);
  --text: #f0f0f0;
  --muted: rgba(240, 240, 240, 0.55);
  --brand: #00e676;
  --brand2: #00c853;
  --cyan: #69f0ae;
  --good: #00e676;
  --warn: #ffb020;
  --danger: #ff4d4d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --radius: 12px;
  --nav-h: 64px;
  --bottom-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, "Microsoft YaHei", "Segoe UI", sans-serif;
  color-scheme: dark;
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(0, 200, 83, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg0), #161616);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: var(--nav-h) 1fr;
  grid-template-areas:
    "side top"
    "side main";
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: linear-gradient(180deg, #1a1a1a, #151515);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #ecfdf5;
  letter-spacing: 0.02em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 230, 118, 0.28);
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.12);
  filter: hue-rotate(-78deg) saturate(1.22) brightness(1.06);
}

.sidebar {
  grid-area: side;
  background: linear-gradient(180deg, #1c1c1c 0%, #151515 52%, #121212 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(235, 235, 235, 0.84);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.nav-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.12));
}

.nav-item.active {
  color: #fff;
  border-color: rgba(0, 230, 118, 0.48);
  background: linear-gradient(165deg, rgba(0, 230, 118, 0.16), rgba(0, 0, 0, 0.18));
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.main {
  grid-area: main;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.bottom-nav {
  display: none;
}

.card {
  background: linear-gradient(180deg, #1f1f1f, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 230, 118, 0.16), transparent 42%),
    linear-gradient(160deg, #1c1c1c 0%, #141414 100%);
  border: 1px solid rgba(0, 230, 118, 0.18);
  border-radius: 18px;
  padding: 28px 24px;
  margin-bottom: 18px;
  box-shadow: 0 0 40px rgba(0, 230, 118, 0.06);
}

.hero h1 {
  font-size: clamp(24px, 4vw, 34px);
  margin-bottom: 8px;
  color: #ecfdf5;
}

.hero p {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feature {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1f1f1f, #181818);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: 0.2s ease;
}

.feature:hover {
  border-color: rgba(0, 230, 118, 0.28);
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.08);
}

.feature h3 { margin-bottom: 6px; color: #ecfdf5; }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
  user-select: none;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(180deg, #1de975, #00c853);
  color: #06210f;
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.22);
}
.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(0, 230, 118, 0.3);
}

.btn-secondary {
  background: rgba(0, 230, 118, 0.08);
  color: var(--cyan);
  border-color: rgba(0, 230, 118, 0.28);
}
.btn-secondary:hover {
  background: rgba(0, 230, 118, 0.14);
}

.btn-danger {
  background: rgba(255, 77, 77, 0.12);
  color: #ff8a80;
  border-color: rgba(255, 77, 77, 0.28);
}

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(240, 240, 240, 0.72);
}
.form-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-all;
}
.form-input, .form-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: #2a2a2a;
  color: var(--text);
  outline: none;
}
.form-input::placeholder { color: rgba(240, 240, 240, 0.35); }
.form-input:focus, .form-select:focus {
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.12);
}
.form-select option {
  background: #1e1e1e;
  color: var(--text);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 200, 83, 0.12), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(0, 230, 118, 0.08), transparent 30%),
    linear-gradient(180deg, #121212, #161616);
}

.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, #1f1f1f, #181818);
  border: 1px solid rgba(0, 230, 118, 0.18);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 20px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-tab {
  border: none;
  background: transparent;
  min-height: 40px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active {
  background: rgba(0, 230, 118, 0.14);
  color: var(--brand);
  font-weight: 600;
  border: 1px solid rgba(0, 230, 118, 0.28);
}

.translate-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.panel-title {
  font-size: 16px;
  margin-bottom: 14px;
  color: #ecfdf5;
}

.lang-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 230, 118, 0.28);
  background: rgba(0, 230, 118, 0.08);
  color: var(--cyan);
  cursor: pointer;
  margin-bottom: 2px;
}
.swap-btn:hover {
  background: rgba(0, 230, 118, 0.16);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.status-pill.live {
  background: rgba(0, 230, 118, 0.12);
  color: var(--good);
  border-color: rgba(0, 230, 118, 0.28);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.result-box {
  min-height: 180px;
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  background: #161616;
}

.result-item {
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.result-item:last-child { border-bottom: none; }
.result-src { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.result-dst { font-size: 16px; line-height: 1.5; color: #ecfdf5; }
.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 40px 12px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--bottom-h) + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.96);
  color: #ecfdf5;
  border: 1px solid rgba(0, 230, 118, 0.28);
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 99;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: var(--shadow);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mobile-only { display: none; }
.desktop-only { display: initial; }

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--nav-h) 1fr;
    grid-template-areas:
      "top"
      "main";
  }
  .sidebar { display: none; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--bottom-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(18, 18, 18, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 30;
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
  }
  .bottom-nav a.active {
    color: var(--brand);
    font-weight: 600;
  }
  .main {
    padding: 16px;
    padding-bottom: calc(var(--bottom-h) + var(--safe-bottom) + 20px);
  }
  .translate-layout,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .mobile-only { display: initial; }
  .desktop-only { display: none; }
  .topbar .brand span { font-size: 16px; }
  .hero { padding: 22px 18px; }
}
