/* ==========================================================================
   中转站 · 设计系统
   单一强调色 + 中性灰阶，浅色底，克制留白
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f5f6;
  --surface-3: #eceef0;

  --border: #e8eaed;
  --border-strong: #d8dbe0;

  --text: #16191d;
  --text-2: #5c636b;
  --text-3: #8b939c;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #edf2fe;
  --accent-line: #c9d9fb;

  --danger: #c33a32;
  --danger-soft: #fceeed;
  --danger-line: #f2d3d0;

  --success: #137a4a;
  --success-soft: #e9f6ef;
  --warn: #98600c;
  --warn-soft: #fdf3e3;

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px -16px rgba(16, 24, 40, 0.18);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 通用图标 ---------- */
.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm {
  width: 15px;
  height: 15px;
  stroke-width: 1.7;
}
.ico-lg {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), transform 0.1s var(--ease);
}
.btn:active {
  transform: scale(0.985);
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.24);
}
.btn.primary:hover {
  background: var(--accent-hover);
}
.btn.outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn.outline:hover {
  border-color: #c2c7ce;
  background: #fff;
}
.btn.ghost {
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger:hover {
  filter: brightness(0.94);
}
.btn.danger-ghost {
  background: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
}
.btn.danger-ghost:hover {
  background: var(--danger-soft);
}
.btn.sm {
  height: 34px;
  padding: 0 13px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
}
.btn.block {
  width: 100%;
  height: 48px;
  font-size: 15px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 表单 ---------- */
.field {
  display: grid;
  gap: 7px;
}
.field > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field .hint {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.input::placeholder {
  color: var(--text-3);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}
.input.mono {
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  font-size: 19px;
  font-weight: 500;
}
.input.mono::placeholder {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 400;
}
textarea.input {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}
.input-group {
  display: flex;
  gap: 8px;
}
.input-group .input {
  flex: 1;
  min-width: 0;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad {
  padding: 24px;
}

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.accent {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.badge.success {
  background: var(--success-soft);
  color: var(--success);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot.live {
  background: #1a9c62;
  box-shadow: 0 0 0 3px rgba(26, 156, 98, 0.16);
}
.dot.idle {
  background: #b6bcc3;
}

/* ---------- 提示条 ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 90;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(22, 25, 29, 0.94);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.22s var(--ease);
}
.toast.out {
  animation: toast-out 0.18s var(--ease) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ---------- 弹窗 ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 26, 0.4);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
  animation: fade 0.16s ease;
}
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 60px -20px rgba(16, 24, 40, 0.4);
  animation: pop 0.2s var(--ease);
}
.modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}
.modal p {
  margin: 0 0 20px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
}

/* ---------- 文件类型图标 ---------- */
.ftype {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-2);
  color: var(--text-2);
}
.ftype .ico {
  width: 21px;
  height: 21px;
  stroke-width: 1.5;
}
.ftype-img {
  background: #eaf3ff;
  color: #2166c9;
}
.ftype-doc {
  background: #eaf1fe;
  color: #2b5bbd;
}
.ftype-sheet {
  background: #e8f6ee;
  color: #177a4b;
}
.ftype-slide {
  background: #fdf0e6;
  color: #b4630e;
}
.ftype-pdf {
  background: #fdeceb;
  color: #bf3a30;
}
.ftype-zip {
  background: #f3eefc;
  color: #6d43b8;
}
.ftype-media {
  background: #fdeef4;
  color: #b23a6a;
}
.ftype-code {
  background: #eef0f2;
  color: #4a5460;
}
.ftype-generic {
  background: var(--surface-2);
  color: var(--text-3);
}

/* ==========================================================================
   首页
   ========================================================================== */
.page-home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
}
.brand-mark .ico {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.head-note {
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.home-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.hero {
  text-align: center;
  padding: 34px 0 36px;
}
.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.022em;
}
.hero p {
  margin: 0 auto;
  max-width: 460px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}
@media (max-width: 560px) {
  .hero h1 {
    font-size: 27px;
  }
  .home-main {
    padding: 8px 18px 48px;
  }
  .site-head {
    padding: 16px 18px;
  }
}

/* 选择卡 */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 620px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}
.choice {
  position: relative;
  text-align: left;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), box-shadow 0.2s var(--ease),
    transform 0.16s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.choice:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.choice .choice-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.choice.alt .choice-ico {
  background: var(--surface-2);
  color: var(--text-2);
}
.choice .choice-t {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.choice .choice-d {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.choice .choice-arrow {
  position: absolute;
  right: 20px;
  top: 24px;
  color: var(--text-3);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.choice:hover .choice-arrow {
  transform: translateX(2px);
  color: var(--accent);
}

/* 视图 */
.view {
  display: none;
}
.view.on {
  display: block;
  animation: view-in 0.24s var(--ease);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* 流程头 */
.flow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.flow-head .back {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
}
.flow-head .back:hover {
  background: var(--surface-2);
  color: var(--text);
}
.flow-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
}
.steps b {
  color: var(--accent);
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 18px;
}
.form-card {
  padding: 26px;
}
@media (max-width: 560px) {
  .form-card {
    padding: 20px 18px;
  }
}

/* 房间号展示 */
.code-show {
  display: grid;
  gap: 16px;
  text-align: center;
}
.code-big {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--text);
}
.pw-big {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
}
.kv .k {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.kv .v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 分段控制 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 11px;
}
.seg button {
  height: 32px;
  padding: 0 14px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: 0.15s var(--ease);
}
.seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

/* 页脚 */
.site-foot {
  text-align: center;
  padding: 0 24px 32px;
  font-size: 12.5px;
  color: var(--text-3);
}
.site-foot span {
  font-family: var(--mono);
}

/* ==========================================================================
   房间页
   ========================================================================== */
.page-room {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 249, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  z-index: 20;
}
.tb-left,
.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-right {
  margin-left: auto;
}
.tb-mid {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-code {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: border-color 0.16s var(--ease);
}
.room-code:hover {
  border-color: var(--accent-line);
}
.room-code .ico {
  color: var(--text-3);
  stroke-width: 1.7;
}
.room-code:hover .ico {
  color: var(--accent);
}
.tb-label {
  font-size: 12px;
  color: var(--text-3);
  margin-right: -4px;
}
@media (max-width: 900px) {
  .topbar {
    padding: 0 12px;
    height: 54px;
    gap: 8px;
  }
  .tb-mid {
    display: none;
  }
  .room-code {
    height: 32px;
    font-size: 13px;
    padding: 0 9px;
  }
  .tb-label {
    display: none;
  }
  .btn-label-hide {
    display: none;
  }
}

.room-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: 14px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px 18px;
}

.pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.pane-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.pane-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pane-head .hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* --- 文字区 --- */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar {
  width: 10px;
}
.messages::-webkit-scrollbar-thumb {
  background: #e2e5e9;
  border: 3px solid #fff;
  border-radius: 99px;
}
.messages::-webkit-scrollbar-thumb:hover {
  background: #cfd4da;
}

.msg {
  max-width: 76%;
  padding: 9px 13px;
  border-radius: 15px;
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 5px;
  animation: msg-in 0.18s var(--ease);
}
.msg.me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 5px;
}
.msg-sys {
  align-self: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 99px;
  margin: 4px 0;
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.typing {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-radius: 15px;
  border-bottom-left-radius: 5px;
}
.typing.on {
  display: flex;
}
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b3bac2;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.18s;
}
.typing i:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.composer {
  flex: none;
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  background: var(--surface);
  display: flex;
  gap: 9px;
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 132px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.composer .btn {
  height: 44px;
  border-radius: 13px;
  padding: 0 16px;
}

/* --- 文件区 --- */
.dropzone {
  flex: none;
  margin: 14px 14px 6px;
  padding: 20px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease),
    transform 0.16s var(--ease);
  background: var(--surface);
}
.dropzone:hover {
  border-color: var(--accent-line);
  background: #fcfdff;
}
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.005);
}
.dropzone .dz-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  margin: 0 auto 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  transition: 0.16s var(--ease);
}
.dropzone.over .dz-ico {
  background: #fff;
  color: var(--accent);
}
.dropzone .dz-t {
  font-size: 13.5px;
  font-weight: 500;
}
.dropzone .dz-d {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.55;
}
.dropzone kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
}

.file-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-list::-webkit-scrollbar {
  width: 10px;
}
.file-list::-webkit-scrollbar-thumb {
  background: #e2e5e9;
  border: 3px solid #fff;
  border-radius: 99px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: var(--r-md);
  transition: background 0.14s var(--ease);
}
.file-item:hover {
  background: var(--surface-2);
}
.file-body {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.file-acts {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}
.file-item:hover .file-acts,
.file-item:focus-within .file-acts {
  opacity: 1;
}
@media (hover: none) {
  .file-acts {
    opacity: 1;
  }
}
.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
  transition: 0.14s var(--ease);
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.icon-btn.del:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
}

.file-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 5px;
}
.file-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.2s linear;
}

