:root {
  color-scheme: dark;
  --bg: #090d12;
  --surface: #111820;
  --surface-2: #18212b;
  --surface-3: #202c38;
  --line: #344352;
  --line-strong: #526577;
  --text: #edf3f7;
  --muted: #9caab6;
  --accent: #35b779;
  --accent-strong: #58d391;
  --blue: #4f9cf9;
  --yellow: #f3c969;
  --red: #f05c67;
  --page-background: #090d12;
  --chat-background: #0f171f;
  --incoming-bubble: #1d2833;
  --outgoing-bubble: #1a4d38;
  --chat-text: #edf3f7;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  /* 补一百九十四：DEV482 组件代码引用的 --app-* 变量在主仓页面给原版值兜底
     （黑白主题引擎已从本页摘除，变量需有定义防止透明/白底失控） */
  --app-page: #090d12;
  --app-panel: #111820;
  --app-field: #18212b;
  --app-text: #edf3f7;
  --app-muted: #9caab6;
  --app-border: #344352;
  --app-accent: #35b779;
  --app-primary: #35b779;
  --app-wash: #16241c;
  --app-chart-header: #202c38;
}

/* Group-buy order ledger, mixed ticket projects and role views. */
.group-buy-project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.group-buy-project-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.group-buy-project-card header,
.group-buy-project-card > div,
.group-buy-project-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-buy-project-result { display:grid; gap:3px; padding:7px; border-radius:6px; background:#e2e8f0; color:#334155; }
.group-buy-project-result--hit { background:#dcfce7; color:#166534; }
.group-buy-project-result--miss { background:#f1f5f9; color:#475569; }
.group-buy-ticket-batches { display:grid; gap:6px; }
.group-buy-ticket-batches details { border:1px solid #cbd5e1; border-radius:7px; background:#f8fafc; color:#334155; }
.group-buy-ticket-batches summary { display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; padding:8px; cursor:pointer; }
.group-buy-ticket-batches summary span { overflow-wrap:anywhere; }
.group-buy-ticket-batches summary em { color:#166534; font-style:normal; }
.group-buy-ticket-batches dl { display:grid; grid-template-columns:90px minmax(0,1fr); gap:1px; margin:0; background:#cbd5e1; }
.group-buy-ticket-batches dt,.group-buy-ticket-batches dd { margin:0; padding:7px; background:#fff; }
.group-buy-ticket-batches pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.group-buy-auto-settlement { border-color:#d6aa4d; background:#fffaf0; color:#3f2c12; }
.group-buy-draw-result { display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; padding:9px; background:#30230f; color:#fff0b0; }
.group-buy-draw-result strong { text-align:center; font-size:20px; letter-spacing:3px; }
.group-buy-auto-settlement ul { display:grid; gap:4px; padding:0; list-style:none; }
.group-buy-auto-settlement li { display:grid; grid-template-columns:minmax(120px,auto) 1fr; gap:8px; padding:7px; background:#fff; }
.group-buy-ticket-range { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }

.collage-material-center { border-color:#567469; background:#112522; }
.collage-material-categories { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
.collage-material-categories button[aria-selected="true"] { border-color:#ffe078; background:#5c4818; color:#fff4b5; }
.collage-material-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; max-height:330px; overflow:auto; }
.collage-material-grid > button { display:flex; min-width:0; min-height:62px; align-items:center; gap:7px; border-color:#49645e; background:#172d29; text-align:left; }
.collage-material-grid i { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:2px solid var(--material-accent); border-radius:12px; background:var(--material); color:var(--material-accent); font-style:normal; font-weight:900; }
.collage-material-grid span { display:grid; min-width:0; gap:2px; }
.collage-material-grid small { overflow:hidden; color:#a9bbb5; text-overflow:ellipsis; white-space:nowrap; }

.group-buy-project-card p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #475569;
}

.group-buy-project-card footer {
  flex-wrap: wrap;
  font-size: 12px;
}

.group-buy-project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.group-buy-project-budget {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 6px 0;
  background: #cbd5e1;
}

.group-buy-project-budget > * {
  min-height: 42px;
  padding: 7px;
  background: #f8fafc;
  text-align: center;
}

.group-buy-project-budget .is-warning {
  color: #b91c1c;
  background: #fff1f2;
}

.group-buy-table small,
.group-buy-order-table td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.group-buy-order-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
}

.group-buy-order-status--pending { background: #fef3c7; color: #92400e; }
.group-buy-order-status--confirmed { background: #dcfce7; color: #166534; }
.group-buy-order-status--rejected,
.group-buy-order-status--cancelled,
.group-buy-order-status--expired { background: #fee2e2; color: #991b1b; }

.group-buy-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #cbd5e1;
}

.group-buy-public-grid > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 8px;
  min-height: 58px;
  padding: 7px 9px;
  background: #f8fafc;
}

.group-buy-public-grid span,
.group-buy-public-grid em { color: #64748b; font-size: 11px; }
.group-buy-public-grid b { text-align: right; color: #166534; }

.mobile-group-deadlines {
  display: grid;
  gap: 1px;
  margin: 0;
  background: #dbe2ea;
}

.mobile-group-deadlines span {
  min-height: 34px;
  padding: 7px 9px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.mobile-group-section {
  margin: 0;
  border-top: 1px solid #dbe2ea;
}

.mobile-group-section > summary {
  min-height: 38px;
  padding: 9px;
  background: #eef2f7;
  color: #1e293b;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 640px) {
  .group-buy-project-list,
  .group-buy-project-form,
  .group-buy-project-budget,
  .group-buy-public-grid {
    grid-template-columns: 1fr;
  }

  .group-buy-project-form .span-2 {
    grid-column: 1;
  }

  .group-buy-order-table {
    min-width: 720px;
  }
  .group-buy-ticket-range { grid-template-columns:1fr; }
  .group-buy-ticket-batches summary,.group-buy-draw-result { grid-template-columns:1fr; }
  .group-buy-auto-settlement li { grid-template-columns:1fr; }
  .collage-material-grid { grid-template-columns:1fr; max-height:260px; }

  .mobile-group-detail-panel,
  .mobile-group-detail-panel > * {
    min-width: 0;
    max-width: 100%;
  }

  .mobile-group-detail-panel .mobile-business-list article {
    overflow-wrap: anywhere;
  }
}

.ticket-prize-dialog {
  width: min(760px, calc(100vw - 18px));
  max-height: calc(100dvh - 18px);
  overflow: auto;
  border: 1px solid #45675f;
  border-radius: 8px;
  background: #0d171a;
  color: #eff8f4;
  padding: 0;
}

.ticket-prize-dialog::backdrop {
  background: rgba(4, 8, 12, 0.78);
}

.ticket-prize-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ticket-prize-shell > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #263f3b;
  padding-bottom: 10px;
}

.ticket-prize-shell h2 {
  margin: 0 0 3px;
  color: #ffe06a;
  font-size: 19px;
}

.ticket-prize-shell header span,
.ticket-prize-shell footer {
  color: #aebfba;
  font-size: 12px;
}

.ticket-prize-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ticket-prize-inputs .span-2 {
  grid-column: 1 / -1;
}

.ticket-prize-inputs textarea {
  min-height: 150px;
  resize: vertical;
}

.ticket-prize-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #2d4944;
  border-radius: 6px;
  background: #101f22;
}

.ticket-prize-preview img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 5px;
}

.ticket-prize-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.ticket-prize-result {
  display: grid;
  gap: 10px;
}

.ticket-prize-result__hero {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #735834;
  border-radius: 7px;
  background: linear-gradient(135deg, #311711, #1a332a);
}

.ticket-prize-result__hero span,
.ticket-prize-result__hero em {
  color: #f2ccb0;
  font-style: normal;
  font-size: 12px;
}

.ticket-prize-result__hero strong {
  color: #ffe083;
  font-size: 30px;
}

.ticket-prize-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ticket-prize-grid > div,
.ticket-prize-numbers {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #2f4743;
  border-radius: 6px;
  background: #101d20;
}

.ticket-prize-grid span,
.ticket-prize-numbers span {
  color: var(--muted);
  font-size: 11px;
}

.ticket-prize-grid b,
.ticket-prize-numbers b {
  color: #eff8f4;
  font-size: 13px;
}

.ticket-prize-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 6px;
  font-size: 12px;
}

.ticket-prize-table th,
.ticket-prize-table td {
  border: 1px solid #2d4642;
  padding: 7px;
  text-align: left;
}

.ticket-prize-table th {
  background: #17312d;
  color: #e8d184;
}

.ticket-prize-disclaimer {
  margin: 0;
  padding: 9px;
  border: 1px solid #705124;
  border-radius: 6px;
  background: #26190b;
  color: #ffd28f;
  font-weight: 700;
}

.ticket-prize-error {
  padding: 10px;
  border: 1px solid #8a434a;
  border-radius: 6px;
  background: #2d1216;
  color: #ffb6bd;
}

@media (max-width: 640px) {
  .ticket-prize-dialog {
    width: calc(100vw - 6px);
    max-height: calc(100dvh - 6px);
  }

  .ticket-prize-shell {
    padding: 9px;
  }

  .ticket-prize-shell > header,
  .ticket-prize-inputs {
    grid-template-columns: minmax(0, 1fr);
  }

  .ticket-prize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-background);
  color: var(--text);
  overflow-x: hidden;
}

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

.ai-jingcai-shortcuts {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border: 1px solid #315648;
  background: #10231d;
  padding: 7px 9px;
  margin-bottom: 7px;
}

.ai-jingcai-shortcuts strong {
  color: #77dda8;
  font-size: 13px;
}

.ai-jingcai-shortcuts span {
  min-width: 220px;
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 12px;
}

.ai-jingcai-shortcuts .button-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
}

.ai-store-toolbox {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  background: #0d171d;
  padding: 8px;
  margin-bottom: 10px;
}

.ai-store-toolbox__head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-store-toolbox__head strong {
  color: var(--text);
  font-size: 13px;
}

.ai-store-toolbox__head span {
  color: var(--muted);
  font-size: 11px;
}

.ai-store-toolbox__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.ai-store-toolbox__grid a,
.ai-store-toolbox__grid button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  justify-items: start;
  gap: 3px;
  border: 1px solid #3e5360;
  border-radius: 5px;
  background: #172630;
  color: var(--text);
  padding: 7px 9px;
  text-align: left;
  text-decoration: none;
}

.ai-store-toolbox__grid a:hover,
.ai-store-toolbox__grid button:hover {
  border-color: var(--accent-strong);
  background: #20343e;
}

.ai-store-toolbox__grid b {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ai-store-toolbox__grid span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .ai-store-toolbox__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ai-store-toolbox__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

button,
.button-link {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  border-color: var(--accent-strong);
  background: #273542;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button--primary {
  border-color: #319968;
  background: #18784f;
}

.button--danger {
  border-color: #a94a52;
  background: #642e34;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 20px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d131a;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(53, 183, 121, 0.15);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.hidden,
[hidden] {
  display: none !important;
}

.app {
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 54px 1fr;
  background: var(--page-background);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--page-background);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 196px;
  font-weight: 700;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  color: var(--accent-strong);
  font-size: 13px;
}

.topbar__title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.topbar__account {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
}

.public-tool-button {
  border-color: #a88d45;
  background: #5c4c22;
  color: #fff0a8;
  font-weight: 800;
}

.public-tool-button:hover {
  border-color: #e3c460;
  background: #75622b;
}

.appearance-button {
  border-color: color-mix(in srgb, var(--accent) 65%, #617181);
  background: color-mix(in srgb, var(--accent) 22%, var(--page-background));
  color: var(--text);
  font-weight: 700;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.sidebar {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--page-background);
  padding: 10px;
  overflow-y: auto;
}

.nav-button,
.sidebar-tool-link,
.sidebar-action-button {
  width: fit-content;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  text-align: left;
  white-space: nowrap;
  margin-bottom: 5px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-decoration: none;
}

.nav-button[aria-pressed="true"] {
  border-color: #2b8e62;
  background: #15382b;
  color: #d9ffeb;
}

.nav-button--chat-primary {
  min-height: 54px;
  border: 2px solid #f5d16c;
  background: #b51f31;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(181, 31, 49, 0.35);
}

.nav-button--chat-primary .nav-button__mark {
  color: #ffe98e;
}

.nav-button--chat-primary[aria-pressed="true"],
.nav-button--chat-primary:hover,
.nav-button--chat-primary:focus-visible {
  border-color: #fff0ad;
  background: #e12e3f;
  color: #fff;
}

.sidebar-tool-link {
  padding: 0 12px;
  border: 1px solid #536575;
  border-radius: 6px;
  background: #1b2a35;
  margin-bottom: 5px;
}

.sidebar-tool-link:hover,
.sidebar-tool-link:focus-visible {
  border-color: var(--accent-strong);
  background: #263d4b;
}

.sidebar-action-button {
  padding: 0 12px;
  border: 1px solid #655f48;
  border-radius: 6px;
  background: #2c291c;
  color: #fff0b2;
  cursor: pointer;
}

.sidebar-action-button:hover,
.sidebar-action-button:focus-visible {
  border-color: #dbc46b;
  background: #464024;
  color: #fff;
}

#externalSitesButton {
  border-color: #b58a29;
  background: #473716;
  color: #fff1b6;
  font-weight: 800;
}

#externalSitesButton .nav-button__mark {
  color: #ffd55f;
}

#externalSitesButton:hover,
#externalSitesButton:focus-visible {
  border-color: #ffe08a;
  background: #66501d;
  color: #fff;
}

.sidebar-tool-link--primary {
  min-height: 54px;
  border: 2px solid #54c8ff;
  background: #086da8;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(8, 109, 168, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.sidebar-tool-link--primary .nav-button__mark {
  color: #d9f5ff;
}

.sidebar-tool-link--primary:hover,
.sidebar-tool-link--primary:focus-visible {
  border-color: #bcecff;
  background: #0a8bd1;
  color: #fff;
  box-shadow: 0 5px 18px rgba(10, 139, 209, 0.58), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav-button__mark {
  color: var(--muted);
  font-weight: 700;
}

.main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--page-background);
}

.view {
  height: calc(100vh - 54px);
  min-height: 0;
}

.three-pane {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(360px, 1fr) minmax(280px, 380px);
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.4fr);
}

/* 用户管理左侧只保留用户卡片实际需要的宽度，避免卡片右侧出现整块空白。 */
#view-users.admin-view {
  grid-template-columns: clamp(410px, 28vw, 430px) minmax(0, 1fr);
}

.pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.pane:last-child {
  border-right: 0;
}

.pane__header {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #131c25;
}

.pane__header h2,
.pane__header h3 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane__body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.toolbar-row > input,
.toolbar-row > select {
  width: auto;
  min-width: 120px;
  flex: 1;
}

.list {
  display: grid;
  gap: 5px;
}

.list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  min-height: 60px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #151e27;
  text-align: left;
}

.list-item[aria-pressed="true"] {
  border-color: var(--accent);
  background: #183128;
}

.list-item--public-channel {
  border-color: #344c5b;
  background: #12212a;
}

.list-item--public-channel[aria-pressed="true"] {
  border-color: #6ec9f1;
  background: #173448;
}

.list-item--welfare-live {
  border-left: 4px solid #e04450;
}

.list-item--sports-live {
  border-left: 4px solid #3a94e8;
}

.list-item__title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.public-channel-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #617a89;
  border-radius: 4px;
  background: #243844;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.list-item--public-channel .list-item__title {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: initial;
}

.list-item--welfare-live .public-channel-mark,
.chat-avatar--welfare-live {
  border-color: #ef6b73;
  background: #9f2630;
}

.list-item--sports-live .public-channel-mark,
.chat-avatar--sports-live {
  border-color: #74baff;
  background: #1766a4;
}

.list-item__title > .badge {
  margin-left: auto;
}

.conversation-pin-mark {
  display: inline-grid;
  min-width: 20px;
  min-height: 18px;
  margin-left: 5px;
  place-items: center;
  border: 1px solid #d8b15b;
  border-radius: 4px;
  color: #8a5d12;
  background: #fff4cf;
  font-size: 10px;
  font-weight: 800;
}

.list-item__meta,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.badge--green {
  border-color: #318c63;
  color: #7ee2aa;
}

.badge--red {
  border-color: #a34b54;
  color: #ff8991;
}

.badge--yellow {
  border-color: #9d7d35;
  color: #f8d875;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.checkbox-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.chat-shell {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

/* 批TGW-DEV301：多选操作条用绝对覆盖层，不占 chat-shell 网格轨道——加第 4 条 auto 轨道会在桌面拖窄时把表单行挤成 0px（输入区溢出视口 17px）。 */
.chat-selection-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #17242c;
  color: #dce8ef;
  font-size: 12px;
}

.chat-selection-bar[hidden] { display: none; }

.chat-selection-bar strong { color: #b9ead3; }

.chat-selection-bar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.chat-selection-bar button {
  min-height: 32px;
  padding: 5px 11px;
}

.message__select {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #35b779;
}

.chat-view {
  position: relative;
}

.chat-directory-resizer {
  position: relative;
  z-index: 6;
  display: none;
  width: 6px;
  min-width: 6px;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}

.chat-directory-resizer::before {
  content: "";
  position: absolute;
  inset: 0 2px;
  background: var(--desktop-chat-line, #344352);
  transition: inset 120ms ease, background 120ms ease;
}

.chat-directory-resizer:hover::before,
.chat-directory-resizer:focus-visible::before,
.chat-directory-resizer.is-dragging::before {
  inset: 0 1px;
  background: var(--desktop-chat-brand, #35b779);
}

.chat-directory-resizer:focus-visible {
  outline: 2px solid var(--desktop-chat-brand, #35b779);
  outline-offset: -2px;
}

body.is-chat-directory-resizing {
  cursor: col-resize;
  user-select: none;
}

.chat-directory {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.chat-main {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--chat-background);
}

.chat-call-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.chat-call-button[hidden] { display: none; }

.chat-call-overlay {
  position: absolute;
  z-index: 20;
  top: 12px;
  right: 14px;
  width: min(420px, calc(100% - 28px));
  padding: 12px;
  border: 1px solid #476171;
  border-radius: 10px;
  background: #0e181f;
  color: #edf3f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.chat-call-overlay[hidden] { display: none; }

.chat-call-overlay__head,
.chat-call-overlay__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.chat-call-overlay__head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-call-overlay__head span {
  color: #a9bdc7;
  font-size: 12px;
}

.chat-call-overlay__head .icon-button {
  min-width: 36px;
  min-height: 36px;
}

.chat-call-stage {
  position: relative;
  min-height: 190px;
  margin: 10px 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #05080a;
}

.chat-call-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05080a;
}

.chat-call-video--local {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 28%;
  height: auto;
  aspect-ratio: 3 / 4;
  border: 2px solid #edf3f7;
  object-fit: cover;
}

.chat-call-overlay[data-media="audio"] .chat-call-video--remote {
  opacity: 0;
}

.chat-call-overlay[data-media="audio"] .chat-call-video--local {
  display: none;
}

.chat-call-overlay__actions {
  justify-content: flex-end;
}

.chat-call-overlay__actions button {
  min-height: 36px;
  padding: 6px 13px;
}

.chat-files-dialog {
  display: grid;
  gap: 12px;
  /* 批TGW-DEV407（BUG-20261004-TGW-006）：原 min-width:min(540px,78vw) 在 460px
     默认弹窗里必然横向溢出（内容左漂+横向滚动条）；改跨双列+上限100%，
     配合 dialog.gate__panel--chat-tools 宽度档达到设计宽度。 */
  grid-column: 1 / -1;
  min-width: min(540px, 100%);
}

.chat-files-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  color: var(--muted);
  font-size: 12px;
}

.chat-files-filter select {
  min-height: 34px;
}

.chat-files-list {
  display: grid;
  max-height: min(56vh, 480px);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--chat-background) 86%, #24313b);
}

.chat-files-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.chat-files-row:last-child { border-bottom: 0; }

.chat-files-row__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #dceee8;
  color: #176652;
  font-size: 12px;
  font-weight: 800;
}

.chat-files-row__main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.chat-files-row__main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-files-row__main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-files-row__download {
  min-height: 32px;
  padding: 5px 10px;
}

.chat-favorites-list {
  display: grid;
  max-height: min(56vh, 480px);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--chat-background) 86%, #24313b);
}

.chat-favorite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-favorite-row:last-child { border-bottom: 0; }

.chat-favorite-row__body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.chat-favorite-row__body span {
  overflow: hidden;
  color: var(--chat-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-favorite-row__body small {
  color: var(--muted);
  font-size: 11px;
}

.chat-favorite-row__remove {
  min-height: 32px;
  padding: 5px 10px;
}

.chat-readers-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-readers-list {
  display: grid;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  border: 1px solid var(--line);
}

.chat-reader-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.chat-reader-row:last-child { border-bottom: 0; }

.chat-message-search-dialog {
  display: grid;
  gap: 12px;
  /* 批TGW-DEV407：同 .chat-files-dialog，消除 460px 弹窗内的横向溢出。 */
  grid-column: 1 / -1;
  min-width: min(540px, 100%);
}

.chat-message-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-message-search-form input {
  min-width: 0;
  min-height: 36px;
}

.chat-search-results {
  display: grid;
  max-height: min(56vh, 480px);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--chat-background) 86%, #24313b);
}

.chat-search-result {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 74px 10px 11px;
  border-bottom: 1px solid var(--line);
}

.chat-search-result:last-child { border-bottom: 0; }

.chat-search-result__meta {
  color: var(--muted);
  font-size: 11px;
}

.chat-search-result__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-result__locate {
  position: absolute;
  top: 50%;
  right: 10px;
  min-height: 32px;
  padding: 5px 9px;
  transform: translateY(-50%);
}

.message.is-search-hit .message__bubble {
  outline: 3px solid #efbd58;
  outline-offset: 2px;
}

.chat-head__identity {
  min-width: 0;
  flex: 1;
}

.chat-head__identity h2 {
  margin-bottom: 2px;
}

.chat-typing-status {
  display: block;
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-typing-status[hidden] { display: none; }

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #101820;
}

.chat-tabs button {
  min-width: 0;
  padding: 9px 3px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.chat-tabs button:last-child {
  border-right: 0;
}

.chat-tabs button[aria-selected="true"] {
  box-shadow: inset 0 -2px var(--accent);
  background: #173126;
  color: #d9ffeb;
}

.chat-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #111920;
}

.chat-search input {
  width: 100%;
  min-height: 34px;
}

.chat-search__add {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #1a252f;
  color: var(--text);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.chat-search__add[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-quick-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% - 3px);
  left: 8px;
  right: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(300px, calc(100vw - 24px));
  max-height: min(360px, calc(100dvh - 220px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #566674;
  border-radius: 6px;
  background: #202c37;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.chat-quick-menu[hidden] {
  display: none;
}

.chat-quick-menu button {
  /* TGWDEV476 / BUG-046：文字入口没有图标，不再落入仅28px的第一格。 */
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  color: #f3f7fa;
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
}

.chat-quick-menu button:last-child {
  border-bottom: 0;
}

.chat-quick-menu button:hover,
.chat-quick-menu button:focus-visible {
  background: #31404d;
  outline: none;
}

.chat-quick-menu button span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  flex: 0 0 26px;
}

.chat-toolbox {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--chat-background) 82%, #20303c);
  overflow-x: auto;
}

.chat-toolbox label {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.chat-toolbox select {
  width: 94px;
  min-height: 32px;
  padding: 4px 7px;
}

.chat-toolbox a {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #18232d;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

.chat-toolbox a:hover,
.chat-toolbox a:focus-visible {
  border-color: var(--accent);
  color: #d9ffeb;
}

.messages {
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background: var(--chat-background);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.messages--custom-background {
  background-attachment: local;
}

/* TGWIMDEV004: reserve the overlay toolbar inside the scroll area, without
   adding a grid row or moving the composer. Keep the first checkbox reachable. */
#view-chat .chat-selection-bar:not([hidden]) + .messages {
  padding-top: 76px;
  scroll-padding-top: 76px;
}

.message {
  width: fit-content;
  max-width: min(76%, 680px);
  margin: 0 0 13px;
  color: var(--chat-text);
}

.message--mine {
  margin-left: auto;
}

.message__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

/* TGWDEV710: an explicit text role accompanies the red name; color alone is insufficient. */
.chat-management-name,
.chat-management-role {
  color: #c62828;
  font-weight: 700;
}
.chat-management-role { margin-left: 4px; }
.chat-member-management-row[data-group-role="owner"] .member-row__name,
.chat-member-management-row[data-group-role="admin"] .member-row__name,
.chat-member-action-summary[data-group-role="owner"] > span:last-child,
.chat-member-action-summary[data-group-role="admin"] > span:last-child,
.chat-member-management-row[data-group-role="owner"] .member-row__name small,
.chat-member-management-row[data-group-role="admin"] .member-row__name small,
.chat-member-action-summary[data-group-role="owner"] small,
.chat-member-action-summary[data-group-role="admin"] small {
  color: #c62828;
  font-weight: 700;
}

.message__mention {
  color: #147a52;
  font-weight: 800;
}

.message__mention--me {
  color: #a35e00;
}

.message__mention-badge {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 1px 5px;
  border: 1px solid #c1893e;
  border-radius: 4px;
  color: #a35e00;
  font-size: 10px;
  font-weight: 800;
}

.message--highlighted .message__bubble {
  border-color: #8d6b2d;
}

.message__highlight-badge {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 1px 5px;
  border: 1px solid #80652e;
  border-radius: 4px;
  color: #f2cf78;
  font-size: 10px;
}

.message__checkin {
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #3e8064;
  border-radius: 6px;
  background: #172b24;
}

.message__checkin span {
  color: var(--muted);
  font-size: 11px;
}

.message__checkin-button {
  justify-self: start;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.message__solitaire {
  display: grid;
  gap: 4px;
  min-width: 230px;
  padding: 10px;
  border: 1px solid #4e7190;
  border-radius: 6px;
  background: #172633;
}

.message__solitaire > span {
  color: var(--muted);
  font-size: 11px;
}

.message__solitaire-item {
  overflow: hidden;
  padding: 4px 6px;
  border-left: 2px solid #4e7190;
  color: #c8d9e5;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message__solitaire-button {
  justify-self: start;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.message--mine .message__meta {
  justify-content: flex-end;
  text-align: right;
}

.message__action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #82c9ac;
  font-size: 11px;
}

.message__action:hover {
  color: #baffdc;
}

.message__read-status {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.message__read-status:hover {
  color: var(--chat-text);
}

.message__action-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.message__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 1px;
  cursor: pointer;
}

.message__more:hover,
.message__more:focus-visible,
.message__more[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--chat-text);
  outline: none;
}

.message__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  min-width: 148px;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  text-align: left;
}

.message--mine .message__menu {
  right: 0;
  left: auto;
}

.message__menu[hidden] {
  display: none;
}

.message__menu-item {
  min-height: 30px;
  padding: 5px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--chat-text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.message__menu-item:hover,
.message__menu-item:focus-visible {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  color: var(--accent-strong);
  outline: none;
}

.message--system,
.message--recalled {
  max-width: 100%;
  margin: 8px auto 13px;
  color: var(--muted);
  text-align: center;
}

.message--system .message__bubble,
.message--recalled .message__bubble {
  display: inline-block;
  padding: 4px 9px;
  border: 0;
  background: #111920;
  color: var(--muted);
  font-size: 12px;
}

.chat-composer-status {
  padding: 7px 11px;
  border-top: 1px solid #785e27;
  background: #2b2518;
  color: #f3d47a;
  font-size: 12px;
}

.message__bubble {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--incoming-bubble);
  color: var(--chat-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.message__transcription {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(143, 199, 179, 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.message--mine .message__bubble {
  border-color: #3aa675;
  background: var(--outgoing-bubble);
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px 74px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #121a22;
}

.chat-mention-popup {
  position: absolute;
  z-index: 20;
  left: 86px;
  bottom: 70px;
  display: grid;
  width: min(360px, calc(100% - 190px));
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #3f6870;
  border-radius: 8px;
  background: #10232a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.chat-mention-popup[hidden] { display: none; }

.chat-mention-option {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e8f6f0;
  text-align: left;
  font-size: 13px;
}

.chat-mention-option:hover,
.chat-mention-option:focus-visible,
.chat-mention-option[aria-selected="true"] {
  outline: 0;
  background: #1c5648;
  color: #fff;
}

#messageInput {
  width: 100%;
  min-width: 0;
  grid-column: 2;
}

#messageSendButton {
  width: 74px;
  min-width: 74px;
  grid-column: 4;
}

.composer__side-button {
  width: 48px;
  min-width: 48px;
  min-height: 42px;
  border-color: #536977;
  background: #1b2b35;
  color: #edf3f7;
  font-size: 20px;
  font-weight: 800;
}

.composer__voice-button { grid-column: 1; }
.composer__emoji-button { grid-column: 3; }

.composer__side-button[aria-pressed="true"],
.composer__adaptive-button[aria-expanded="true"]:not(.is-send) {
  border-color: #45c786;
  background: #176746;
  color: #fff;
}

.composer__tools {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  padding: 8px;
  border: 1px solid #405563;
  border-radius: 6px;
  background: #111d25;
}

.composer__tools[hidden] {
  display: none;
}

.composer__tools-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(72px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.composer__tools-row:nth-child(2) {
  grid-template-columns: repeat(6, minmax(82px, 1fr));
}

.composer__tools button {
  min-width: 0;
  min-height: 36px;
  padding: 5px 8px;
  border-color: #536977;
  background: #182630;
  color: #edf3f7;
  font-size: 12px;
  white-space: nowrap;
}

.composer__tools button[aria-pressed="true"] {
  border-color: #45c786;
  background: #176746;
  color: #fff;
}

.composer__emoji-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, minmax(30px, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid #405563;
  background: #111d25;
}

.composer__emoji-panel[hidden] { display: none; }

.composer__emoji-panel button {
  min-height: 32px;
  padding: 0;
  font-size: 20px;
}

.composer__reply {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #476171;
  background: #17242c;
  color: #dce8ef;
  font-size: 12px;
}

.composer__reply > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer__reply strong { color: #b9ead3; }

.composer__reply button {
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #536977;
  background: transparent;
  color: #dce8ef;
}

.composer__reply[hidden] { display: none; }

.message__reply-ref {
  margin: -2px 0 7px;
  padding: 5px 7px;
  border-left: 3px solid #52bd8a;
  background: rgba(19, 45, 41, 0.34);
  color: #b9d5ca;
  font-size: 12px;
  line-height: 1.4;
}

.message__merged {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #476171;
  background: #17242c;
}

.message__merged strong {
  flex: 1;
  color: #dce8ef;
}

.message__merged-button {
  min-height: 32px;
  padding: 5px 10px;
  border-color: #536977;
  background: transparent;
  color: #b9ead3;
}

.chat-merged-detail {
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.chat-merged-detail__row {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.chat-merged-detail__row small { color: var(--muted); }

.composer__attachment {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #476171;
  background: #0d1820;
  color: #dce8ef;
  font-size: 12px;
}

.composer__attachment[hidden] { display: none; }

.composer__attachment-preview {
  display: block;
  width: 72px;
  height: 52px;
  border: 1px solid #536977;
  background: #070b0e;
  object-fit: cover;
}

.composer__attachment-preview--audio { width: 170px; }

.composer__attachment-preview--file {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #b9ead3;
  font-weight: 700;
}

.composer__attachment-cancel {
  min-width: 74px;
  border-color: #8c4b50;
  background: #3b2024;
}

.message__video {
  display: block;
  width: min(520px, 100%);
  max-height: 420px;
}

.message__video { background: #05080a; }

.message__audio { display: none; }

.message--audio .message__bubble,
html body #view-chat .message--audio .message__bubble {
  max-width: 100%;
  padding: 0 !important;
  overflow: hidden;
  white-space: normal;
}

.message__voice-player {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.message__voice {
  display: flex;
  width: var(--voice-width, 124px);
  max-width: min(260px, calc(100vw - 118px));
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

html body #view-chat .message__voice { min-height: 44px !important; }

.message--mine .message__voice { flex-direction: row-reverse; }

.message__voice:focus-visible {
  outline: 2px solid var(--active-chat-accent, #16846c);
  outline-offset: -3px;
}

.message__voice-duration {
  min-width: 30px;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.message__voice-wave {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.message__voice-wave i {
  display: block;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.message__voice-wave i:nth-child(2),
.message__voice-wave i:nth-child(4) { height: 13px; }

.message__voice-wave i:nth-child(3) { height: 19px; }

.message__voice.is-playing .message__voice-wave i {
  animation: chat-voice-wave 0.72s ease-in-out infinite alternate;
}

.message__voice.is-playing .message__voice-wave i:nth-child(2) { animation-delay: -0.24s; }
.message__voice.is-playing .message__voice-wave i:nth-child(3) { animation-delay: -0.48s; }
.message__voice.is-playing .message__voice-wave i:nth-child(4) { animation-delay: -0.12s; }
.message__voice.is-error { color: #b62e3b; }

@keyframes chat-voice-wave {
  from { transform: scaleY(0.45); opacity: 0.62; }
  to { transform: scaleY(1); opacity: 1; }
}

.message__file {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 100%);
  max-width: 420px;
  padding: 10px;
  border: 1px solid #476171;
  background: #101c24;
}

.message__file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #5f8e7b;
  background: #18352a;
  color: #b9ead3;
  font-weight: 700;
}

.message__file-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.message__file-details strong,
.message__file-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message__file-details small { color: #9db0ba; }

.message__file-download {
  min-width: 54px;
  min-height: 36px;
  padding: 6px 9px;
}

.composer textarea {
  min-height: 58px;
  max-height: 150px;
}

.chat-info-card {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.chat-info-card:last-child {
  border-bottom: 0;
}

.chat-info-card h4 {
  margin: 0 0 9px;
  font-size: 14px;
}

.chat-announcement-image {
  display: block;
  width: min(100%, 360px);
  max-height: 220px;
  margin-top: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chat-announcement-link {
  display: inline-block;
  margin-top: 8px;
  color: #237d5e;
  font-size: 12px;
  font-weight: 800;
}

.chat-announcement-confirm {
  margin-top: 10px;
}

.chat-confirmation-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.chat-info-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #3c8064;
  border-radius: 6px;
  background: #18352a;
  color: #aaf4ce;
  font-weight: 700;
}

.member-list {
  display: grid;
  gap: 6px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
}

.member-row--selectable {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.chat-member-batch-tools {
  margin: 8px 0;
}

.chat-member-batch-tools select {
  min-height: 30px;
  max-width: 180px;
}

.member-row__name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.member-row__actions {
  display: flex;
  gap: 4px;
}

.member-row__actions button,
.chat-danger-button {
  min-height: 28px;
  padding: 3px 7px;
  font-size: 11px;
}

.chat-highlight-list {
  display: grid;
  gap: 6px;
}

.chat-highlight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #5c4d2f;
  border-radius: 5px;
  background: #1b1c1a;
}

.chat-highlight-row__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-highlight-row__body span,
.chat-highlight-row__body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-highlight-row__remove {
  min-height: 28px;
  padding: 3px 7px;
  font-size: 11px;
}

.chat-checkins-card__heading {
  justify-content: space-between;
}

.chat-checkins-card__heading h4 {
  margin-bottom: 0;
}

.chat-checkins-card__heading button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.chat-checkin-list {
  display: grid;
  gap: 6px;
}

.chat-checkin-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
  color: var(--text);
  text-align: left;
}

.chat-checkin-row:hover,
.chat-checkin-row:focus-visible {
  border-color: var(--accent);
}

.chat-checkin-row span {
  color: var(--muted);
  font-size: 11px;
}

.chat-checkin-detail {
  display: grid;
  gap: 10px;
}

.chat-checkin-detail__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-checkin-records {
  display: grid;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.chat-checkin-record {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px;
  border-bottom: 1px solid var(--line);
}

.chat-checkin-record span {
  color: var(--muted);
  font-size: 11px;
}

.chat-checkin-detail__tools {
  align-items: center;
}

.chat-export-dialog {
  display: grid;
  gap: 10px;
}

.chat-export-status {
  font-weight: 700;
}

.chat-export-note {
  color: var(--muted);
  font-size: 12px;
}

.chat-export-actions {
  align-items: center;
}

.chat-solitaires-card__heading {
  justify-content: space-between;
}

.chat-solitaires-card__heading h4 {
  margin-bottom: 0;
}

.chat-solitaires-card__heading button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.chat-solitaire-list {
  display: grid;
  gap: 6px;
}

.chat-solitaire-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
  color: var(--text);
  text-align: left;
}

.chat-solitaire-row:hover,
.chat-solitaire-row:focus-visible {
  border-color: #4e7190;
}

.chat-solitaire-row span {
  color: var(--muted);
  font-size: 11px;
}

.chat-solitaire-detail {
  display: grid;
  gap: 10px;
}

.chat-solitaire-detail__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-solitaire-items {
  display: grid;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.chat-solitaire-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border-bottom: 1px solid var(--line);
}

.chat-solitaire-item > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-solitaire-item span {
  overflow-wrap: anywhere;
}

.chat-solitaire-item small {
  color: var(--muted);
  font-size: 11px;
}

.chat-solitaire-item__remove {
  min-height: 28px;
  padding: 3px 7px;
  font-size: 11px;
}

.chat-solitaire-input {
  display: grid;
  gap: 4px;
}

.chat-solitaire-detail__tools {
  align-items: center;
}

.chat-danger-button {
  border-color: #8a434a;
  color: #ff9da3;
}

.request-section-title {
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.list-item__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.list-item__actions button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11px;
}

.friend-swipe-row {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 6px;
}

.friend-swipe-row > .list-item {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  touch-action: pan-y;
  transition: transform 180ms ease;
}

.friend-swipe-row.is-swipe-open > .list-item {
  transform: translateX(-176px);
}

.friend-swipe-actions {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-columns: 88px 88px;
  width: 176px;
  height: 100%;
}

.friend-swipe-actions button {
  min-width: 0;
  min-height: 100%;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: #a96818;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.friend-swipe-actions .chat-danger-button {
  background: #b82531;
  color: #fff;
}

#chatInfoClose {
  display: none;
}

.ai-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--chat-background);
}

.ai-workbench {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0e161e;
}

.ai-context-bar {
  display: grid;
  grid-template-columns: 150px 150px minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 9px 16px 7px;
}

.ai-context-bar label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
}

.ai-context-bar select {
  min-width: 0;
  max-width: 100%;
}

.ai-context-bar select,
.ai-workflow-buttons button,
.ai-lottery-shortcuts button,
.ai-information-strip button {
  min-height: 32px;
}

.ai-workflow-buttons,
.ai-lottery-shortcuts {
  display: flex;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.ai-workflow-buttons button {
  min-width: 92px;
  border-color: #416176;
  background: #173044;
}

.ai-workflow-buttons button:hover,
.ai-workflow-buttons button[aria-pressed="true"] {
  border-color: #69b7ea;
  background: #245878;
}

.ai-lottery-shortcuts {
  padding: 0 16px 8px;
}

.ai-lottery-shortcuts button {
  min-width: 74px;
  padding: 0 10px;
  border-color: #42654f;
  background: #173223;
}

.ai-lottery-shortcuts button:hover {
  border-color: #68d095;
  background: #245338;
}

.ai-information-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 5px 16px 6px;
  border-top: 1px solid #263746;
  background: #111b24;
}

.ai-information-strip > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.ai-information-strip > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-information-list {
  display: flex;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.ai-information-item {
  flex: 0 0 min(360px, 78vw);
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #354a5b;
  background: #14222d;
  cursor: pointer;
}

.ai-information-item strong,
.ai-information-item span {
  display: block;
}

.ai-information-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ai-information-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ai-head {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 174px 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #131c25;
}

.ai-model-notice {
  border: 1px solid #c58a2c;
  background: #251b0d;
  color: #ffd992;
  padding: 5px 14px;
  font-size: 12px;
  line-height: 1.4;
}

.ai-model-notice[hidden] {
  display: none;
}

.ai-head__main {
  min-width: 0;
}

.ai-head strong {
  display: block;
  margin-bottom: 3px;
}

.ai-head__tools,
.ai-composer__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.ai-head__tools {
  min-width: 0;
  max-width: 100%;
}

.compact-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  color: var(--text);
  white-space: nowrap;
}

.compact-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.ai-conversation {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px max(16px, calc((100% - 920px) / 2));
  overflow-y: auto;
  background: var(--chat-background);
}

.ai-message {
  width: fit-content;
  max-width: min(82%, 920px);
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--incoming-bubble) 60%, #738697);
  border-radius: 7px;
  background: var(--incoming-bubble);
  color: var(--chat-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.ai-message--user {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--outgoing-bubble) 55%, var(--accent));
  background: var(--outgoing-bubble);
}

.ai-message__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-message__content {
  white-space: pre-wrap;
}

.ai-sources {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.ai-source {
  display: grid;
  gap: 2px;
  color: var(--muted);
}

.ai-source a {
  color: #83b8ff;
  overflow-wrap: anywhere;
}

.ai-memory-note {
  margin-top: 8px;
  color: var(--yellow);
  font-size: 12px;
}

.ai-response-context,
.ai-response-notice {
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px solid #364a5a;
  background: #101921;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ai-response-notice {
  border-color: #675b36;
  color: #e8ce82;
}

.ai-follow-up {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.ai-follow-up > strong {
  color: #a9d9c5;
  font-size: 12px;
}

.ai-follow-up__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ai-follow-up__options button {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #3f775f;
  border-radius: 5px;
  background: #123a2d;
  color: #e8fff6;
  text-align: left;
}

.ai-follow-up__options button:hover,
.ai-follow-up__options button:focus-visible {
  border-color: #5fd69d;
  background: #18503c;
}

.ai-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.ai-message-actions a,
.ai-message-actions button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #46657a;
  border-radius: 5px;
  background: #173044;
  color: #eaf4fb;
  font-size: 12px;
  text-decoration: none;
}

.ai-message-actions .ai-feedback-button {
  margin-left: auto;
  border-color: #735d45;
  background: #35291f;
}

.ai-source-badge {
  display: inline-block;
  width: fit-content;
  margin-right: 5px;
  padding: 1px 5px;
  border: 1px solid #4b765f;
  border-radius: 3px;
  background: #173424;
  color: #8be8b6;
  font-weight: 700;
}

.ai-composer {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px max(16px, calc((100% - 920px) / 2));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--chat-background) 85%, #20303c);
}

.appearance-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chat-background);
}

.appearance-preview__bubble {
  width: fit-content;
  max-width: 80%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--incoming-bubble);
  color: var(--chat-text);
}

.appearance-preview__bubble--mine {
  justify-self: end;
  background: var(--outgoing-bubble);
}

.appearance-presets {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-composer textarea {
  min-height: 62px;
  max-height: 160px;
}

.ai-voice-status {
  grid-column: 1 / -1;
  min-height: 16px;
  font-size: 12px;
}

.ai-voice-status.is-listening {
  color: var(--accent-strong);
}

#aiVoiceButton.is-listening {
  border-color: var(--red);
  background: #71323a;
  animation: ai-listening-pulse 1s ease-in-out infinite;
}

@keyframes ai-listening-pulse {
  50% { box-shadow: 0 0 0 4px rgba(240, 92, 103, 0.18); }
}

.ai-settings-summary {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #111923;
  color: var(--muted);
  line-height: 1.6;
}

.ai-settings-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.ai-settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #121b24;
}

.ai-settings-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.recommendation-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141d25;
  padding: 12px;
}

.recommendation-card + .recommendation-card {
  margin-top: 8px;
}

.recommendation-card__head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.recommendation-card__head strong {
  flex: 1;
}

.recommendation-manage-row { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.recommendation-manage-row > .list-item { flex: 1; min-width: 0; }
.recommendation-manage-row > input { margin-top: 15px; }
.recommendation-card__content {
  color: #d7e0e7;
  white-space: pre-wrap;
  line-height: 1.65;
}

.number-balls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 9px 0;
}

.number-ball {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border-radius: 50%;
  background: #b92f3c;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.recommendation-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin-top: 9px;
  border: 1px solid var(--line);
  background: #090d12;
}

.ranking-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ranking-table th,
.ranking-table td,
.data-table th,
.data-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ranking-table th,
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #17212a;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #151f28;
}

.metric__value {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 11, 0.9);
}

.gate__panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.auth-tabs,
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1117;
}

.auth-tabs button,
.admin-tabs button {
  flex: 1;
  border-color: transparent;
  background: transparent;
}

.auth-tabs button[aria-selected="true"],
.admin-tabs button[aria-selected="true"] {
  border-color: #32966a;
  background: #174b37;
  color: #dcffeb;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.oauth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.oauth-actions button:first-child {
  border-color: #32885e;
  background: #174f38;
}

.oauth-actions button:last-child {
  border-color: #3975a8;
  background: #193e5c;
}

.oauth-actions button.is-unavailable {
  border-color: var(--line);
  background: #192029;
  color: var(--muted);
}

.auth-provider-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.auth-cancel {
  width: 100%;
  margin: 10px 0;
}

.workspace-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #111a22;
}

.workspace-head > div {
  min-width: 0;
  flex: 1;
}

.workspace-head h2,
.account-card h3 {
  margin: 0;
}

.workspace-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.community-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #0d151b;
}

.community-view.hidden { display: none; }
.community-head { flex-wrap: wrap; }
.community-head > div:first-child { min-width: max-content; }
.community-head h2 { white-space: nowrap; }

.community-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #121d25;
}

.community-tabs button[aria-selected="true"] {
  border-color: #44bf81;
  background: #176846;
  color: #fff;
}

.community-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(250px, 340px);
  justify-content: center;
  gap: 16px;
  padding: 16px;
  overflow: auto;
}

.community-feed {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.community-post,
.community-side > section {
  border: 1px solid #344853;
  border-radius: 6px;
  background: #121d25;
}

.community-post { padding: 14px; }

.community-post--pinned { border-color: #aa8a38; }

.community-post > header,
.community-post > header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.community-post > header { justify-content: space-between; }

.community-post > header > div > div {
  display: grid;
  gap: 2px;
}

.community-post > header span,
.community-comment time {
  color: var(--muted);
  font-size: 12px;
}

.community-post__avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #4d7164;
  border-radius: 50%;
  background: #194f3b;
  color: #fff;
  font-weight: 700;
}

.community-post__content {
  margin: 12px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.community-post__media {
  display: block;
  width: min(100%, 680px);
  max-height: 560px;
  margin-bottom: 12px;
  border: 1px solid #344853;
  background: #070b0e;
  object-fit: contain;
}

.community-post__review-note {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #7b6535;
  background: #292416;
  color: #efd47a;
}

.community-comments {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 9px;
  background: #0c171e;
}

.community-comment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.community-comment button { padding: 3px 7px; }

.community-post__actions,
.community-side__actions,
.community-report-list article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-post__actions button.is-active {
  border-color: #49c885;
  background: #176846;
}

.community-post__actions button.is-danger {
  border-color: #965058;
  background: #49242a;
}

.community-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.community-side > section { padding: 12px; }

.community-side p {
  color: #b8c6ce;
  line-height: 1.6;
}

.community-side label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.community-report-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.community-report-list article {
  padding: 8px;
  border: 1px solid #435865;
  background: #0d171d;
}

.community-report-list p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .community-layout { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 10px; }
  .community-head { flex-wrap: wrap; }
}

.account-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0c1319;
}

.account-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 12px;
  overflow: auto;
}

.account-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #121b23;
}

