:root {
  color-scheme: light;
  --bg: #eef2fb;
  --text: #1d2433;
  --muted: #7b8494;
  --line: #e7ebf5;
  --purple: #6f5bff;
  --blue: #4f7dff;
  --soft: #f5f7fd;
  --ok: #22c55e;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(92, 108, 166, 0.12);
  --radius: 22px;
  --card: #ffffff;
  --input: #fbfcff;
  --page: #f4f6ff;
  --glow-a: #f8d9ff;
  --glow-b: #d9e6ff;
  --track: #eceff8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10182a;
  --text: #e8eefc;
  --muted: #9aa8c2;
  --line: #2a3754;
  --soft: #151e32;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --card: #171f33;
  --input: #121a2c;
  --page: #0b1220;
  --glow-a: #3a2158;
  --glow-b: #1a2d58;
  --track: #243049;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, var(--glow-a) 0, transparent 26rem),
    radial-gradient(circle at 78% -8%, var(--glow-b) 0, transparent 30rem),
    var(--page);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
textarea { resize: none; }

body[data-view="landing"] #workspace,
body[data-view="user"] #landing,
body[data-view="admin"] #landing { display: none !important; }
body[data-view="user"] .admin-only,
body[data-view="admin"] .user-only,
body[data-role="user"] .super-only,
body[data-role="admin"] .super-only { display: none !important; }

.landing {
  min-height: 100vh;
  padding: 18px 36px 28px;
  position: relative;
  overflow: hidden;
}
.landing:after {
  content: "";
  position: absolute;
  right: -8rem;
  bottom: -10rem;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-b) 0, transparent 68%);
  pointer-events: none;
}
.land-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand-mark.linzhi,
.brand-lin {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #6ea4ff 0%, #5b7dff 42%, #7a5cff 100%);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  letter-spacing: 0;
  box-shadow: 0 10px 20px rgba(91, 111, 255, 0.28);
  object-fit: cover;
}
.brand strong {
  font-size: 22px;
  letter-spacing: 0.12em;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}