.empty {
  text-align: center;
  padding: 26px 16px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.7;
}

/* 移动端分栏 */
.mobbar {
  display: none;
}

@media (max-width: 900px) {
  .room-grid {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
    max-width: none;
  }
  .pane {
    border: none;
    border-radius: 0;
    display: none;
  }
  .pane.on {
    display: flex;
  }
  .pane-head {
    padding: 12px 16px;
  }
  .mobbar {
    display: flex;
    flex: none;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobbar button {
    flex: 1;
    height: 54px;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-3);
    cursor: pointer;
    position: relative;
  }
  .mobbar button.on {
    color: var(--accent);
  }
  .mobbar .badge-dot {
    position: absolute;
    top: 8px;
    right: calc(50% - 18px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    display: none;
  }
  .mobbar .badge-dot.on {
    display: block;
  }
  .composer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .msg {
    max-width: 84%;
  }
  .dropzone {
    margin: 10px 10px 4px;
    padding: 16px 12px;
  }
}

/* 已销毁 / 空态整页 */
.state-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.state-card {
  text-align: center;
  max-width: 380px;
}
.state-ico {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-3);
}
.state-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
}
.state-card p {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

/* ==========================================================================
   后台
   ========================================================================== */
.admin-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fbfbfa;
}
.sidebar .brand {
  padding: 4px 10px 18px;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-2);
  transition: 0.14s var(--ease);
  cursor: pointer;
}
.side-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.side-nav a.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.side-foot {
  margin-top: auto;
  padding: 10px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.admin-main {
  min-width: 0;
  padding: 28px 32px 60px;
  max-width: 1080px;
}
.admin-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
}
.admin-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.admin-head p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.admin-head .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.stat .k {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.stat .v {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat .v small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 3px;
}

.section {
  margin-bottom: 26px;
}
.section-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-h h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.section-h .hint {
  font-size: 12px;
  color: var(--text-3);
}
.section-h .right {
  margin-left: auto;
}

.meter {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}
.meter i.warn {
  background: #d98324;
}
.meter i.danger {
  background: var(--danger);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
}
table.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}
table.tb th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-3);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #fcfcfc;
}
table.tb td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.tb tr:last-child td {
  border-bottom: none;
}
table.tb tr:hover td {
  background: #fcfcfd;
}
.mono-cell {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.tb-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: #d5d9de;
  border: none;
  cursor: pointer;
  transition: background 0.18s var(--ease);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s var(--ease);
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(16px);
}

.row-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.row-setting:last-child {
  border-bottom: none;
}
.row-setting .txt {
  flex: 1;
  min-width: 0;
}
.row-setting .txt .n {
  font-size: 14px;
  font-weight: 500;
}
.row-setting .txt .d {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
  margin-top: 2px;
}
.row-setting .ctrl {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.row-setting .ctrl .input {
  width: 120px;
  height: 38px;
  text-align: right;
  font-family: var(--mono);
  font-size: 14px;
}
.row-setting .ctrl .unit {
  font-size: 12.5px;
  color: var(--text-3);
  width: 34px;
}

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

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
  }
  .sidebar .brand {
    padding: 0 8px 0 4px;
    flex: none;
  }
  .sidebar .brand span {
    display: none;
  }
  .side-nav {
    flex-direction: row;
    gap: 4px;
  }
  .side-nav a {
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }
  .side-nav a.on {
    border: none;
    background: var(--accent-soft);
    color: var(--accent-hover);
    box-shadow: none;
  }
  .side-foot {
    display: none;
  }
  .admin-main {
    padding: 20px 16px 50px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .admin-head h1 {
    font-size: 18px;
  }
}

/* 打印/减少动画 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