.account-card--profile,
.account-card--ledger {
  grid-column: 1 / -1;
}

.account-card h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

.account-card p {
  color: var(--muted);
  line-height: 1.65;
}

.account-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.account-profile-head strong,
.account-profile-head span {
  display: block;
}

.account-profile-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #0c151c;
}

.profile-account-actions #accountName {
  flex: 1 1 240px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  border: 1px solid #3a9b70;
  border-radius: 50%;
  background: #174b37;
  color: #d9ffeb;
  font-size: 21px;
  font-weight: 800;
}

.account-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-bindings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-bindings > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #0d151c;
}

.account-bindings span {
  color: var(--muted);
  font-size: 12px;
}

.account-bindings strong {
  color: #80dfad;
  font-size: 13px;
}

.privacy-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.privacy-switch span,
.privacy-switch strong,
.privacy-switch small {
  display: block;
}

.privacy-switch strong {
  color: var(--text);
}

.privacy-switch small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.privacy-switch input {
  width: 42px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.notice--privacy {
  margin-top: 12px;
}

.referral-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-code-row code {
  min-width: 180px;
  padding: 9px 12px;
  border: 1px dashed #4d6a7c;
  background: #0a1117;
  color: #8be8b6;
  font-size: 17px;
  letter-spacing: 1px;
}

.reward-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.reward-rule-list > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #0e171e;
  color: var(--muted);
}