.hero-lin {
  margin: 0;
  font-size: 96px;
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Microsoft YaHei", serif;
  background: linear-gradient(145deg, #6ea4ff 0%, #5b7dff 40%, #7a5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 12px 24px rgba(91, 111, 255, 0.25));
}
.site-legal {
  position: relative;
  z-index: 2;
  margin: 28px 0 0;
  color: #98a2b3;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.legal-page {
  background: var(--page);
  min-height: 100vh;
}
.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  line-height: 1.8;
  color: var(--text);
}
.legal-wrap h1 { font-size: 28px; }
.legal-wrap a { color: #4f7dff; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; }
.land-nav nav { display: flex; gap: 28px; margin-left: 24px; }
.land-nav a { color: var(--muted); text-decoration: none; }
.land-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ghost-pill, .purple-pill {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #d9def0;
  background: var(--card);
}
.purple-pill {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #6f5bff, #8b5cf6);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(120, 132, 180, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 36px;
  align-items: start;
  padding: 48px 8px 20px;
  position: relative;
  z-index: 1;
}
.hero-copy { min-width: 0; overflow: hidden; }
.hero-copy h1 {
  margin: 0;
  font-size: 48px;
  letter-spacing: -0.04em;
}
.hero-copy h1 span { color: #6f5bff; }
.hero-kicker { color: var(--muted); margin: 10px 0 14px; }
.hero-lead { max-width: 36rem; color: var(--muted); line-height: 1.8; }
.hero-stage {
  position: relative;
  width: min(520px, 100%);
  min-height: 280px;
  margin-top: 18px;
}
.c1 { top: 18px; left: 56px; }
.c2 { top: 18px; left: 250px; }
.c3 { top: 8px; left: 430px; width: 54px; height: 54px; display: grid; place-items: center; font-weight: 800; color: #6f5bff; }
.c4 { top: 148px; left: 0; }
.c5 { top: 148px; left: 360px; }
.c6 { top: 228px; left: 24px; }
.c7 { top: 228px; left: 340px; }
.demo-card.left { top: 78px; left: 72px; }
.demo-card.right { top: 92px; left: 270px; }
.swap-badge { top: 118px; left: 246px; }
.lang-chip, .demo-card, .swap-badge {
  position: absolute;
  background: var(--card);
  box-shadow: var(--shadow);
}
.lang-chip {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
}
.demo-card {
  width: 200px;
  padding: 16px;
  border-radius: 18px;
}
.demo-card b { display: block; }
.demo-card small { color: var(--muted); }
.swap-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--purple);
  z-index: 2;
}
.hand { font-family: "Segoe Script", "Bradley Hand", cursive; color: #98a2b3; }
.hand-1 { position: absolute; left: 150px; bottom: 8px; }
.login-card {
  width: 100%;
  max-width: 400px;
  margin-top: 12px;
  position: relative;
  z-index: 3;
  background: var(--card);
  border-radius: 28px;
  padding: 32px 28px 22px;
  box-shadow: 0 24px 70px rgba(92, 108, 166, 0.16);
}
.login-card h2 { margin: 0; font-size: 28px; }
.login-sub { color: var(--muted); margin: 8px 0 22px; }
[hidden] { display: none !important; }
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
}
.field input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
}
.field button { border: 0; background: transparent; color: var(--muted); }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 16px; }
.remember { color: var(--text); font-size: 14px; }
.link, .back-home { border: 0; background: transparent; color: #6f5bff; }
.login-submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(90deg, #4f7dff, #8b5cf6);
  font-size: 16px;
}
.or { text-align: center; color: #98a2b3; font-size: 12px; margin: 16px 0 10px; }
.other-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.other-ways button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.google-slot { display: grid; place-items: center; margin-top: 12px; min-height: 40px; }
.login-status { text-align: center; color: var(--muted); font-size: 13px; }
.back-home { display: block; width: 100%; margin-top: 4px; }
.land-foot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.land-foot div { color: var(--text); }
.land-foot b { display: block; }
.land-foot small { color: #98a2b3; }
.hand-2 { position: absolute; right: 12px; bottom: -6px; text-align: right; }

.app {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100vh;
  overflow: hidden;
}
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .sidebar { display: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav { display: grid; gap: 4px; }
.nav-item {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #667085;
  text-align: left;
}
.nav-item.active {
  background: linear-gradient(90deg, #6f5bff, #7a67ff);
  color: #fff;
  box-shadow: 0 10px 20px rgba(111, 91, 255, 0.28);
}
.sidebar-card {
  margin-top: auto;
  padding: 18px 16px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(160deg, #6f5bff, #8b5cf6 55%, #60a5fa);
}
.sidebar-card p { margin: 8px 0 12px; font-size: 12px; }
.upgrade {
  display: block;
  padding: 8px 0;
  border-radius: 999px;
  background: #fff;
  color: #6f5bff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.quota { padding: 12px 8px 0; color: var(--muted); font-size: 12px; }
.quota strong { display: block; margin: 6px 0; color: var(--text); }
.quota-bar, .health-bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.quota-bar i, .health-bar i {
  display: block;
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, #60a5fa, #8b5cf6);
}

.workspace { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.topbar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto minmax(160px, 220px) auto auto auto;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 20px 4px;
  min-width: 0;
  flex: 0 0 auto;
}
.headline {
  min-width: 0;
  max-width: 100%;
}
.headline h1,
.headline p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.headline h1 {
  font-size: 22px;
  line-height: 1.4;
}
.headline p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.hand-note {
  color: #8b80ff;
  font-family: "Segoe Script", cursive;
  font-size: 13px;
  white-space: nowrap;
}
.search {
  width: 100%;
  min-width: 160px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(120, 132, 180, 0.08);
}
.search input { width: 100%; height: 40px; border: 0; outline: 0; background: transparent; }
.icon-btn,
.userchip { flex-shrink: 0; }
.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--card);
  max-width: 280px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #60a5fa);
}
.userchip small { display: block; color: var(--muted); font-size: 11px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro {
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f5bff, #8b5cf6);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}
.text-link { border: 0; background: transparent; color: var(--muted); }

.main { padding: 4px 20px 16px; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { display: none; }
.page.active { display: block; overflow: auto; }
#page-home.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#page-home.active .rightbar,
#page-home.active .table-card { display: none; }
#page-home.active .center-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.mode-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; flex: 0 0 auto; }
.mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #667085;
  box-shadow: 0 8px 18px rgba(120, 132, 180, 0.06);
}
.mode-tab small { display: none; }
.mode-tab.active {
  background: linear-gradient(180deg, #7a67ff, #6f5bff);
  color: #fff;
  box-shadow: 0 14px 24px rgba(111, 91, 255, 0.28);
}
.mode-tab.active small { color: rgba(255,255,255,0.8); }
.translator-card, .table-card, .stat-card, .panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.translator-card { padding: 16px 16px 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lang-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: nowrap; flex: 0 0 auto; }
.lang-select, .lang-bar select {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  flex: 0 0 auto;
}
.lang-select select, .lang-bar select { border: 0; outline: 0; background: transparent; }
.swap {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
}
.switch { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 13px; }
.switch input { display: none; }
.switch span {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #d9deea;
  position: relative;
}
.switch span:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.switch input:checked + span { background: #7a67ff; }
.switch input:checked + span:before { left: 20px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; min-height: 0; }
.pane {
  position: relative;
  min-height: 0;
  height: 100%;
  padding: 16px 16px 48px;
  border-radius: 18px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
}
.pane textarea {
  width: 100%;
  flex: 1;
  min-height: 280px;
  height: auto;
  border: 0;
  outline: 0;
  background: transparent;
  line-height: 1.75;
  font-size: 17px;
}
.pane-foot {
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  display: flex;
  justify-content: space-between;
  color: #98a2b3;
  font-size: 12px;
}
.pane-foot button { border: 0; background: transparent; color: #667085; margin-left: 8px; }
.translate-actions { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; flex: 0 0 auto; }
.start {
  min-width: 220px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #4f7dff, #8b5cf6);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.28);
}
.ghost, .mini {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.mini.danger { color: var(--danger); }
#translationStatus { color: var(--muted); font-size: 13px; }
.upload-box {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #cfd6ea;
  border-radius: 18px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
  padding: 24px;
  gap: 10px;
}
.table-card { margin-top: 16px; padding: 8px 8px 12px; }
.table-tabs, .panel-head { display: flex; align-items: center; gap: 18px; padding: 10px 14px; }
.table-extra { margin-left: auto; border: 0; background: transparent; color: var(--purple); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #98a2b3; }
.ops button { border: 0; background: transparent; margin-right: 6px; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.rightbar { display: grid; gap: 14px; }
.stat-card { padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.card-head button { border: 0; background: transparent; color: var(--purple); }
.stat-card h3 { margin: 0 0 12px; font-size: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row b { display: block; font-size: 22px; }
.stat-row small, .stat-card p { color: var(--muted); }
.stat-card p b { color: var(--text); }
.ring-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(#6f5bff calc(var(--p, 0) * 1%), #e8ecf8 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
  mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
}
.chart { display: flex; align-items: end; gap: 8px; height: 88px; margin-top: 16px; }
.chart i { flex: 1; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #7a67ff, #60a5fa); }
.quick {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.status-line { display: flex; align-items: center; gap: 8px; }
.status-line i, #svcDot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.status-line i.ok, #svcDot.ok { background: var(--ok); }
.status-line i.err, #svcDot.err { background: var(--danger); }
.panel { padding: 18px; }
.panel-head { padding: 0 0 12px; }
.panel-head h2 { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.filters input, .form-row input, .form-row select, .settings-grid input, .settings-grid select, .block textarea, .filters select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.settings-grid label, .block { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.block textarea { height: auto; padding: 10px; }
.hint, .notice { color: var(--muted); line-height: 1.6; }
.notice { padding: 12px; border-radius: 12px; background: #f5f3ff; margin-bottom: 12px; }
.key-list { list-style: none; padding: 0; }
.key-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }

.api-layout {
  display: grid;
  gap: 16px;
  align-content: start;
  max-width: 980px;
}
.api-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
}
.api-panel .panel-head h2 { margin: 0 0 4px; font-size: 20px; }
.panel-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.api-status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.api-status-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft);
  display: grid;
  gap: 6px;
}
.api-status-card span {
  color: var(--muted);
  font-size: 12px;
}
.api-status-card strong {
  font-size: 15px;
  word-break: break-all;
}
.ok-text { color: var(--ok); }
.err-text { color: var(--danger); }
.api-settings {
  margin: 0 0 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.api-settings label {
  min-width: 0;
}
.mini.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #4f7dff, #8b5cf6);
}
.key-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.key-notice code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  word-break: break-all;
}
#page-api.active {
  padding-bottom: 24px;
}

@media (max-width: 900px) {
  .api-status-row,
  .api-settings { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .api-status-row,
  .api-settings { grid-template-columns: 1fr; }
  .api-panel .panel-head { flex-direction: column; }
  .key-notice { flex-direction: column; align-items: stretch; }
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-grid div { padding: 16px; border-radius: 16px; background: var(--soft); }
.sub { margin: 22px 0 8px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1d2433;
  color: #fff;
}
.nav-unread,
#inboxBadge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-style: normal;
}
#inboxBtn { position: relative; }
#inboxBadge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.msg-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
}
body[data-view="user"] .msg-layout { grid-template-columns: 1fr; }
.thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
}
.thread-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
}
.thread-item.active { border-color: #c4b5fd; background: #f5f3ff; }
.thread-item b { display: block; font-size: 13px; }
.thread-item small { color: var(--muted); }
.thread-main {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
  overflow: hidden;
}
.thread {
  min-height: 280px;
  max-height: 52vh;
  overflow: auto;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(120, 132, 180, 0.08);
}
.bubble.me {
  justify-self: end;
  background: linear-gradient(135deg, #7c5cff, #60a5fa);
  color: #fff;
}
.bubble small { display: block; opacity: 0.7; margin-top: 6px; font-size: 11px; }
.bubble img {
  display: block;
  max-width: 240px;
  max-height: 180px;
  margin: 6px 0;
  border-radius: 10px;
  cursor: zoom-in;
}
.composer { display: grid; gap: 8px; padding: 12px; background: #fff; }
.composer textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
}
.composer-actions { display: flex; justify-content: space-between; align-items: center; }
.file-btn {
  color: #6f5bff;
  cursor: pointer;
}
.img-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.img-preview img { max-height: 72px; border-radius: 8px; }
.img-preview button { border: 0; background: transparent; color: var(--muted); }

@media (max-width: 1180px) {
  #page-home.active { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .land-nav nav { display: none; }
  .topbar {
    grid-template-columns: auto minmax(200px, 1fr) minmax(160px, 220px) auto auto auto;
  }
  .hand-note { display: none; }
}
@media (max-width: 860px) {
  .app, .landing { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .sidebar { display: none; }
  .panes, .land-foot, .settings-grid, .stats-grid, .other-ways { grid-template-columns: 1fr; }
  .search, .hand-note { display: none; }
}
