/* Admin console */
.admin-main { padding: 32px 0 120px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 750; }
.hero p { margin: 6px 0 0; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stats .stat { min-width: 140px; }

.settings-grid { --min: 420px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.span-full { grid-column: 1 / -1; }
.card:nth-child(2) { animation-delay: .05s; } .card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; } .card:nth-child(5) { animation-delay: .2s; } .card:nth-child(6) { animation-delay: .25s; }

.llm-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 28px; }
@media (max-width: 900px) { .llm-layout { grid-template-columns: 1fr; } .settings-grid { --min: 100%; } }
.prompt-area { min-height: 340px; }

/* connection test */
.conn-test { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-hi); border: 1px solid var(--border); }
.conn-light { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.conn-light .dot { width: 14px; height: 14px; }
.conn-light strong { font-family: var(--font-display); font-size: 1.02rem; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.model-chips .badge { cursor: pointer; transition: .2s; }
.model-chips .badge:hover { border-color: var(--brand); color: var(--text); }

/* tests */
.test-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); border: 1px dashed var(--border-hi); background: hsl(232 30% 50% / .03); }
.test-box > label.btn { align-self: flex-start; }
.translate-result { display: grid; gap: 8px; }
.tr-line { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--surface-hi); border: 1px solid var(--border); animation: rise .4s var(--ease) both; }
.tr-line b { font-size: .8rem; color: var(--text-3); font-weight: 600; }
.tr-meta { font-size: .78rem; color: var(--text-3); display: flex; gap: 12px; }
.err-box { padding: 12px; border-radius: 10px; background: hsl(352 86% 62% / .1); border: 1px solid hsl(352 86% 62% / .35); color: hsl(352 90% 78%); font-size: .86rem; word-break: break-word; }

/* languages */
.lang-list { display: flex; flex-direction: column; gap: 10px; }
.lang-row { display: grid; grid-template-columns: auto 54px 70px 1fr 1fr auto; gap: 8px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface-hi); border: 1px solid var(--border); transition: opacity .25s, border-color .25s; animation: rise .35s var(--ease) both; }
.lang-row.off { opacity: .5; }
.lang-row .input { padding: 8px 10px; font-size: .86rem; }
.lang-row .flag { text-align: center; font-size: 1.15rem; padding: 6px; }
.lang-row .code { font-family: var(--font-mono); text-transform: lowercase; }
@media (max-width: 560px) { .lang-row { grid-template-columns: auto 50px 1fr auto; } .lang-row .llm, .lang-row .code { display: none; } }

/* monitor */
.sub-h { font-size: .92rem; font-weight: 600; color: var(--text-2); margin: 8px 0 12px; }
.live-rooms { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 26px; }
.live-rooms .empty { grid-column: 1 / -1; border: 1px dashed var(--border-hi); border-radius: var(--r); }
.live-room { padding: 18px; border-radius: var(--r); background: var(--surface-hi); border: 1px solid var(--border); position: relative; overflow: hidden; animation: rise .4s var(--ease) both; }
.live-room::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
.live-room.is-live::before { background: var(--grad-warm); }
.live-room .code { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; letter-spacing: .1em; }
.live-room .nums { display: flex; gap: 18px; margin-top: 12px; }
.live-room .nums div { display: flex; flex-direction: column; }
.live-room .nums b { font-family: var(--font-display); font-size: 1.4rem; }
.live-room .nums span { font-size: .72rem; color: var(--text-3); }
.dl-links { display: flex; gap: 4px; flex-wrap: wrap; }
.dl-links a { font-size: .76rem; padding: 3px 8px; border-radius: 7px; background: var(--surface-hi); border: 1px solid var(--border); color: var(--text-2); }
.dl-links a:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }
.room-code { font-family: var(--font-mono); font-weight: 700; letter-spacing: .08em; }

/* save bar */
.savebar {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 140%);
  width: min(640px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 20px; border-radius: 18px;
  background: var(--surface-solid); border: 1px solid var(--border-hi);
  box-shadow: var(--shadow), var(--glow);
  transition: transform .45s var(--ease);
  font-size: .92rem; font-weight: 500;
}
.savebar.show { transform: translate(-50%, 0); }

/* ---------- admin responsive header ---------- */
.admin-topbar {
  position: sticky; top: 0; z-index: 40;
}
.brand-title-mobile {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.topbar-actions-desktop {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-actions-mobile {
  display: none;
  align-items: center;
  gap: 10px;
}
.admin-mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .admin-topbar .topbar-container {
    height: 56px;
    padding: 0 14px;
  }
  .brand-titles {
    display: none;
  }
  .brand-title-mobile {
    display: inline-block;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 9px;
  }
  .nav-desktop {
    display: none !important;
  }
  .topbar-actions-desktop {
    display: none !important;
  }
  .topbar-actions-mobile {
    display: flex;
  }
  .ws-badge-compact {
    padding: 7px;
    border-radius: 50%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .ws-badge-compact .dot {
    margin: 0;
  }
  .btn-menu {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-hi);
    border: 1px solid var(--border-hi);
    color: var(--text);
  }

  /* 行動選單抽屜 */
  .admin-mobile-nav {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s var(--ease), opacity .25s ease;
    opacity: 0;
    background: rgba(14, 16, 26, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border-hi);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  }
  .admin-mobile-nav.open {
    max-height: 360px;
    opacity: 1;
  }
  .mobile-nav-inner {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
    transition: all .2s var(--ease);
    text-decoration: none;
  }
  .mobile-nav-item:hover, .mobile-nav-item:active {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    text-decoration: none;
    color: #ffffff;
  }
  .mobile-nav-item.active {
    background: var(--surface-hi);
    border-color: var(--brand);
    color: #ffffff;
  }
  .mobile-nav-item .ico {
    font-size: 1.15rem;
  }
  .mobile-nav-item .txt {
    flex: 1;
  }
  .badge-mini {
    font-size: .72rem;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(124, 58, 237, 0.3);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
  }
  .mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
  }
  .mobile-nav-footer {
    padding-top: 4px;
  }
}