.reward-rule-list strong {
  color: var(--yellow);
}

.account-ledger {
  max-height: 260px;
  overflow: auto;
}

.account-ledger-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 150px;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.account-ledger-row strong.is-positive {
  color: #75dca5;
}

.account-ledger-row strong.is-negative {
  color: #ff8991;
}

.account-ledger-row time {
  color: var(--muted);
  text-align: right;
}

.admin-user-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 116px;
  gap: 7px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #101821;
}

#adminMobileOpen {
  display: none;
}

.admin-view .pane:first-child {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-tabs {
  flex-wrap: wrap;
  margin: 8px 10px 0;
  position: relative;
  z-index: 2;
  background: #0b1117;
}

.admin-tabs button {
  min-width: 92px;
}

.admin-panel {
  padding-top: 10px;
}

.admin-view > .pane:last-child {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-section {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #101922;
}

.admin-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.admin-moderation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-moderation-head h3 {
  margin: 0;
}

.admin-moderation-queue .data-table td small {
  display: block;
  max-width: 520px;
  margin-top: 3px;
  white-space: normal;
}

@media (max-width: 720px) {
  .admin-moderation-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-group {
  border: 1px solid var(--line);
  background: #0e171e;
}

.permission-group h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #192630;
  color: #8be8b6;
}

.permission-group__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
}

.permission-item {
  min-width: 0;
  padding: 7px;
  border: 1px solid #263644;
  background: #0a1218;
}

.permission-item strong,
.permission-item code {
  display: block;
}

.permission-item code {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.admin-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
}

.admin-user-directory {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.admin-panel--user-directory {
  overflow: hidden;
}

.admin-user-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.admin-user-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111c24;
}

.admin-user-summary span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-summary strong {
  color: #ecf7fb;
  font-size: 17px;
}

.admin-user-directory__tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(112px, 150px)) minmax(188px, auto);
  gap: 7px;
  margin-bottom: 8px;
}

.admin-contact-visibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #3d6872;
  border-radius: 5px;
  background: #10242a;
  color: #d8f4ef;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.admin-contact-visibility input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #18a17b;
}

.admin-user-result {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-table-wrap {
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.admin-user-table {
  min-width: 1760px;
}

.admin-user-table th {
  white-space: nowrap;
}

.admin-user-table th:nth-child(2),
.admin-user-table td:nth-child(2) {
  min-width: 92px;
}

.admin-user-table th:nth-child(3),
.admin-user-table td:nth-child(3) {
  min-width: 116px;
}

.admin-user-table th:nth-child(4),
.admin-user-table td:nth-child(4) {
  min-width: 94px;
}

.admin-user-table th:nth-child(5),
.admin-user-table td:nth-child(5),
.admin-user-table th:nth-child(7),
.admin-user-table td:nth-child(7),
.admin-user-table th:nth-child(8),
.admin-user-table td:nth-child(8) {
  min-width: 154px;
}

.admin-user-table th:nth-last-child(-n + 4),
.admin-user-table td:nth-last-child(-n + 4) {
  width: 92px;
  min-width: 92px;
  text-align: center;
}

.admin-user-table td {
  white-space: nowrap;
}

.admin-user-table td:first-child,
.admin-user-table .admin-user-permissions {
  white-space: normal;
}

.admin-user-table td:first-child {
  min-width: 178px;
}

.admin-user-table .admin-user-permissions {
  min-width: 220px;
  max-width: 320px;
}

.admin-user-table .admin-user-permissions small {
  white-space: normal;
  line-height: 1.4;
}

.admin-user-table button {
  width: 100%;
  white-space: nowrap;
}

.admin-table-wrap .data-table button {
  min-height: 28px;
  padding: 0 8px;
}

.admin-table-wrap input[type="number"] {
  min-width: 64px;
  padding: 5px 6px;
}

.professional-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.professional-admin-head h3,
.professional-admin-head p {
  margin: 0;
}

.professional-admin-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-table-wrap .data-table td strong,
.admin-table-wrap .data-table td small {
  display: block;
}

.admin-table-wrap .data-table td small {
  max-width: 360px;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-feedback-review {
  max-height: 430px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #0d151c;
}

.ai-feedback-review p {
  margin: 5px 0 13px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.configuration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.configuration-card {
  padding: 12px;
  border: 1px solid var(--line);
  background: #0c151c;
}

.configuration-card strong,
.configuration-card span {
  display: block;
}

.configuration-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.list-item__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.list-item__fact {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 11px;
}

.user-owner-provision-button {
  width: auto;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 12px;
}

.user-owner-provision-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: visible;
  margin-top: 8px;
}

.user-owner-provision-actions button {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

/* TGWDEV486 / BUG-20261010-TGW-075: compact dropdown and vertical details, no sideways scroll. */
.admin-view .list-item { white-space: nowrap; overflow: hidden; min-width: 0; }
.admin-view .list-item :is(.list-item__title,.list-item__meta,.list-item__fact) { white-space: nowrap; }
.admin-view .list-item__title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.admin-view .list-item__meta { overflow: hidden; text-overflow: ellipsis; }
.admin-view :is(.toolbar-row,.user-owner-provision-actions) { flex-wrap: nowrap; }
.admin-view .list-item__fact { flex: 0 0 auto; }
.admin-view button { white-space: nowrap; flex-shrink: 0; min-width: max-content; }
.user-account-heading { align-items: center; justify-content: flex-start; gap: 6px; }
.user-account-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.user-account-actions { width: 5.2em; flex: 0 0 5.2em; min-width: 0; max-width: 5.2em; white-space: nowrap; padding: 4px 6px; font-size: 12px; }
.admin-view .user-account-avatar { position: relative; width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px; padding: 0; border-radius: 50%; overflow: hidden; }
.user-account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-account-details { margin-top: 7px; min-width: 0; font-size: 12px; color: var(--muted); }
.user-account-details > summary { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-account-details .list-item__facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.user-account-details .list-item__fact { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 700px) {
  .user-owner-provision-actions { width: 100%; }
}

.user-owner-provision-button.is-complete,
.user-owner-provision-button.is-complete:disabled {
  border-color: #278c54;
  background: #183d2a;
  color: #72e1a0;
  opacity: 1;
  cursor: default;
}

.owner-provision-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.owner-provision-status.is-error {
  color: #ff7b7b;
}

.owner-lifecycle,
.admin-account-danger,
.store-staff-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #425564;
  background: #0d171f;
}

.owner-lifecycle > strong,
.store-staff-permissions > strong {
  grid-column: 1 / -1;
}

.admin-account-danger {
  display: flex;
  justify-content: flex-end;
  border-color: #663940;
  background: #241216;
}

dialog.gate__panel {
  position: fixed;
  inset: 50% auto auto 50%;
  max-height: calc(100vh - 36px);
  margin: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  color: var(--text);
}

dialog.gate__panel--wide {
  width: min(1100px, calc(100vw - 36px));
}

/* 批TGW-DEV407（BUG-20261004-TGW-006）：聊天文件/搜索记录弹窗宽度档——
   内容面板设计宽度 540px，460px 默认弹窗必横向溢出（内容"左漂"+横向滚动条）。 */
dialog.gate__panel--chat-tools {
  width: min(600px, calc(100vw - 36px));
}

dialog.gate__panel--store-member {
  width: min(880px, calc(100vw - 36px));
}

dialog.gate__panel::backdrop {
  background: rgba(5, 8, 11, 0.82);
}

.gate__panel h1 {
  margin: 0 0 8px;
  font-size: 23px;
}

.gate__panel p {
  color: var(--muted);
  line-height: 1.65;
}

.gate__actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.advertisement-admin {
  display: grid;
  gap: 12px;
}

.advertisement-admin__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.advertisement-admin__head h3,
.advertisement-admin__head p {
  margin: 0;
}

.advertisement-admin__head p {
  margin-top: 5px;
  color: var(--muted);
}

.advertisement-admin__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.advertisement-admin-card {
  display: grid;
  grid-template-columns:
    110px
    minmax(130px, 1.25fr)
    105px
    55px 55px 48px
    115px
    minmax(105px, 1fr)
    125px 125px
    78px;
  align-items: end;
  gap: 5px;
  min-width: 1080px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.advertisement-admin-card__position {
  display: grid;
  align-content: center;
  align-self: stretch;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #111b23;
}

.advertisement-admin-card__position span {
  color: var(--muted);
  font-size: 12px;
}

.advertisement-admin-card__position .checkbox-row {
  justify-content: flex-start;
  min-height: 22px;
}

.advertisement-admin-card__field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.advertisement-admin-card__field > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advertisement-admin-card__field input,
.advertisement-admin-card__field textarea {
  min-width: 0;
}

.advertisement-admin-card__field--text textarea {
  height: 46px;
  resize: none;
}

.advertisement-admin-card__field--color input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px;
}

.advertisement-admin-card__field--check {
  place-items: center;
  align-self: stretch;
  align-content: center;
}

.advertisement-admin-card__field--check input {
  width: 20px;
  height: 20px;
}

.advertisement-admin-card__speed > div {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 52px;
  align-items: center;
  gap: 4px;
}

.advertisement-admin-card__speed input[type="number"] {
  width: 100%;
  min-height: 34px;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.advertisement-admin-card__image-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 28px;
  align-items: center;
  gap: 4px;
}

.advertisement-admin-card__upload {
  display: grid;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #18323c;
  font-size: 11px;
  cursor: pointer;
}

.advertisement-admin-card__upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.advertisement-admin-card__image-actions > button {
  width: 32px;
  height: 34px;
  padding-inline: 2px;
  font-size: 11px;
}

.advertisement-admin-card__preview {
  display: grid;
  width: 28px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  background: #0d151b;
  color: var(--muted);
}

.advertisement-admin-card__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.advertisement-admin-card__preview span {
  font-size: 10px;
  white-space: nowrap;
}

.advertisement-admin-card__save {
  display: grid;
  gap: 3px;
}

.advertisement-admin-card__save button {
  min-height: 36px;
  padding-inline: 4px;
  font-size: 14px;
  white-space: nowrap;
}

.advertisement-admin-card__save output {
  min-height: 14px;
  color: #6ee7ad;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 900px) {
  .advertisement-admin__head {
    align-items: stretch;
    flex-direction: column;
  }

  .advertisement-admin-card {
    min-width: 1080px;
  }
}

.chat-head-avatar {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #18372e;
  color: #c9ffea;
  font-weight: 900;
}

.chat-context-actions {
  min-width: 0;
  max-width: min(58vw, 760px);
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 1px;
  scrollbar-width: thin;
}

.chat-context-actions[hidden],
.chat-context-actions > button[hidden] {
  display: none;
}

.chat-context-actions > button {
  min-width: max-content;
  min-height: 30px;
  padding: 4px 8px;
  border-color: #60717e;
  background: #1b2a34;
  color: #edf4f7;
  font-size: 11px;
  white-space: nowrap;
}

.chat-context-actions > button:hover,
.chat-context-actions > button:focus-visible,
.chat-context-actions > button.is-active {
  border-color: #41b884;
  background: #16573f;
  color: #ffffff;
}

.chat-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
}

.chat-sound-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #131d24;
}

.chat-sound-settings .checkbox-row {
  margin: 0;
}

.chat-appearance-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #111a21;
}

.chat-appearance-settings legend {
  padding: 0 7px;
  color: var(--accent);
  font-weight: 900;
}

.chat-appearance-settings label {
  min-width: 0;
}

.chat-appearance-settings input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 3px;
}

@media (max-width: 760px) {
  .chat-appearance-settings {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .chat-sound-settings {
    align-items: stretch;
    flex-direction: column;
  }
}

.sidebar [data-global-nav-moved] {
  display: none !important;
}

.gate__actions fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px;
}

.gate__actions legend {
  padding: 0 6px;
  color: #d9e7ef;
  font-weight: 800;
}

@media (max-width: 640px) {
  .admin-user-tools {
    grid-template-columns: 1fr 1fr;
  }

  .admin-user-tools input {
    grid-column: 1 / -1;
  }

  .registration-blacklist-row {
    grid-template-columns: 1fr;
  }

  .admin-user-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-directory__tools {
    grid-template-columns: 1fr 1fr;
  }

  .admin-user-directory__tools input {
    grid-column: 1 / -1;
  }

  .admin-contact-visibility {
    grid-column: 1 / -1;
  }

  .admin-user-table-wrap {
    max-height: calc(100vh - 360px);
  }
}

.notice {
  padding: 9px 11px;
  border: 1px solid #846b31;
  border-radius: 5px;
  background: #322a17;
  color: #f6d980;
  font-size: 13px;
  line-height: 1.55;
}

.publisher-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #101820;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 12px;
}

.publisher-review-row {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
  margin-bottom: 8px;
  padding: 9px;
}

.publisher-review-row p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.checkbox-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 8px;
}

.checkbox-label input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 1px;
}

.marketplace-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--surface);
}

.marketplace-head {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #111a23;
  padding: 10px 16px;
}

.marketplace-head > div {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
}

.marketplace-head h2 {
  margin: 0;
  font-size: 18px;
}

.marketplace-head span {
  color: var(--muted);
  font-size: 12px;
}

.marketplace-head > strong {
  border: 1px solid #97752d;
  border-radius: 5px;
  background: #302817;
  color: #f6d579;
  padding: 8px 12px;
  white-space: nowrap;
}

.marketplace-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background: #0e161e;
  padding: 8px 12px;
  overflow-x: auto;
}

.marketplace-tabs button {
  min-width: 106px;
  border-color: #405161;
  background: #17222d;
  white-space: nowrap;
}

.marketplace-tabs button[aria-selected="true"] {
  border-color: #319968;
  background: #1a573e;
  color: #dcffec;
}

.marketplace-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.marketplace-body > section {
  min-width: 0;
  padding: 12px;
}

.marketplace-toolbar,
.marketplace-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #151e27;
  margin-bottom: 12px;
  padding: 10px;
}

.marketplace-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.marketplace-toolbar select {
  width: 150px;
}

.marketplace-toolbar > span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.marketplace-section-head > div {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
}

.marketplace-section-head > div > span {
  color: var(--muted);
  font-size: 12px;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.marketplace-product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141d25;
  padding: 11px;
}

.marketplace-product-card > img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 9px;
}

.marketplace-product-card > header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.marketplace-product-card > header strong {
  color: var(--yellow);
}

.marketplace-product-card h3 {
  margin: 8px 0 5px;
  font-size: 16px;
}

.marketplace-product-card > p {
  min-height: 42px;
  margin: 0 0 8px;
  color: #ccd6df;
  line-height: 1.55;
}

.marketplace-product-card > small {
  display: block;
  color: var(--muted);
  margin-bottom: 9px;
}

.marketplace-product-card > video {
  width: 100%;
  max-height: 240px;
  margin-top: 10px;
  background: #05080b;
}

.marketplace-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 9px;
}

.marketplace-course-content {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #3b4a58;
  border-radius: 4px;
  background: #0d141b;
  color: #dce4eb;
  padding: 9px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.marketplace-review-note {
  min-height: 0 !important;
  border-left: 3px solid var(--yellow);
  background: #292416;
  color: #efd57d !important;
  padding: 7px;
}

.marketplace-status-card,
.privacy-notice,
.compliance-boundary {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
  margin-bottom: 10px;
  padding: 12px;
}

.marketplace-status-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.marketplace-status-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.privacy-notice,
.compliance-boundary {
  color: #e0c475;
  line-height: 1.65;
}

.marketplace-list {
  display: grid;
  gap: 8px;
}

.marketplace-list article,
.marketplace-review-columns article {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #141d25;
  padding: 10px;
}

.marketplace-list article > span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.marketplace-list article p,
.marketplace-review-columns article p {
  margin: 7px 0;
  color: #cbd5de;
  line-height: 1.55;
}

.marketplace-review-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.marketplace-review-columns > div {
  min-width: 0;
  border: 1px solid var(--line);
  background: #10171f;
  padding: 9px;
}

.marketplace-review-columns h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.marketplace-footer {
  border-top: 1px solid var(--line);
  background: #161a15;
  color: #dbc678;
  padding: 8px 14px;
  font-size: 12px;
}

.marketplace-legal-section {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #4a5e6a;
  background: #101920;
}

.marketplace-legal-section[hidden] { display: none; }
.marketplace-legal-section h3 { margin: 0 0 10px; }

.inline-link-button {
  display: inline;
  width: auto;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #62bff2;
  text-decoration: underline;
}

.legal-agreement-dialog {
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid #536977;
  background: #101920;
  color: #edf3f7;
}

.legal-agreement-dialog::backdrop { background: rgb(0 0 0 / 70%); }

.legal-agreement-dialog > section {
  max-height: calc(100vh - 26px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.legal-agreement-dialog header,
.legal-agreement-dialog footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #40535f;
  background: #16232c;
}

.legal-agreement-dialog header > div { min-width: 0; flex: 1; }
.legal-agreement-dialog h2 { margin: 0; font-size: 20px; }
.legal-agreement-dialog header span { color: #aab9c2; font-size: 12px; }
.legal-agreement-dialog header button { width: 38px; min-width: 38px; padding: 7px; font-size: 20px; }

.legal-agreement-dialog article {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}

.legal-agreement-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #40535f;
  border-bottom: 0;
}

.marketplace-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.marketplace-dialog--owner-verification {
  width: min(1120px, calc(100vw - 24px));
}

.marketplace-dialog--owner-verification .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketplace-dialog--owner-verification .form-grid .span-2 {
  grid-column: span 2;
}

@media (max-width: 820px) {
  .marketplace-dialog--owner-verification .form-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-dialog--owner-verification .form-grid .span-2 {
    grid-column: 1;
  }
}

.marketplace-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.marketplace-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 26px);
}

.marketplace-dialog form > header,
.marketplace-dialog form > footer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #131c25;
  padding: 10px 14px;
}

.marketplace-dialog form > header {
  border-bottom: 1px solid var(--line);
}

.marketplace-dialog form > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.marketplace-dialog h2 {
  flex: 1;
  margin: 0;
  font-size: 17px;
}

.marketplace-dialog .form-grid {
  overflow: auto;
  padding: 14px;
}

.external-sites-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid #526779;
  border-radius: 7px;
  background: #101820;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
}

.external-sites-dialog::backdrop {
  background: rgba(3, 7, 10, 0.82);
}

.external-sites-shell {
  max-height: calc(100vh - 38px);
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.external-sites-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid #40505d;
  background: #172531;
}

.external-sites-head > div {
  min-width: 0;
  flex: 1;
}

.external-sites-head h2 {
  margin: 0 0 2px;
  color: #fff;
  font-size: 20px;
}

.external-sites-head span {
  color: #aebfcb;
  font-size: 12px;
}

.external-sites-head .icon-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  border-color: #ff746d;
  background: #a62525;
  color: #fff;
}

.external-sites-head .icon-button:hover,
.external-sites-head .icon-button:focus-visible {
  border-color: #fff;
  background: #d83b35;
  color: #fff;
}

.external-sites-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #344651;
  background: #111d25;
  color: #d5e2e9;
  font-weight: 700;
}

.external-sites-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border-color: #536b7b;
  background: #eaf0f2;
  color: #101820;
}

.external-sites-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid #344651;
  background: #15212a;
}

.external-sites-series-filters,
.external-sites-provider-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 14px;
  border-bottom: 1px solid #344651;
}

.external-sites-series-filters {
  background: #203240;
}

.external-sites-provider-filters {
  background: #13212a;
}

.external-sites-series-filters button,
.external-sites-provider-filters button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #587080;
  border-radius: 5px;
  background: #182934;
  color: #e0e9ee;
  font-size: 12px;
  font-weight: 800;
}

.external-sites-series-filters button[aria-pressed="true"] {
  border-color: #ffe58b;
  background: #8b670e;
  color: #fff;
}

.external-sites-provider-filters button[aria-pressed="true"] {
  border-color: #83d4a8;
  background: #176342;
  color: #fff;
}

.external-sites-feature-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid #344651;
  background: #101a21;
}

.external-sites-feature-filters button {
  min-height: 29px;
  padding: 0 9px;
  border-color: #465b68;
  border-radius: 5px;
  background: #16232c;
  color: #cbd9e0;
  font-size: 11px;
  font-weight: 700;
}

.external-sites-feature-filters button[aria-pressed="true"] {
  border-color: #71b7e7;
  background: #18547b;
  color: #fff;
}

.external-sites-filters button {
  min-height: 31px;
  padding: 0 10px;
  border-color: #506573;
  border-radius: 5px;
  background: #1a2a35;
  color: #dce7ed;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.external-sites-filters button[aria-pressed="true"] {
  border-color: #f1cb54;
  background: #76580d;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 153, 0.24);
}

.external-sites-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 16px;
  background: #0c141a;
}

.external-sites-group {
  margin-bottom: 12px;
  border: 1px solid var(--site-group-color);
  border-left-width: 6px;
  border-radius: 6px;
  background: #121d24;
  overflow: hidden;
}

.external-sites-group:last-child {
  margin-bottom: 0;
}

.external-sites-group--sports {
  --site-group-color: #d84343;
  --site-card-background: #381c20;
  --site-card-hover: #53242a;
}

.external-sites-group--jingcai {
  --site-group-color: #398ee3;
  --site-card-background: #162d45;
  --site-card-hover: #1c4266;
}

.external-sites-group--welfare {
  --site-group-color: #2ca66e;
  --site-card-background: #153629;
  --site-card-hover: #1d503b;
}

.external-sites-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid color-mix(in srgb, var(--site-group-color) 68%, #27343d);
  color: #fff;
}

.external-sites-group__head strong {
  font-size: 16px;
}

.external-sites-group__head span {
  color: #b8c7cf;
  font-size: 12px;
}

.external-sites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 9px;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .external-sites-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.external-link-disclaimer {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 2px solid #d4a52a;
  border-radius: 8px;
  background: #17222b;
  color: #edf4f7;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
}

.external-link-disclaimer::backdrop {
  background: rgba(2, 6, 9, 0.84);
}

.external-link-disclaimer > section > header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #5e4b20;
  background: #30270f;
}

.external-link-disclaimer h2 {
  flex: 1;
  margin: 0;
  color: #fff1b5;
  font-size: 19px;
}

.external-link-disclaimer header button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #ff7b72;
  border-radius: 5px;
  background: #a62525;
  color: #fff;
  font-size: 23px;
}

.external-link-disclaimer__body {
  padding: 16px;
  line-height: 1.7;
}

.external-link-disclaimer__body strong {
  display: block;
  padding: 9px 10px;
  border-left: 4px solid #d4a52a;
  background: #101820;
  color: #fff;
}

.external-link-disclaimer__body p {
  margin: 12px 0 0;
  color: #ced9df;
  font-size: 13px;
}

.external-link-disclaimer footer {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 9px;
  padding: 11px 14px 14px;
  border-top: 1px solid #3b4b55;
}

.external-link-disclaimer footer button {
  min-height: 40px;
  border-radius: 5px;
  font-weight: 800;
}

#externalLinkDisclaimerCancel {
  border-color: #738793;
  background: #253640;
  color: #fff;
}

#externalLinkDisclaimerConfirm {
  border-color: #f1d878;
  background: #8b670e;
  color: #fff;
}

.external-sites-group__expand {
  width: calc(100% - 18px);
  min-height: 35px;
  margin: 0 9px 9px;
  border: 1px solid color-mix(in srgb, var(--site-group-color) 70%, #71818a);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.external-site-card {
  min-width: 0;
  min-height: 174px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--site-group-color) 72%, #53616a);
  border-radius: 5px;
  background: var(--site-card-background);
  color: #fff;
}

.external-site-card__caution {
  display: block;
  margin-top: 7px;
  color: #f0cf81;
  font-size: 11px;
  line-height: 1.45;
}

.external-site-card:hover {
  border-color: #fff;
  background: var(--site-card-hover);
  color: #fff;
}

.external-site-card__heading {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.external-site-card__heading strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-site-card__heading span {
  flex: 0 0 auto;
  color: #ffd76c;
  font-size: 11px;
  font-weight: 700;
}

.external-site-card__path {
  padding: 6px 7px;
  border-left: 3px solid var(--site-group-color);
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.external-site-card p {
  min-height: 34px;
  margin: 0;
  overflow: hidden;
  color: #c3d0d7;
  font-size: 12px;
  line-height: 1.45;
}

.external-site-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.external-site-card__tags small {
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--site-group-color) 60%, #87949b);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  color: #dce6eb;
  font-size: 10px;
  line-height: 1.5;
}

.external-site-card__tags small.is-official {
  border-color: #f2d45d;
  background: #624d0d;
  color: #fff6bf;
}

.external-site-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: auto;
}

.external-site-card__actions button {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #6e8796;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.external-site-card__open {
  background: #176397;
  color: #fff;
}

.external-site-card__open:hover,
.external-site-card__open:focus-visible {
  border-color: #fff;
  background: #2083c5;
  color: #fff;
}

.external-sites-empty {
  padding: 46px 16px;
  color: #b6c4cc;
  text-align: center;
}

.external-sites-shell > footer {
  padding: 9px 14px;
  border-top: 1px solid #40505d;
  background: #17212a;
  color: #9fb0bb;
  font-size: 12px;
}

@media (max-width: 760px) {
  .external-sites-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .external-sites-shell {
    height: 100vh;
    max-height: 100vh;
  }

  .external-sites-head {
    min-height: 56px;
    padding: 8px 10px;
  }

  .external-sites-head h2 {
    font-size: 18px;
  }

  .external-sites-search {
    padding: 8px 10px;
  }

  .external-sites-filters {
    flex-wrap: nowrap;
    padding: 7px 10px;
    overflow-x: auto;
  }

  .external-sites-series-filters,
  .external-sites-provider-filters {
    flex-wrap: nowrap;
    padding: 7px 10px;
    overflow-x: auto;
  }

  .external-sites-feature-filters {
    flex-wrap: nowrap;
    padding: 7px 10px;
    overflow-x: auto;
  }

  .external-sites-body {
    padding: 9px 10px 12px;
  }

  .external-sites-grid {
    grid-template-columns: 1fr;
  }

  .external-link-disclaimer footer {
    grid-template-columns: 1fr;
  }

  .external-sites-group__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .external-site-card {
    min-height: 166px;
  }

  .external-sites-shell > footer {
    padding: 7px 10px;
  }
}

/* 批TGW-DEV292：电脑版聊天与手机端聊天壳对齐。保留旧业务面板主题，聊天区单独使用浅色高对比工作区。 */
@media (min-width: 761px) {
  #view-chat {
    --desktop-chat-bg: #edf5f3;
    --desktop-chat-surface: #ffffff;
    --desktop-chat-surface-soft: #f6faf9;
    --desktop-chat-line: #d9e6e2;
    --desktop-chat-ink: #20302d;
    --desktop-chat-muted: #647773;
    --desktop-chat-brand: #0f6f64;
    --desktop-chat-brand-soft: #e4f1ee;
    --desktop-chat-mine: #d9f1e7;
    --desktop-chat-incoming: #ffffff;
    grid-template-columns: var(--chat-directory-width, 196px) 6px minmax(480px, 1fr) minmax(270px, 330px);
    background: var(--desktop-chat-bg);
    color: var(--desktop-chat-ink);
  }

  #view-chat > .pane {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat > .chat-directory {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    background: var(--desktop-chat-surface-soft);
  }

  #view-chat > .chat-directory-resizer {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  #view-chat > .chat-main {
    grid-column: 3;
    grid-row: 1;
  }

  #view-chat .pane__header {
    min-height: 64px;
    padding: 10px 14px;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .pane__header h2,
  #view-chat .pane__header h3,
  #view-chat .chat-head__identity h2 {
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-directory__heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
  }

  #view-chat .chat-directory__heading > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  #view-chat .chat-directory__heading strong {
    color: var(--desktop-chat-ink);
    font-size: 16px;
    line-height: 1.2;
  }

  #view-chat .chat-directory__heading small {
    color: var(--desktop-chat-muted);
    font-size: 11px;
    white-space: nowrap;
  }

  #view-chat .chat-directory__mark {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--desktop-chat-brand);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
  }

  #view-chat .chat-directory__quick {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 8px 10px 7px;
    border-bottom: 1px solid var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-directory__quick button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    gap: 2px;
    padding: 4px 2px;
    border: 1px solid #d7e5e1;
    border-radius: 9px;
    background: #fbfefd;
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-directory__quick button:hover,
  #view-chat .chat-directory__quick button:focus-visible {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
  }

  #view-chat .chat-directory__quick button span {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 7px;
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand);
    font-size: 11px;
    font-weight: 900;
  }

  #view-chat .chat-directory__quick button b {
    color: var(--desktop-chat-muted);
    font-size: 10px;
    line-height: 1.1;
  }

  #view-chat .chat-tabs {
    border-color: var(--desktop-chat-line);
    background: #f0f7f5;
  }

  #view-chat .chat-tabs button {
    min-height: 38px;
    border-color: var(--desktop-chat-line);
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-tabs button[aria-selected="true"] {
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand);
    box-shadow: inset 0 -2px var(--desktop-chat-brand);
  }

  #view-chat .chat-search {
    padding: 9px 10px;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface-soft);
  }

  #view-chat .chat-search input {
    min-height: 36px;
    border-color: #cbdcd7;
    border-radius: 9px;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-directory > .pane__body {
    padding: 8px;
    background: var(--desktop-chat-surface-soft);
  }

  #view-chat .list {
    gap: 4px;
  }

  #view-chat .list-item {
    position: relative;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 68px;
    gap: 2px 9px;
    padding: 9px 10px 9px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--desktop-chat-ink);
  }

  #view-chat .list-item::before {
    display: grid;
    width: 36px;
    height: 36px;
    grid-row: 1 / span 2;
    place-items: center;
    border: 1px solid #b9d4cd;
    border-radius: 11px;
    background: #e4f1ee;
    color: var(--desktop-chat-brand);
    content: attr(data-avatar);
    font-size: 14px;
    font-weight: 900;
  }

  #view-chat .list-item:hover,
  #view-chat .list-item:focus-visible {
    border-color: #b9d9d0;
    background: #eef8f5;
  }

  #view-chat .list-item[aria-pressed="true"] {
    border-color: #a8d2c7;
    background: var(--desktop-chat-brand-soft);
  }

  #view-chat .list-item--public-channel::before {
    display: none;
  }

  #view-chat .list-item--public-channel {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 10px;
  }

  #view-chat .list-item__title {
    min-width: 0;
    align-items: center;
    color: var(--desktop-chat-ink);
    font-size: 13px;
  }

  #view-chat .list-item__meta {
    min-width: 0;
    overflow: hidden;
    color: var(--desktop-chat-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #view-chat .list-item__meta:last-child {
    grid-column: 2;
    font-size: 10px;
  }

  #view-chat .list-item--public-channel .list-item__meta:last-child {
    grid-column: 1;
  }

  #view-chat .request-section-title {
    margin: 9px 3px 5px;
    color: var(--desktop-chat-muted);
    font-size: 11px;
  }

  #view-chat .chat-main {
    background: var(--desktop-chat-bg);
  }

  #view-chat .chat-head {
    min-height: 64px;
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-call-button {
    border-color: #c6dbd5;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-call-button:hover,
  #view-chat .chat-call-button:focus-visible {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
  }

  #view-chat .chat-call-overlay {
    border-color: var(--desktop-chat-line-strong);
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-ink);
    box-shadow: 0 18px 42px rgba(24, 68, 59, 0.18);
  }

  #view-chat .chat-call-overlay__head span {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-call-overlay__head .icon-button,
  #view-chat .chat-call-overlay__actions button:not(.button--primary) {
    border-color: #c6dbd5;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-files-list {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-files-row {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-files-row__icon {
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .chat-files-row__main small {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-files-row__download {
    border-color: #c6dbd5;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-favorites-list {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-favorite-row {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-favorite-row__body span {
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-favorite-row__body small {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-favorite-row__remove {
    border-color: #c6dbd5;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-readers-list {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-reader-row {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-readers-summary {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-search-results {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-search-result {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-search-result__meta {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-search-result__locate {
    border-color: #c6dbd5;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-head .icon-button,
  #view-chat .chat-directory .icon-button {
    min-width: 40px;
    min-height: 40px;
    border-color: #c6dbd5;
    border-radius: 9px;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-head__identity {
    display: grid;
    gap: 2px;
  }

  #view-chat .chat-head__identity h2 {
    font-size: 17px;
  }

  #view-chat .chat-head__identity .muted {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-typing-status {
    color: var(--desktop-chat-brand);
  }

  #view-chat .chat-connection-status {
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid #b9d9d0;
    border-radius: 999px;
    background: #edf8f3;
    color: #27755f;
    font-size: 10px;
    white-space: nowrap;
  }

  #view-chat .chat-connection-status.is-offline {
    border-color: #e6c69b;
    background: #fff5e7;
    color: #9a5e1c;
  }

  #view-chat .chat-toolbox {
    padding: 7px 12px;
    border-color: var(--desktop-chat-line);
    background: #f3f9f7;
  }

  #view-chat .chat-toolbox label span {
    color: var(--desktop-chat-muted);
    font-size: 11px;
  }

  #view-chat .chat-toolbox select,
  #view-chat .chat-toolbox a,
  #view-chat #myServiceTicketsButton {
    min-height: 32px;
    border-color: #c9ddd7;
    border-radius: 8px;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-toolbox a:hover,
  #view-chat .chat-toolbox a:focus-visible {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand);
  }

  #view-chat .messages {
    padding: 22px clamp(18px, 3vw, 42px);
    background: var(--desktop-chat-bg);
  }

  #view-chat .message {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    max-width: min(82%, 760px);
    margin-bottom: 16px;
  }

  #view-chat .message--mine {
    display: block;
  }

  #view-chat .message--mine .message__avatar {
    display: none;
  }

  #view-chat .message__avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #b9d4cd;
    border-radius: 9px;
    background: var(--desktop-chat-surface);
    color: var(--desktop-chat-brand);
    font-size: 11px;
    font-weight: 900;
  }

  #view-chat .message__stack {
    min-width: 0;
  }

  #view-chat .message--mine .message__stack {
    justify-self: end;
  }

  #view-chat .message__meta {
    margin-bottom: 5px;
    color: var(--desktop-chat-muted);
  }

  #view-chat .message--mine .message__meta {
    justify-content: flex-end;
  }

  #view-chat .message__bubble {
    padding: 10px 13px;
    border: 1px solid #d4e2df;
    border-radius: 4px 13px 13px 13px;
    background: var(--desktop-chat-incoming);
    color: var(--desktop-chat-ink);
    box-shadow: 0 2px 8px rgba(24, 68, 59, 0.06);
  }

  #view-chat .message--mine .message__bubble {
    border-color: #b8dfd0;
    border-radius: 13px 4px 13px 13px;
    background: var(--desktop-chat-mine);
  }

  #view-chat .message--system .message__bubble,
  #view-chat .message--recalled .message__bubble {
    border-color: transparent;
    background: #e4eeeb;
    color: var(--desktop-chat-muted);
    box-shadow: none;
  }

  #view-chat .composer {
    grid-template-columns: 48px minmax(0, 1fr) 48px 74px;
    padding: 12px 16px 16px;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-surface);
  }

  #view-chat .chat-mention-popup {
    border-color: var(--desktop-chat-line-strong);
    background: var(--desktop-chat-panel-strong);
    box-shadow: 0 10px 28px rgba(38, 75, 68, 0.18);
  }

  #view-chat .chat-mention-option {
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-mention-option:hover,
  #view-chat .chat-mention-option:focus-visible,
  #view-chat .chat-mention-option[aria-selected="true"] {
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .composer__side-button,
  #view-chat .composer__tools button,
  #view-chat #messageSendButton {
    border-color: #c3dbd4;
    border-radius: 9px;
    background: #f5faf8;
    color: var(--desktop-chat-brand);
  }

  #view-chat .composer__side-button[aria-pressed="true"],
  #view-chat .composer__tools button[aria-pressed="true"] {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand);
  }

  #view-chat .composer__reply {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-panel-strong);
    color: var(--desktop-chat-ink);
  }

  #view-chat .composer__reply strong { color: var(--desktop-chat-brand-deep); }

  #view-chat .composer__reply button {
    border-color: var(--desktop-chat-line-strong);
    color: var(--desktop-chat-ink);
  }

  #view-chat .message__reply-ref {
    border-left-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-selection-bar {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-panel);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-selection-bar strong { color: var(--desktop-chat-brand-deep); }

  #view-chat .message__merged {
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-panel-strong);
  }

  #view-chat .message__merged strong { color: var(--desktop-chat-ink); }

  #view-chat .message__merged-button {
    border-color: var(--desktop-chat-line-strong);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat #messageInput {
    min-height: 58px;
    border-color: #c7dcd6;
    border-radius: 10px;
    background: #fbfefd;
    color: var(--desktop-chat-ink);
  }

  #view-chat #messageSendButton {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand);
    color: #fff;
  }

  #view-chat #messageSendButton:disabled {
    border-color: #c6d6d2;
    background: #dbe6e3;
    color: #7b8f89;
  }

  #view-chat .chat-info-pane .pane__body {
    padding: 14px;
    background: var(--desktop-chat-surface-soft);
  }

  #view-chat .chat-info-card {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-info-card h4,
  #view-chat .chat-info-card p,
  #view-chat .chat-info-card .muted {
    color: var(--desktop-chat-ink);
  }

  #view-chat .member-row {
    border-color: var(--desktop-chat-line);
    border-radius: 9px;
    background: var(--desktop-chat-surface);
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  #view-chat {
    grid-template-columns: var(--chat-directory-width, 196px) 6px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-chat *,
  #view-chat *::before,
  #view-chat *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 760px) {
  #view-chat > .chat-directory-resizer {
    display: none !important;
  }

  #view-chat > .chat-directory {
    grid-template-rows: auto auto minmax(0, 1fr) !important;
  }

  /* 电脑版聊天壳在窄视口仍走会话/详情单列，不把快捷入口挤进手机底部输入区。 */
  #view-chat .chat-directory__quick {
    display: none;
  }

  #view-chat .chat-call-actions {
    gap: 3px;
  }

  #view-chat .chat-call-button {
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 5px !important;
  }

  #view-chat .chat-call-overlay {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
  }
}

/* 批TGW-DEV296：桌面聊天沿用手机端的深青绿/浅青灰语义层级，避免整块纯白，并保留桌面三栏效率布局。 */
@media (min-width: 761px) {
  #view-chat {
    --desktop-chat-canvas: #dfeae7;
    --desktop-chat-directory: #d2e3df;
    --desktop-chat-panel: #e8f2ef;
    --desktop-chat-panel-strong: #f2f8f6;
    --desktop-chat-line: #b6cec8;
    --desktop-chat-line-strong: #91b4aa;
    --desktop-chat-ink: #173b39;
    --desktop-chat-muted: #3f5f5a;
    --desktop-chat-brand: #0f655b;
    --desktop-chat-brand-deep: #0a403b;
    --desktop-chat-brand-soft: #cfe8e1;
    --desktop-chat-mine: #c1e5d8;
    --desktop-chat-incoming: #f5faf8;
    --desktop-chat-warning: #8b5a1d;
    gap: 0;
    padding: 10px;
    background: var(--desktop-chat-canvas);
    color: var(--desktop-chat-ink);
  }

  #view-chat > .pane {
    min-width: 0;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-panel);
    box-shadow: 0 8px 24px rgba(20, 71, 63, 0.12);
  }

  #view-chat > .chat-directory {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 12px 0 0 12px;
    background: var(--desktop-chat-directory);
  }

  #view-chat > .chat-main {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: var(--desktop-chat-canvas);
  }

  #view-chat > .chat-info-pane {
    overflow: hidden;
    border-radius: 0 12px 12px 0;
    background: var(--desktop-chat-directory);
  }

  #view-chat .pane__header,
  #view-chat .chat-head {
    min-height: 62px;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-brand-deep);
    color: #f2fffb;
  }

  #view-chat .pane__header h2,
  #view-chat .pane__header h3,
  #view-chat .chat-head__identity h2,
  #view-chat .chat-directory__heading strong {
    color: #f2fffb;
  }

  #view-chat .chat-directory__heading {
    gap: 10px;
  }

  #view-chat .chat-directory__heading > span:last-child {
    gap: 3px;
  }

  #view-chat .chat-directory__heading strong {
    font-size: 16px;
  }

  #view-chat .chat-directory__heading small {
    color: rgba(242, 255, 251, 0.72);
  }

  #view-chat .chat-directory__mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 12px;
    background: #a9d4c8;
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .chat-directory .icon-button,
  #view-chat .chat-head .icon-button,
  #view-chat #chatInfoClose {
    min-width: 40px;
    min-height: 40px;
    border-color: rgba(242, 255, 251, 0.34);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    color: #f2fffb;
  }

  #view-chat .chat-directory .icon-button:hover,
  #view-chat .chat-directory .icon-button:focus-visible,
  #view-chat .chat-head .icon-button:hover,
  #view-chat .chat-head .icon-button:focus-visible,
  #view-chat #chatInfoClose:hover,
  #view-chat #chatInfoClose:focus-visible {
    border-color: #d1eee5;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  #view-chat .chat-directory__quick {
    gap: 6px;
    padding: 9px 10px 8px;
    border-color: var(--desktop-chat-line);
    background: var(--desktop-chat-panel);
  }

  #view-chat .chat-directory__quick button {
    min-height: 50px;
    border-color: var(--desktop-chat-line);
    border-radius: 10px;
    background: var(--desktop-chat-panel-strong);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-directory__quick button:hover,
  #view-chat .chat-directory__quick button:focus-visible {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
  }

  #view-chat .chat-directory__quick button span {
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .chat-directory__quick button b {
    color: var(--desktop-chat-muted);
    font-size: 10px;
  }

  #view-chat .chat-tabs {
    border-color: var(--desktop-chat-line);
    background: #c5dcd6;
  }

  #view-chat .chat-tabs button {
    min-height: 40px;
    border-color: var(--desktop-chat-line);
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-tabs button[aria-selected="true"] {
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
    box-shadow: inset 0 -3px var(--desktop-chat-brand);
  }

  #view-chat .chat-search {
    padding: 9px 10px;
    border-color: var(--desktop-chat-line);
    background: #d5e6e1;
  }

  #view-chat .chat-search input {
    min-height: 38px;
    border-color: var(--desktop-chat-line-strong);
    border-radius: 9px;
    background: var(--desktop-chat-panel-strong);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-directory > .pane__body,
  #view-chat .chat-info-pane .pane__body {
    padding: 8px;
    background: var(--desktop-chat-directory);
  }

  #view-chat .list {
    gap: 5px;
  }

  #view-chat .list-item {
    min-height: 70px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: rgba(242, 248, 246, 0.72);
    color: var(--desktop-chat-ink);
  }

  #view-chat .list-item::before {
    width: 38px;
    height: 38px;
    border-color: #9bc2b7;
    border-radius: 12px;
    background: #b9ddd1;
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .list-item:hover,
  #view-chat .list-item:focus-visible {
    border-color: var(--desktop-chat-line-strong);
    background: #e3f1ed;
  }

  #view-chat .list-item[aria-pressed="true"] {
    border-color: #75a99b;
    background: var(--desktop-chat-brand-soft);
    box-shadow: inset 3px 0 var(--desktop-chat-brand);
  }

  #view-chat .list-item__title {
    color: var(--desktop-chat-ink);
  }

  #view-chat .list-item__meta,
  #view-chat .request-section-title {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-head__identity {
    gap: 3px;
  }

  #view-chat .chat-head__identity h2 {
    font-size: 17px;
  }

  #view-chat .chat-head__identity .muted {
    color: rgba(242, 255, 251, 0.72);
  }

  #view-chat .chat-connection-status {
    min-height: 26px;
    border-color: #8cc1b1;
    background: #d2eee4;
    color: var(--desktop-chat-brand-deep);
    font-weight: 800;
  }

  #view-chat .chat-connection-status.is-syncing {
    border-color: #c8b476;
    background: #f1ead2;
    color: var(--desktop-chat-warning);
  }

  #view-chat .chat-connection-status.is-offline {
    border-color: #d8a16f;
    background: #f8e5d5;
    color: #8a4d19;
  }

  #view-chat .chat-toolbox {
    padding: 8px 12px;
    border-color: var(--desktop-chat-line);
    background: #c5dcd6;
  }

  #view-chat .chat-toolbox label span {
    color: var(--desktop-chat-muted);
  }

  #view-chat .chat-toolbox select,
  #view-chat .chat-toolbox a,
  #view-chat #myServiceTicketsButton {
    min-height: 34px;
    border-color: var(--desktop-chat-line-strong);
    border-radius: 8px;
    background: var(--desktop-chat-panel-strong);
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-toolbox a:hover,
  #view-chat .chat-toolbox a:focus-visible,
  #view-chat #myServiceTicketsButton:hover,
  #view-chat #myServiceTicketsButton:focus-visible {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .messages {
    padding: 24px clamp(20px, 3vw, 46px);
    background: var(--desktop-chat-canvas);
    scrollbar-color: #9bbab1 transparent;
  }

  #view-chat .message {
    max-width: min(82%, 760px);
    margin-bottom: 18px;
  }

  #view-chat .message__avatar {
    border-color: #9bc2b7;
    border-radius: 12px;
    background: #b9ddd1;
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .message__meta {
    color: var(--desktop-chat-muted);
  }

  #view-chat .message__action {
    color: var(--desktop-chat-brand);
  }

  #view-chat .message__read-status {
    color: var(--desktop-chat-muted);
  }

  #view-chat .message__read-status:hover {
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .message__bubble {
    border-color: #b9d1ca;
    border-radius: 5px 14px 14px 14px;
    background: var(--desktop-chat-incoming);
    color: var(--desktop-chat-ink);
    box-shadow: 0 3px 10px rgba(20, 71, 63, 0.08);
  }

  #view-chat .message--mine .message__bubble {
    border-color: #8fc7b3;
    border-radius: 14px 5px 14px 14px;
    background: var(--desktop-chat-mine);
  }

  #view-chat .message__file {
    border-color: #b9d1ca;
    background: #eef7f4;
  }

  #view-chat .message__file-icon {
    border-color: #8fc7b3;
    background: #d2eee4;
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .message__file-details small { color: var(--desktop-chat-muted); }

  #view-chat .message--system .message__bubble,
  #view-chat .message--recalled .message__bubble {
    border-color: #b2c8c2;
    background: #c9d9d5;
    color: var(--desktop-chat-muted);
  }

  #view-chat .composer {
    grid-template-columns: 48px minmax(0, 1fr) 48px 74px;
    padding: 12px 16px 16px;
    border-color: var(--desktop-chat-line);
    background: #c5dcd6;
  }

  #view-chat .composer__side-button,
  #view-chat .composer__tools button {
    border-color: var(--desktop-chat-line-strong);
    border-radius: 9px;
    background: var(--desktop-chat-panel-strong);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .composer__side-button[aria-pressed="true"],
  #view-chat .composer__tools button[aria-pressed="true"] {
    border-color: var(--desktop-chat-brand);
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat #messageInput {
    min-height: 58px;
    border-color: var(--desktop-chat-line-strong);
    border-radius: 10px;
    background: #edf6f3;
    color: var(--desktop-chat-ink);
  }

  #view-chat #messageInput:focus-visible {
    border-color: var(--desktop-chat-brand);
    box-shadow: 0 0 0 3px rgba(15, 101, 91, 0.18);
  }

  #view-chat #messageSendButton {
    border-color: var(--desktop-chat-brand-deep);
    border-radius: 9px;
    background: var(--desktop-chat-brand);
    color: #fff;
  }

  #view-chat #messageSendButton:hover,
  #view-chat #messageSendButton:focus-visible {
    background: var(--desktop-chat-brand-deep);
  }

  #view-chat #messageSendButton:disabled {
    border-color: #9cb7b0;
    background: #a9beb8;
    color: #e5f0ed;
  }

  #view-chat .composer__emoji-panel,
  #view-chat .composer__attachment {
    border-color: var(--desktop-chat-line-strong);
    background: #dcebe7;
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-info-pane .pane__body {
    padding: 14px;
  }

  #view-chat .chat-info-card {
    border-color: var(--desktop-chat-line);
  }

  #view-chat .chat-info-card h4,
  #view-chat .chat-info-card p,
  #view-chat .chat-info-card .muted {
    color: var(--desktop-chat-ink);
  }

  #view-chat .chat-avatar {
    border-color: #78ad9d;
    background: var(--desktop-chat-brand-soft);
    color: var(--desktop-chat-brand-deep);
  }

  #view-chat .member-row {
    border-color: var(--desktop-chat-line);
    border-radius: 9px;
    background: #e1efeb;
  }

  #view-chat :is(button, a, input, textarea, select):focus-visible {
    outline: 2px solid #f1b733;
    outline-offset: 2px;
  }
}

.group-buy-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #0e151c;
}

.group-buy-head {
  min-width: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: #111b24;
  padding: 10px 16px;
}

.group-buy-head > div {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
}

.group-buy-head h2 {
  margin: 0;
  font-size: 18px;
}

.group-buy-head > div > span {
  color: var(--muted);
  font-size: 12px;
}

.group-buy-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background: #0d151d;
  padding: 8px 12px;
  overflow-x: auto;
}

.group-buy-tabs button {
  min-width: 106px;
  background: #17222d;
  white-space: nowrap;
}

.group-buy-tabs button[aria-selected="true"] {
  border-color: #397fc0;
  background: #173b5b;
  color: #d8edff;
}

.group-buy-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.group-buy-list-pane,
.group-buy-detail-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.group-buy-list-pane {
  border-right: 1px solid var(--line);
  background: #101820;
}

.group-buy-filters {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #131d26;
  padding: 9px;
}

.group-buy-list {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.group-buy-mobile-hero {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(180deg, #ff812c 0, #ffd7b8 118px, #eef6fb 118px);
}

.group-buy-store-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.group-buy-store-strip > div {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.group-buy-store-strip strong {
  font-size: 18px;
}

.group-buy-store-strip span {
  font-size: 12px;
  opacity: 0.92;
}

.group-buy-store-strip button {
  min-height: 32px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #ff741b;
  padding: 0 10px;
}

.group-buy-banner {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 32%, rgba(255, 255, 255, 0.82) 0 8px, transparent 9px),
    linear-gradient(135deg, #0875ff 0%, #1bb6ff 52%, #ffffff 52%, #fff1db 100%);
  color: #fff;
  padding: 18px;
}

.group-buy-banner strong {
  font-size: 28px;
  letter-spacing: 0;
}

.group-buy-banner span {
  max-width: 260px;
  color: #eef8ff;
  font-size: 13px;
}

.group-buy-announcement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(39, 74, 104, 0.08);
}

.group-buy-announcement b {
  color: #183f76;
}

.group-buy-announcement span {
  min-width: 0;
  color: #364552;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-buy-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(39, 74, 104, 0.08);
}

.group-buy-feature-grid button {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 86px;
  border: 0;
  background: #fff;
  color: #1f2d3a;
}

.group-buy-feature-grid i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff3e35, #ff9a19);
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.group-buy-feature-grid span {
  color: #6e7d89;
  font-size: 12px;
}

.group-buy-mobile-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.group-buy-mobile-tabs button {
  min-height: 34px;
  border: 1px solid #d7e2ec;
  border-radius: 6px;
  background: #fff;
  color: #364452;
}

.group-buy-list-card {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 7px;
  border-color: #334555;
  background: #151f28;
  padding: 11px;
  text-align: left;
}

.group-buy-list-card__author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-buy-list-card__author i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ff7b1a;
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.group-buy-list-card__author strong {
  min-width: 0;
  flex: 1;
  color: #eaf4fb;
}

.group-buy-list-card__author em {
  flex: 0 0 auto;
  border: 1px solid #f1547d;
  border-radius: 4px;
  color: #ff7a9b;
  padding: 2px 6px;
  font-size: 12px;
  font-style: normal;
}

.group-buy-list-card:hover,
.group-buy-list-card.is-active {
  border-color: #4c9dde;
  background: #172b3c;
}

.group-buy-list-card__head,
.group-buy-list-card__stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-buy-list-card__head strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-buy-list-card__head i {
  flex: 0 0 auto;
  font-style: normal;
}

.group-buy-list-card__meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.group-buy-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #0b1117;
}

.group-buy-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3e9bd6;
}

.group-buy-list-card__stats b {
  color: #76c8fa;
}

.group-buy-list-card__stats em {
  color: #c4d0d9;
  font-size: 12px;
  font-style: normal;
}

.group-buy-list-card__stats em:last-child {
  margin-left: auto;
}

.group-buy-list-card__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 8px;
}

.group-buy-list-card__foot small {
  color: #b8c4ce;
}

.group-buy-list-card__foot span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 6px;
  background: #ff7300;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.group-buy-detail-pane {
  background: #0c131a;
}

.group-buy-detail {
  min-height: 100%;
  padding: 12px;
}

.group-buy-created-success {
  display: grid;
  gap: 4px;
  max-width: 1120px;
  margin: 0 auto 10px;
  border: 2px solid #3aa675;
  border-radius: 8px;
  background: #e9f8ef;
  color: #145638;
  padding: 13px 16px;
  box-shadow: 0 5px 16px rgba(23, 107, 71, 0.18);
}

.group-buy-created-success strong { font-size: 17px; }
.group-buy-created-success span { font-weight: 900; }
.group-buy-created-success small { color: #3d6b55; }

.group-buy-proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.group-buy-proof-grid button {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  border: 1px solid #425666;
  border-radius: 7px;
  background: #111b23;
  color: #cfdae2;
  padding: 7px;
  text-decoration: none;
  text-align: left;
  cursor: zoom-in;
}

.group-buy-proof-grid img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: initial;
  display: block;
  border-radius: 4px;
  background: transparent;
}

.group-buy-ticket-viewer[hidden] { display: none; }

.group-buy-ticket-viewer {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(4, 9, 13, 0.96);
}

.group-buy-ticket-viewer__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 12px;
  background: #17242d;
  color: #f2f6f8;
}

.group-buy-ticket-viewer__toolbar strong { margin-right: auto; }
.group-buy-ticket-viewer__toolbar button {
  min-width: 54px;
  min-height: 38px;
  border-color: #82949e;
  background: linear-gradient(#52656f, #344750);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 2px 0 #16242b;
}

.group-buy-ticket-viewer__toolbar button:active { translate: 0 1px; filter: brightness(1.25); box-shadow: none; }
.group-buy-ticket-viewer__toolbar button:disabled { background: #27363d; color: #788991; box-shadow: none; }

.group-buy-ticket-viewer__viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.group-buy-ticket-viewer__viewport:active { cursor: grabbing; }

.group-buy-ticket-viewer__viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  will-change: transform;
}

body.is-ticket-viewing { overflow: hidden; }

.group-buy-sheet {
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid #384b5b;
  border-radius: 6px;
  background: #121b23;
  overflow: hidden;
}

.group-buy-detail-topbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  padding: 10px;
}

.group-buy-detail-topbar button {
  border-color: #d8e2ea;
  background: #fff;
  color: #23313f;
}

.group-buy-honor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 2px solid #d83737;
  border-radius: 8px;
  background: #fff0f3;
  color: #26313d;
  margin: 10px;
  padding: 14px;
}

.group-buy-honor-card strong {
  font-size: 18px;
}

.group-buy-honor-card span {
  grid-column: 1 / -1;
  color: #44515e;
}

.group-buy-honor-card b {
  color: #e7294d;
}

.group-buy-countdown-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ff7600;
  color: #fff;
  padding: 12px 14px;
}

.group-buy-countdown-card div {
  display: grid;
  gap: 4px;
}

.group-buy-countdown-card span {
  font-size: 24px;
  font-weight: 800;
}

.group-buy-countdown-card b {
  color: #fff4d6;
  font-size: 12px;
}

.group-buy-mobile-buybar {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 0.9fr);
  gap: 8px;
  align-items: center;
  border-top: 1px solid #d8e0e7;
  background: #fff;
  padding: 9px;
}

.group-buy-mobile-buybar > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-buy-mobile-buybar span {
  color: #25313d;
  font-weight: 700;
  white-space: nowrap;
}

.group-buy-mobile-buybar button,
.group-buy-mobile-buybar input {
  min-height: 36px;
}

.group-buy-mobile-buybar input {
  width: 64px;
  text-align: center;
}

.group-buy-mobile-buybar > button {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: #ff7300;
  font-size: 18px;
  font-weight: 800;
}

.group-buy-sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #162532;
  padding: 14px 16px;
}

.group-buy-sheet__head > div {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 4px;
}

.group-buy-sheet__head > div > span {
  color: #75bef1;
  font-size: 12px;
  font-weight: 700;
}

.group-buy-sheet__head h2,
.group-buy-sheet__head p {
  margin: 0;
}

.group-buy-sheet__head h2 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.group-buy-sheet__head p {
  color: var(--muted);
  font-size: 12px;
}

.group-buy-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.group-buy-metric {
  min-width: 0;
  display: grid;
  gap: 5px;
  background: #151f28;
  padding: 10px 12px;
}

.group-buy-metric span {
  color: var(--muted);
  font-size: 11px;
}

.group-buy-metric strong {
  color: #e8f0f5;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.group-buy-metric--green strong {
  color: #6bd89d;
}

.group-buy-metric--yellow strong {
  color: #f1cb65;
}

.group-buy-section {
  border-top: 1px solid var(--line);
  padding: 13px 15px;
}

.group-buy-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.group-buy-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-buy-section__head h3 {
  flex: 1;
}

.group-buy-section__head span {
  color: var(--yellow);
  font-size: 12px;
}

.group-buy-ticket {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-top: 0;
  background: #111a22;
}

.group-buy-ticket > div {
  display: grid;
  gap: 4px;
}

.group-buy-ticket > div span {
  color: var(--muted);
  font-size: 11px;
}

.group-buy-ticket > div strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.group-buy-ticket pre {
  grid-column: 1 / -1;
  max-height: 230px;
  overflow: auto;
  margin: 2px 0 0;
  border: 1px solid #344654;
  border-radius: 4px;
  background: #0a1016;
  color: #dce5eb;
  padding: 10px;
  font: 13px/1.65 "Microsoft YaHei UI", sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.group-buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: #17212a;
  padding: 10px 15px;
}

.group-buy-actions button {
  min-width: 96px;
}

.group-buy-table-wrap {
  overflow-x: auto;
}

.group-buy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.group-buy-table th,
.group-buy-table td {
  min-width: 80px;
  border-bottom: 1px solid #2c3b47;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.group-buy-table th {
  background: #18232d;
  color: var(--muted);
}

.group-buy-table__actions {
  min-width: 160px !important;
  white-space: nowrap;
}

.group-buy-table__actions button {
  min-height: 26px;
  margin-right: 4px;
  padding: 2px 7px;
  font-size: 11px;
}

.group-buy-ratio-summary,
.group-buy-formula,
.group-buy-risk {
  border: 1px solid #49525a;
  border-radius: 4px;
  background: #1c2226;
  color: #cbd6de;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.65;
}

.group-buy-auto-shares {
  border: 1px solid #b7d4ce;
  border-radius: 10px;
  background: #eef8f5;
  color: #155e55;
  padding: 11px 14px;
  font-weight: 900;
  text-align: center;
}

.group-buy-auto-shares.is-warning {
  display: grid;
  gap: 7px;
  border-color: #d58b31;
  background: #fff4df;
  color: #7c4214;
  text-align: left;
}

.group-buy-auto-shares.is-warning button {
  min-height: 38px;
  border-color: #b5681e;
  background: #c87925;
  color: #fff;
  font-weight: 950;
}

.group-buy-advanced {
  border: 1px solid #d6e1e3;
  border-radius: 12px;
  background: #f8fbfb;
  overflow: hidden;
}

.group-buy-advanced > summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #31565c;
  font-weight: 900;
}

.group-buy-advanced__grid {
  border-top: 1px solid #dfe8e9;
  padding: 14px;
}

.admin-cleanup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.admin-cleanup-grid > div {
  min-width: 0;
  border: 1px solid #dce5e7;
  border-radius: 10px;
  padding: 12px;
}

.admin-cleanup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e4ebed;
  padding: 9px 0;
}

.admin-cleanup-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-cleanup-row strong,
.admin-cleanup-row small {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .admin-cleanup-grid { grid-template-columns: 1fr; }
}

.group-buy-ratio-summary {
  margin-top: 8px;
  border-color: #826f35;
  background: #272418;
  color: #eed47a;
}

.group-buy-risk {
  border-color: #765157;
  background: #261b1e;
  color: #e9b7bb;
}

.group-buy-sheet > .group-buy-risk {
  margin: 13px 15px 15px;
}

.group-buy-kind-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #315547;
  border-radius: 6px;
  background: #10211c;
}

.group-buy-kind-panel strong {
  color: #f7df8a;
}

.group-buy-kind-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.group-buy-permission-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-buy-permission-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  color: #cfe0dc;
  font-size: 12px;
}

.group-buy-permission-list span {
  color: var(--muted);
}

.group-buy-pending {
  border-color: #6d5d27;
  background: #231f11;
}

.group-buy-pending strong {
  color: #ffe084;
}

.group-buy-settlement > p {
  color: #d7e0e6;
  line-height: 1.65;
  white-space: pre-wrap;
}

.group-buy-events {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-buy-events li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.group-buy-events li > i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #4aa9e9;
}

.group-buy-events li > div {
  display: grid;
  gap: 2px;
}

.group-buy-events li span {
  color: var(--muted);
  font-size: 11px;
}

.group-buy-empty-small {
  min-height: 70px;
}

.group-buy-notice {
  border-top: 1px solid #6e5d32;
  background: #1d1b14;
  color: #dfc772;
  padding: 7px 14px;
  font-size: 11px;
  line-height: 1.5;
}

.group-buy-dialog-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #38566e;
  background: #142839;
  padding: 10px;
}

.group-buy-dialog-summary span {
  color: var(--muted);
  font-size: 12px;
}

.group-buy-live-amount {
  align-self: end;
  border: 1px solid #3b6955;
  background: #142a21;
  padding: 9px 10px;
  color: var(--muted);
}

.group-buy-live-amount strong {
  float: right;
  color: #75dea6;
}

.group-buy-share-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #2f6586;
  border-radius: 4px;
  background: #102638;
  padding: 10px;
}

.group-buy-share-preview div {
  border: 1px solid #284b61;
  border-radius: 4px;
  background: #0e1b24;
  padding: 8px;
}

.group-buy-share-preview span,
.group-buy-share-preview p {
  color: var(--muted);
  font-size: 12px;
}

.group-buy-share-preview b {
  display: block;
  margin-top: 3px;
  color: var(--text);
}

.group-buy-share-preview p {
  grid-column: 1 / -1;
  margin: 0;
}

.group-buy-share-preview.is-warning {
  border-color: #8f5d34;
  background: #2a2115;
}

.group-buy-registration-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #405b6f;
  border-radius: 4px;
  background: #101922;
  padding: 10px;
}

.group-buy-registration-panel h3 {
  margin: 0;
  font-size: 15px;
}

.group-buy-registration-editor {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.9fr 1.4fr auto;
  gap: 8px;
  align-items: end;
}

.group-buy-registration-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.group-buy-registration-actions button {
  min-width: 74px;
  padding: 0 8px;
  white-space: nowrap;
}

.group-buy-registration-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.group-buy-contact-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #3c5569;
  border-radius: 6px;
  background: #101922;
  padding: 12px;
}

.group-buy-contact-panel > strong {
  color: #f3d36f;
  font-size: 16px;
}

.group-buy-contact-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.group-buy-contact-list {
  display: grid;
  gap: 8px;
}

.group-buy-contact-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid #314a5f;
  background: #142435;
  padding: 8px;
  text-align: left;
}

.group-buy-contact-row i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff7b1a;
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.group-buy-contact-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.group-buy-contact-row strong {
  color: #eef7ff;
}

.group-buy-contact-row small {
  overflow: hidden;
  color: #9fb1bf;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-buy-contact-row b {
  color: #65bdff;
  font-size: 12px;
}

.group-buy-invite-card {
  overflow: hidden;
  border: 1px solid #4d8abd;
  border-radius: 6px;
  background: #101b24;
}

.group-buy-invite-card__hero {
  display: grid;
  gap: 6px;
  background: #17699e;
  padding: 20px;
  text-align: center;
}

.group-buy-invite-card__hero > span {
  color: #ccecff;
  font-size: 12px;
}

.group-buy-invite-card__hero > strong {
  color: #fff1b8;
  font-size: 25px;
}

.group-buy-invite-card__hero > small {
  color: #e7f5ff;
}

.group-buy-qr {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: #f4f6f8;
  padding: 24px;
  color: #18212a;
}

.group-buy-qr img {
  display: block;
  width: min(260px, 100%);
  height: auto;
  image-rendering: pixelated;
}

.group-buy-invite-card > p {
  margin: 0;
  background: #f4f6f8;
  color: #273542;
  padding: 0 16px 22px;
  text-align: center;
}

@media (max-width: 1100px) {
  .group-buy-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .group-buy-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-buy-ticket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-review-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .group-buy-view {
    height: calc(100vh - 106px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background: #eef6fb;
  }

  .group-buy-head {
    min-height: 78px;
    flex-wrap: wrap;
    border-bottom: 0;
    background: #ff7b24;
    padding: 12px 10px 8px;
    color: #fff;
  }

  .group-buy-head > div {
    flex-basis: 100%;
  }

  .group-buy-head h2 {
    font-size: 22px;
    text-align: center;
  }

  .group-buy-head > div > span {
    display: none;
  }

  .group-buy-head button,
  .group-buy-head > .badge {
    min-height: 30px;
    padding: 2px 8px;
    font-size: 11px;
  }

  .group-buy-head > .badge {
    margin-right: auto;
  }

  .group-buy-tabs {
    border-bottom: 0;
    background: #fff3ea;
    padding: 8px;
  }

  .group-buy-tabs button {
    min-width: 78px;
    border: 0;
    background: transparent;
    color: #3d4650;
    font-size: 16px;
  }

  .group-buy-tabs button[aria-selected="true"] {
    border-radius: 18px;
    background: #ff8b35;
    color: #fff;
  }

  .group-buy-workspace {
    display: block;
    overflow-y: auto;
  }

  .group-buy-list-pane,
  .group-buy-detail-pane {
    min-height: 0;
    overflow: visible;
  }

  .group-buy-list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #eef6fb;
  }

  .group-buy-filters {
    position: sticky;
    top: 0;
    display: flex;
    overflow-x: auto;
    border-bottom: 0;
    background: #fff;
  }

  .group-buy-filters label {
    min-width: 150px;
  }

  .group-buy-list {
    display: grid;
    gap: 10px;
    overflow-x: visible;
    padding: 10px;
  }

  .group-buy-list-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfe8ef;
    border-radius: 8px;
    background: #fff;
    color: #1f2b36;
    box-shadow: 0 3px 12px rgba(35, 69, 96, 0.08);
  }

  .group-buy-list-card__author strong,
  .group-buy-list-card__head strong {
    color: #26313d;
  }

  .group-buy-list-card__meta,
  .group-buy-list-card__stats em,
  .group-buy-list-card__foot small {
    color: #7a8792;
  }

  .group-buy-list-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #edf2f6;
  }

  .group-buy-list-card__stats b,
  .group-buy-list-card__stats em {
    display: grid;
    place-items: center;
    min-height: 58px;
    margin: 0 !important;
    background: #f8fbfd;
  }

  .group-buy-list-card__stats b {
    color: #26313d;
    font-size: 22px;
  }

  .group-buy-detail {
    min-height: 420px;
    padding: 8px;
  }

  .group-buy-sheet__head {
    background: #fff;
    padding: 11px;
  }

  .group-buy-sheet {
    border: 0;
    background: #eef6fb;
  }

  .group-buy-metrics {
    background: #edf2f6;
  }

  .group-buy-metric {
    background: #fff;
  }

  .group-buy-ticket,
  .group-buy-section,
  .group-buy-actions {
    background: #fff;
  }

  .group-buy-sheet__head h2 {
    font-size: 17px;
  }

  .group-buy-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-buy-metric {
    padding: 8px;
  }

  .group-buy-metric strong {
    font-size: 15px;
  }

  .group-buy-ticket {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .group-buy-ticket pre {
    grid-column: 1;
  }

  .group-buy-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .group-buy-mobile-buybar {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-buy-mobile-buybar > div {
    justify-content: space-between;
  }

  .group-buy-actions button {
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .group-buy-section {
    padding: 10px;
  }

  .group-buy-notice {
    max-height: 40px;
    overflow-y: auto;
    padding: 5px 8px;
    font-size: 10px;
  }

  .group-buy-dialog-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .group-buy-registration-editor,
  .group-buy-registration-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-buy-registration-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-buy-qr {
    min-height: 250px;
    padding: 18px;
  }

  .marketplace-view {
    height: calc(100vh - 106px);
  }

  .marketplace-head {
    min-height: 58px;
    padding: 7px 10px;
  }

  .marketplace-head span {
    display: none;
  }

  .marketplace-head > strong {
    padding: 7px;
    font-size: 12px;
  }

  .marketplace-tabs {
    padding: 6px 8px;
  }

  .marketplace-tabs button {
    min-width: 90px;
  }

  .marketplace-body > section {
    padding: 8px;
  }

  .marketplace-toolbar,
  .marketplace-section-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .marketplace-toolbar > span {
    width: 100%;
    margin-left: 0;
  }

  .marketplace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketplace-status-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketplace-status-card p {
    grid-column: 1;
  }

  .marketplace-footer {
    font-size: 10px;
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #1c2731;
  box-shadow: var(--shadow);
}

.toast--error {
  border-color: var(--red);
  color: #ffb5ba;
}

@media (max-width: 1100px) {
  .account-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-card--profile,
  .account-card--ledger {
    grid-column: 1;
  }

  .account-bindings,
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-pane {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .three-pane > .pane:last-child {
    display: none;
  }

  .chat-view > .chat-info-pane.is-open {
    position: absolute;
    z-index: 12;
    inset: 0 0 0 auto;
    width: min(390px, 100%);
    display: grid;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45);
  }

  #chatInfoClose {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-rows: 50px 1fr 56px;
  }

  #adminMobileOpen {
    display: inline-block;
  }

  .topbar {
    padding: 0 8px;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child,
  .topbar__title,
  .topbar__account .button-link {
    display: none;
  }

  .topbar__account {
    margin-left: auto;
    overflow-x: auto;
  }

  .public-tool-button {
    min-height: 32px;
    padding: 0 9px;
  }

  #accountName {
    display: none;
  }

  #accountButton {
    min-height: 32px;
    padding: 0 9px;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    display: flex;
    padding: 4px;
    border-top: 1px solid var(--line);
    border-right: 0;
    overflow-x: auto;
  }

  .nav-button {
    min-width: 70px;
    min-height: 46px;
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
    margin: 0;
    padding: 3px 7px;
    font-size: 11px;
  }

  .sidebar-tool-link {
    min-width: 70px;
    min-height: 46px;
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
    margin: 0;
    padding: 3px 7px;
    font-size: 11px;
  }

  .sidebar-action-button {
    min-width: 70px;
    min-height: 46px;
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
    margin: 0;
    padding: 3px 7px;
    font-size: 11px;
  }

  .nav-button__mark {
    font-size: 12px;
  }

  .view {
    height: calc(100vh - 106px);
  }

  .account-view {
    display: grid;
  }

  .workspace-head {
    min-height: 58px;
    padding: 8px;
  }

  .workspace-head h2 {
    font-size: 16px;
  }

  .workspace-head span {
    display: none;
  }

  .account-workspace {
    gap: 8px;
    padding: 8px;
  }

  .account-card {
    padding: 12px;
  }

  .account-metrics,
  .account-bindings,
  .reward-rule-list,
  .permission-groups,
  .configuration-grid {
    grid-template-columns: 1fr;
  }

  .account-ledger-row {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .account-ledger-row time {
    grid-column: 1 / -1;
  text-align: left;
}

.group-buy-table td strong {
  display: block;
  color: var(--text);
}

.group-buy-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .admin-tabs button {
    min-width: 88px;
  }

  .permission-group__items {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .three-pane,
  .two-pane {
    display: block;
  }

  .three-pane > .pane,
  .two-pane > .pane {
    display: none;
    height: 100%;
  }

  .three-pane > .pane:first-child,
  .two-pane > .pane:first-child {
    display: block;
  }

  .three-pane.is-mobile-detail > .pane:first-child,
  .two-pane.is-mobile-detail > .pane:first-child {
    display: none;
  }

  .three-pane.is-mobile-detail > .pane.is-mobile-active,
  .two-pane.is-mobile-detail > .pane.is-mobile-active {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .form-actions {
    grid-column: 1;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .message {
    max-width: 88%;
  }

  .ai-message {
    max-width: 92%;
  }

  #view-chat > .chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .chat-toolbox {
    padding: 6px 8px;
  }

  .chat-view > .chat-info-pane.is-open {
    position: fixed;
    z-index: 30;
    inset: 50px 0 56px;
    width: 100%;
  }

  .composer {
    grid-template-columns: 42px minmax(0, 1fr) 42px 58px;
    padding: 8px;
  }

  .composer__side-button {
    width: 42px;
    min-width: 42px;
    padding: 0 4px;
  }

  .composer textarea {
    min-height: 50px;
  }

  #messageSendButton {
    width: 58px;
    min-width: 58px;
  }

  .ai-composer {
    grid-template-columns: 1fr;
  }

  .ai-head {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 132px;
  }

  .ai-head__tools {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ai-context-bar {
    grid-template-columns: 1fr 1fr;
    padding: 7px 8px 6px;
    min-width: 0;
  }

  .ai-context-bar label {
    grid-template-columns: 1fr;
  }

  .ai-workflow-buttons {
    grid-column: 1 / -1;
  }

  .ai-lottery-shortcuts {
    padding: 0 8px 6px;
  }

  .ai-information-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 7px 8px;
  }

  .ai-information-strip > div:first-child {
    display: grid;
    gap: 2px;
  }

  .ai-information-strip > div:first-child span {
    display: none;
  }

  .ai-information-list {
    grid-column: 1 / -1;
  }

  .ai-composer__actions {
    justify-content: flex-end;
  }

  .professional-admin-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 批TGW-DEV297：最终层级覆盖历史桌面浅色规则。 */
@media (min-width: 761px) {
  #view-chat {
    --desktop-chat-canvas: #0f171f;
    --desktop-chat-directory: #0d141b;
    --desktop-chat-panel: #111820;
    --desktop-chat-panel-strong: #18212b;
    --desktop-chat-line: #344352;
    --desktop-chat-line-strong: #526577;
    --desktop-chat-ink: #edf3f7;
    --desktop-chat-muted: #aeb9c1;
    --desktop-chat-brand: #35b779;
    --desktop-chat-brand-soft: #183a32;
    --desktop-chat-mine: #1a4d38;
    --desktop-chat-incoming: #1d2833;
    --desktop-chat-warning: #f3c969;
    color-scheme: dark;
    background: var(--desktop-chat-canvas) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat > .pane,
  #view-chat > .chat-directory,
  #view-chat > .chat-info-pane,
  #view-chat .chat-directory > .pane__body,
  #view-chat .chat-info-pane .pane__body {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-directory) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat > .chat-main,
  #view-chat .messages {
    background: var(--desktop-chat-canvas) !important;
  }

  #view-chat > .chat-directory {
    grid-template-rows: auto auto auto minmax(0, 1fr) !important;
  }

  #view-chat > .chat-main {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  #view-chat .chat-directory__quick,
  #view-chat .chat-toolbox {
    display: none !important;
  }

  #view-chat .pane__header,
  #view-chat .chat-head {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .pane__header h2,
  #view-chat .pane__header h3,
  #view-chat .chat-head__identity h2,
  #view-chat .chat-directory__heading strong,
  #view-chat .list-item__title,
  #view-chat .chat-info-card h4,
  #view-chat .chat-info-card p,
  #view-chat .chat-info-card .muted {
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .chat-directory__heading small,
  #view-chat .chat-head__identity .muted,
  #view-chat .list-item__meta,
  #view-chat .request-section-title,
  #view-chat .message__meta {
    color: var(--desktop-chat-muted) !important;
  }

  #view-chat .chat-tabs,
  #view-chat .chat-search {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel) !important;
  }

  #view-chat .chat-search input,
  #view-chat .list-item,
  #view-chat .member-row,
  #view-chat .composer__emoji-panel,
  #view-chat .composer__attachment {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .list-item {
    background: #141d26 !important;
  }

  #view-chat .list-item:hover,
  #view-chat .list-item:focus-visible,
  #view-chat .list-item[aria-pressed="true"] {
    border-color: #3d8067 !important;
    background: var(--desktop-chat-brand-soft) !important;
  }

  #view-chat .chat-directory__mark,
  #view-chat .chat-avatar,
  #view-chat .message__avatar,
  #view-chat .list-item::before {
    border-color: #3d8067 !important;
    background: var(--desktop-chat-brand-soft) !important;
    color: #b7efd3 !important;
  }

  #view-chat .chat-directory .icon-button,
  #view-chat .chat-head .icon-button,
  #view-chat #chatInfoClose {
    border-color: var(--desktop-chat-line-strong) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .chat-connection-status {
    border-color: #3d8067 !important;
    background: #173a2f !important;
    color: #b7efd3 !important;
  }

  #view-chat .chat-connection-status.is-syncing {
    border-color: #846d30 !important;
    background: #3b3014 !important;
    color: var(--desktop-chat-warning) !important;
  }

  #view-chat .chat-connection-status.is-offline {
    border-color: #86444b !important;
    background: #3b2024 !important;
    color: #ffb8bd !important;
  }

  #view-chat .message__bubble {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-incoming) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .message--mine .message__bubble {
    border-color: #3d8067 !important;
    background: var(--desktop-chat-mine) !important;
  }

  #view-chat .message__file {
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .message__file-icon {
    border-color: #3d8067 !important;
    background: var(--desktop-chat-brand-soft) !important;
    color: #b7efd3 !important;
  }

  #view-chat .message__file-details small { color: var(--desktop-chat-muted) !important; }

  #view-chat .message--system .message__bubble,
  #view-chat .message--recalled .message__bubble {
    border-color: var(--desktop-chat-line) !important;
    background: #202b32 !important;
    color: var(--desktop-chat-muted) !important;
  }

  #view-chat .composer {
    grid-template-columns: 48px minmax(0, 1fr) 48px 74px !important;
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel) !important;
  }

  #view-chat .composer__side-button {
    border-color: var(--desktop-chat-line-strong) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .composer__tools {
    grid-column: 1 / -1 !important;
    display: grid !important;
    min-height: 38px;
    border-color: var(--desktop-chat-line) !important;
    background: var(--desktop-chat-panel-strong) !important;
  }

  #view-chat .composer__tools[hidden] { display: none !important; }

  #view-chat .composer__tools button {
    width: auto;
    min-width: 0;
    min-height: 38px;
    border-color: var(--desktop-chat-line-strong) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat .composer__tools button:hover,
  #view-chat .composer__tools button:focus-visible,
  #view-chat .composer__tools button[aria-pressed="true"] {
    border-color: var(--desktop-chat-brand) !important;
    background: var(--desktop-chat-brand-soft) !important;
    color: #b7efd3 !important;
  }

  #view-chat #messageInput {
    grid-column: 2 !important;
    border-color: var(--desktop-chat-line-strong) !important;
    background: var(--desktop-chat-panel-strong) !important;
    color: var(--desktop-chat-ink) !important;
  }

  #view-chat #messageInput::placeholder {
    color: #8d9ca7 !important;
  }

  #view-chat #messageSendButton {
    grid-column: 4 !important;
    border-color: #2c9564 !important;
    background: var(--desktop-chat-brand) !important;
    color: #07150e !important;
  }

  #view-chat #messageSendButton:disabled {
    border-color: var(--desktop-chat-line) !important;
    background: #344352 !important;
    color: #9caab6 !important;
  }

  #view-chat :is(button, a, input, textarea, select):focus-visible {
    outline: 2px solid var(--desktop-chat-warning) !important;
    outline-offset: 2px;
  }
}

/* 批TGWDEV656：平台后台视频模板改为自动封面、自动命名和紧凑多列卡片。 */
.video-bg-admin { min-width: 0; padding: 10px; }
.video-bg-admin__form { display: grid; grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) minmax(120px, 180px); gap: 10px; align-items: end; margin: 0 0 10px; }
.video-bg-admin__form label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 700; }
.video-bg-admin__form input, .video-bg-admin__form select { min-width: 0; min-height: 36px; padding: 4px 8px; border: 1px solid #c9d1dc; border-radius: 7px; background: #fff; color: #232a33; }
.video-bg-admin__form output { grid-column: 1 / -1; min-height: 18px; font-size: 12px; color: #d7aa48; }
.video-bg-admin__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; gap: 8px; min-width: 0; }
.video-bg-admin__row { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 8px 10px; min-width: 0; padding: 8px; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; }
.video-bg-admin__row.is-disabled { opacity: .55; }
.video-bg-admin__row img { width: 54px; height: 96px; object-fit: cover; border-radius: 5px; background: #e8ecf2; }
.video-bg-admin__meta { display: grid; min-width: 0; gap: 2px; }
.video-bg-admin__meta strong, .video-bg-admin__meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-bg-admin__meta small { color: #67707d; }
.video-bg-admin__actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.video-bg-admin__actions button { min-width: 0; min-height: 30px; padding: 0 5px; font-size: 12px; white-space: nowrap; }
@media (max-width: 700px) {
  .video-bg-admin { padding: 8px; }
  .video-bg-admin__form { grid-template-columns: minmax(0, 1fr); }
  .video-bg-admin__form output { grid-column: 1; }
  .video-bg-admin__grid { grid-template-columns: minmax(0, 1fr); }
}

/* 批TGWAPPDEV080：抖音素材库后台列表、筛选与播放。 */
.douyin-source-admin { min-width: 0; padding: 10px; }
.douyin-source-admin__head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.douyin-source-admin__head h3 { margin: 0 0 2px; }
.douyin-source-admin__head p { margin: 0; color: #67707d; font-size: 12px; }
.douyin-source-admin__filters { display: grid; grid-template-columns: repeat(3, minmax(120px, 180px)) minmax(200px, 1fr); gap: 8px; margin: 0 0 8px; }
.douyin-source-admin__filters label { display: grid; gap: 4px; min-width: 0; font-size: 12px; font-weight: 700; }
.douyin-source-admin__filters select, .douyin-source-admin__filters input { min-width: 0; min-height: 34px; padding: 4px 8px; border: 1px solid #c9d1dc; border-radius: 7px; background: #fff; color: #232a33; }
.douyin-source-admin__summary { margin: 0 0 8px; color: #67707d; font-size: 12px; }
.douyin-source-admin__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); align-items: start; gap: 10px; min-width: 0; }
.douyin-source-card { display: grid; min-width: 0; border: 1px solid #dfe4ec; border-radius: 9px; background: #fff; overflow: hidden; }
.douyin-source-card__cover { position: relative; display: block; width: 100%; aspect-ratio: 9 / 12; padding: 0; border: 0; background: #e8ecf2; cursor: pointer; overflow: hidden; }
.douyin-source-card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.douyin-source-card__cover-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #8a94a3; font-size: 12px; }
.douyin-source-card__status { position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 999px; background: rgba(20, 28, 38, .72); color: #fff; font-size: 11px; }
.douyin-source-card__body { display: grid; gap: 4px; min-width: 0; padding: 8px; }
.douyin-source-card__body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.douyin-source-card__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #67707d; font-size: 11px; }
.douyin-source-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.douyin-source-card__tags span { padding: 1px 6px; border-radius: 4px; background: #eef2f7; color: #55606e; font-size: 11px; }
.douyin-source-card__actions { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.douyin-source-card__actions button, .douyin-source-card__actions a { min-height: 30px; padding: 0 8px; font-size: 12px; line-height: 30px; }
.douyin-source-card__actions a { color: #2b5f9e; text-decoration: none; }
.douyin-source-card__error { color: #b4452f !important; white-space: normal !important; }
.douyin-source-admin__head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.douyin-source-card__analysis { display: grid; gap: 4px; padding-top: 6px; border-top: 1px dashed #e3e8ef; }
.douyin-source-card__analysis > small { color: #55606e; font-size: 11px; }
.douyin-source-card__analysis p { display: -webkit-box; margin: 0; overflow: hidden; color: #4c5663; font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.douyin-source-card__analysis .douyin-source-card__actions { flex-wrap: wrap; margin-top: 0; }
.douyin-source-admin__analysis-dialog { width: min(92vw, 680px); }
.douyin-source-admin__analysis-body { display: grid; gap: 8px; max-height: 70vh; padding: 0 12px 12px; overflow: auto; }
.douyin-source-admin__analysis-body > small { color: #67707d; font-size: 11px; }
.douyin-source-admin__analysis-summary { margin: 0; font-size: 13px; line-height: 1.6; }
.douyin-source-admin__scene { display: grid; gap: 2px; padding: 8px; border: 1px solid #e3e8ef; border-radius: 7px; }
.douyin-source-admin__scene p { margin: 0; font-size: 12px; line-height: 1.55; }
.douyin-source-admin__scene-line em { margin-right: 6px; color: #2b5f9e; font-style: normal; font-weight: 700; }
.douyin-source-admin__dialog { width: min(92vw, 480px); max-height: 88vh; padding: 0; border: 0; border-radius: 10px; }
.douyin-source-admin__dialog::backdrop { background: rgba(12, 18, 26, .55); }
.douyin-source-admin__dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.douyin-source-admin__dialog-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.douyin-source-admin__dialog video { display: block; width: 100%; max-height: 72vh; background: #000; }
.douyin-source-admin__dialog-note { margin: 0; padding: 8px 12px; color: #b4452f; font-size: 12px; }
.douyin-source-admin__dialog-note:empty { display: none; }
@media (max-width: 700px) {
  .douyin-source-admin { padding: 8px; }
  .douyin-source-admin__filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .douyin-source-admin__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .douyin-source-admin__head { align-items: start; }
}

/* 批TGWDEV476 / BUG051：接待详情悬浮于消息上方；切角色和展开控件不改变聊天几何。 */
html[data-business-view="chat"]:not(.is-embedded-chat) body .workspace { grid-template-rows: minmax(0, 1fr); }
html[data-business-view="chat"]:not(.is-embedded-chat) body .main { height: 100%; min-height: 0; max-height: 100%; overflow: clip; }
html[data-business-view="chat"]:not(.is-embedded-chat) body .main > .view.hidden { display: none !important; }
html body #view-chat > .chat-main { grid-template-columns: minmax(0, 1fr) !important; }
html body #view-chat .chat-main .chat-head {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 8px 12px !important;
  overflow: visible;
}
html body #view-chat .chat-main .chat-head > :not(#storeReceptionBar) { order: 0; }
html body #view-chat .chat-main .chat-head__identity {
  flex: 0 1 144px !important;
  width: 144px;
  max-width: 144px !important;
  min-width: 72px;
  gap: 2px;
}
html body #view-chat .chat-main .chat-head__identity :is(h2, .muted) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body #view-chat .chat-main .chat-typing-status { position: absolute; top: 46px; max-width: 144px; }
html body #view-chat .chat-main #storeReceptionBar[data-service-layout="toolbar"] {
  order: 0;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}
html body #view-chat .chat-main .chat-head-avatar {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
}
html body #view-chat .chat-main .chat-head :is(.icon-button, .chat-invite-friends-button, .chat-connection-status) {
  flex-shrink: 0;
  white-space: nowrap;
}
html body #view-chat .chat-main .chat-call-actions { margin-left: auto; }
@media (min-width: 761px) {
  html body #view-chat .chat-main :is(#chatDirectoryToggle, .mobile-back) { display: none !important; }
}
@media (max-width: 760px) {
  /* 窄窗口只显示列表或详情，不能让旧display:grid把聊天排到列表后。 */
  html:not(.is-embedded-chat) body #view-chat > .chat-directory {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
  }
  html:not(.is-embedded-chat) body #view-chat > .chat-main { display: none !important; }
  html:not(.is-embedded-chat) body #view-chat.is-mobile-detail > .chat-directory { display: none !important; }
  html:not(.is-embedded-chat) body #view-chat.is-mobile-detail > .chat-main.is-mobile-active { display: grid !important; }
  html body #view-chat .chat-main .chat-head {
    height: 94px;
    min-height: 94px;
    max-height: 94px;
    padding: 6px 8px 44px !important;
    gap: 4px !important;
  }
  /* 批TGWAPPDEV030：外层整页沿用返回按钮；浮窗iframe必须保留目录切换键。 */
  html:not(.is-embedded-chat) body #view-chat .chat-main #chatDirectoryToggle { display: none !important; }
  html body #view-chat .chat-main #storeReceptionBar[data-service-layout="toolbar"] {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
  html body #view-chat .chat-main .chat-head-avatar { flex-basis: 32px; width: 32px; min-width: 32px; height: 32px; }
  html body #view-chat .chat-main .chat-head__identity { flex: 1 1 72px !important; width: auto; max-width: 144px !important; }
  html body #view-chat .chat-main .chat-head .icon-button { min-width: 30px; width: 30px; min-height: 32px; height: 32px; padding: 0; }
  html body #view-chat .chat-main #chatInfoButton { flex-basis: 30px; min-width: 30px; width: 30px; }
  html body #view-chat .chat-main .chat-call-actions { gap: 3px; }
  html body #view-chat .chat-main .chat-typing-status { top: 39px; }
}

/* BUG-20261008-TGW-058: chat settings/invites must retain readable foregrounds
   in every interaction state; do not inherit the global dark hover/filter. */
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogClose, #dialogCancel, #dialogSubmit, .chat-settings-tabs button,
      .chat-settings-actions button, [data-chat-settings-invite],
      [data-chat-sound-preview], [data-chat-invite-add-friend]) {
  --chat-control-bg: #f2f6f8;
  --chat-control-hover-bg: #e3edf2;
  --chat-control-active-bg: #d4e3eb;
  --chat-control-ink: #23303a;
  background: var(--chat-control-bg);
  color: var(--chat-control-ink);
}
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogSubmit, .chat-settings-tabs button, .chat-settings-actions button):is(.button--primary, [aria-selected="true"]) {
  --chat-control-bg: #167548;
  --chat-control-hover-bg: #12673f;
  --chat-control-active-bg: #0e5635;
  --chat-control-ink: #ffffff;
}
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogSubmit, .chat-settings-actions button).chat-danger-button {
  --chat-control-bg: #fff6f6;
  --chat-control-hover-bg: #fff0f0;
  --chat-control-active-bg: #f8dddd;
  --chat-control-ink: #8b2020;
}
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogClose, #dialogCancel, #dialogSubmit, .chat-settings-tabs button,
      .chat-settings-actions button, [data-chat-settings-invite],
      [data-chat-sound-preview], [data-chat-invite-add-friend]):not(#quickPushNextDragHandle):is(:hover, :focus-visible):not(:disabled) {
  background: var(--chat-control-hover-bg);
  color: var(--chat-control-ink);
  filter: none !important;
}
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogClose, #dialogCancel, #dialogSubmit, .chat-settings-tabs button,
      .chat-settings-actions button, [data-chat-settings-invite],
      [data-chat-sound-preview], [data-chat-invite-add-friend]):not(#quickPushNextDragHandle):active:not(:disabled) {
  background: var(--chat-control-active-bg);
  color: var(--chat-control-ink);
  filter: none !important;
}
html[data-business-view="chat"] body #dialogForm:has(.chat-settings-tabs, .chat-invite-friend-list)
  :is(#dialogClose, #dialogCancel, #dialogSubmit, .chat-settings-tabs button,
      .chat-settings-actions button, [data-chat-settings-invite],
      [data-chat-sound-preview], [data-chat-invite-add-friend]):disabled {
  background: #e8ecef;
  color: #59656e;
  border-color: #c4cdd3;
  opacity: 1;
  filter: none !important;
  cursor: not-allowed;
}
/* TGWDEV691: due reminders remain usable until opened or dismissed. */
.chat-reminder-alerts { position: fixed; top: 72px; right: 16px; z-index: 11000; width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; display: grid; gap: 10px; }
.chat-reminder-alert { padding: 14px; border: 1px solid #94c9bd; border-radius: 10px; background: #fff; color: #173b35; box-shadow: 0 4px 16px #173b3526; }
.chat-reminder-alert p { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* TGWDEV667: keep the add button inside the narrow directory in every theme. */
@media (min-width: 761px) {
  #view-chat > .chat-directory { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  #view-chat .chat-tabs { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-chat .chat-tabs button { min-height: 30px; padding: 5px 2px; font-size: 13px; }
  #view-chat .chat-search { grid-template-columns: minmax(0, 1fr) 30px; gap: 5px; padding: 6px; min-width: 0; }
  #view-chat .chat-search input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 30px; padding: 4px 6px; }
  #view-chat .chat-search__add { box-sizing: border-box; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; font-size: 21px; }
  #view-chat .chat-directory .list-item { padding: 8px 6px; gap: 7px; }
  #view-chat .chat-directory .chat-avatar { width: 36px; height: 36px; min-width: 36px; }
  #view-chat .chat-directory .list-item__title { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
}
