:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --ink: #1a1a1a;
  --muted: #5f6368;
  --accent: #c45c26;
  --accent-ink: #ffffff;
  --accent-2: #a34b1c;
  --line: #dadce0;
  --danger: #c5221f;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 2px 8px rgba(60, 64, 67, 0.06);
  --radius: 16px;
  --rail-width: 84px;
  --font-display: "Fraunces", "Songti SC", serif;
  --font-body: "Instrument Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.app-shell,
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #ffffff;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— 左侧竖栏 —— */
.app-rail {
  position: fixed;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: var(--rail-width);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.45rem;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rail-compose {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.45rem;
  font-weight: 600;
  text-decoration: none;
  flex: none;
}
.rail-compose:hover { filter: brightness(1.06); text-decoration: none; }
.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  flex: 1;
  overflow-y: auto;
}
.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.2rem;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.68rem;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.rail-item:hover,
.rail-item.active {
  color: var(--ink);
  background: #f1f3f4;
  text-decoration: none;
}
.rail-ico { font-size: 1.05rem; line-height: 1; }
.rail-chat { margin-top: auto; }

.app-frame {
  margin-left: calc(var(--rail-width) + 28px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-frame {
  margin-left: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.5rem 0.95rem 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  flex: none;
}
.brand span { color: var(--accent); }
.brand .app-version {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.top-nav a {
  color: var(--muted);
  font-size: 0.92rem;
}
.top-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: none;
}
.top-me {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0.25rem;
}
.top-me:hover,
.top-me.active {
  color: var(--accent);
  text-decoration: none;
}
.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 600;
}
.pill-link:hover { text-decoration: none; filter: brightness(1.05); }
.avatar-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.avatar-link:hover { text-decoration: none; }

.workspace {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  flex: 1;
}

/* 兼容旧 class：内容页仍用 container/panel */
.container { width: 100%; margin: 0; padding: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.page-header .page-title { margin-bottom: 0.25rem; }
.page-header .page-desc { margin-bottom: 0; max-width: 42rem; }
.page-header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  padding-top: 0.35rem;
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}
.filter-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.filter-tab.is-active {
  border-color: rgba(196, 92, 38, 0.35);
  background: rgba(196, 92, 38, 0.1);
  color: var(--accent-2);
  font-weight: 600;
}
.filter-tab .count {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  opacity: 0.85;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger { background: var(--danger); color: #2a0d0d; }
.btn:hover { filter: brightness(1.05); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card-link {
  display: block;
  padding: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.card-link h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}
.meta { color: var(--muted); font-size: 0.88rem; }
.muted { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.form-grid { display: grid; gap: 0.75rem; max-width: 520px; }
.form-grid label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.form-grid input, .form-grid textarea, .form-grid select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: var(--bg-elevated);
  color: var(--ink);
}
.error { color: var(--danger); margin-bottom: 0.75rem; }
.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(196, 92, 38, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.me-links { display: grid; gap: 0.75rem; }
.me-links a {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.me-links a:hover { text-decoration: none; border-color: var(--accent); }
.media-box { margin: 1rem 0; }
.media-box video, .media-box audio { width: 100%; border-radius: 12px; background: #111; }

.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 800px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  border-radius: 8px;
}
.admin-nav a:hover {
  background: rgba(196, 92, 38, 0.08);
  text-decoration: none;
  color: var(--ink);
}
.admin-nav a.is-active {
  background: rgba(196, 92, 38, 0.12);
  color: var(--accent-2);
  font-weight: 600;
}
.admin-main { min-width: 0; }

/* —— 管理后台 Pro 壳层 —— */
body.admin-pro {
  background: #f3f2ef;
  min-height: 100vh;
}
body.admin-pro .admin-app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
body.admin-pro .admin-sider {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.85rem 1rem;
  background: #1c1917;
  color: #e7e5e4;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
body.admin-pro .admin-sider-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.55rem 1rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.55rem;
}
body.admin-pro .admin-sider-brand:hover { text-decoration: none; }
body.admin-pro .admin-sider-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  flex: none;
}
body.admin-pro .admin-sider-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
body.admin-pro .admin-sider-text strong {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
body.admin-pro .admin-sider-text small {
  color: rgba(231, 229, 228, 0.55);
  font-size: 0.72rem;
}
body.admin-pro .admin-sider-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.2rem 0.2rem 1rem;
}
body.admin-pro .admin-nav-group { margin-bottom: 0.85rem; }
body.admin-pro .admin-nav-label {
  margin: 0 0 0.35rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(231, 229, 228, 0.42);
}
body.admin-pro .admin-sider-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: rgba(231, 229, 228, 0.78);
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 0.15rem;
}
body.admin-pro .admin-sider-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
body.admin-pro .admin-sider-nav a.is-active {
  background: rgba(196, 92, 38, 0.92);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(196, 92, 38, 0.28);
}
body.admin-pro .admin-sider-foot {
  padding: 0.85rem 0.55rem 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.55rem;
}
body.admin-pro .admin-user-chip {
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
body.admin-pro .admin-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}
body.admin-pro .admin-user-role {
  font-size: 0.72rem;
  color: rgba(231, 229, 228, 0.55);
}
body.admin-pro .admin-logout {
  color: rgba(231, 229, 228, 0.72);
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
}
body.admin-pro .admin-logout:hover { color: #fff; }
body.admin-pro .admin-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.admin-pro .admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
body.admin-pro .admin-crumb {
  color: var(--muted);
  font-size: 0.88rem;
}
body.admin-pro .admin-top-link {
  color: var(--ink);
  font-size: 0.88rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}
body.admin-pro .admin-top-link:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  text-decoration: none;
}
body.admin-pro .admin-content {
  padding: 1.25rem 1.5rem 2rem;
  max-width: none;
  width: 100%;
}
body.admin-pro .form-grid-wide {
  max-width: none;
  width: 100%;
}
body.admin-pro .form-grid:not(.form-grid-wide) {
  max-width: 640px;
}
body.admin-pro .page-header {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid transparent;
}
body.admin-pro .page-title {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
body.admin-pro .page-desc { color: var(--muted); }
body.admin-pro .panel,
body.admin-pro .table-panel,
body.admin-pro .filters-bar {
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}
body.admin-pro .table-panel {
  padding: 0;
  overflow: hidden;
}
body.admin-pro .table-panel .table-scroll { margin: 0; }
body.admin-pro .data-table thead th {
  background: #fafaf9;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 600;
}
body.admin-pro .data-table tbody tr:hover td {
  background: rgba(196, 92, 38, 0.035);
}
body.admin-pro .filters-bar {
  background: #fff;
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}
body.admin-pro .list-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}
body.admin-pro .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
body.admin-pro .stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}
@media (max-width: 900px) {
  body.admin-pro .admin-app { grid-template-columns: 1fr; }
  body.admin-pro .admin-sider {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  body.admin-pro .admin-sider-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: none;
    overflow: visible;
  }
  body.admin-pro .admin-nav-group {
    flex: 1 1 140px;
    margin-bottom: 0.35rem;
  }
  body.admin-pro .admin-content { padding: 1rem; }
}

/* —— 技能市场 —— */
.skill-market-filters {
  display: grid;
  grid-template-columns: minmax(16rem, 1.6fr) minmax(10rem, 0.8fr) auto;
  gap: 0.85rem 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
  max-width: none;
  width: 100%;
}
.skill-market-filters > label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}
.skill-market-filters .form-actions {
  padding-top: 0;
  align-items: end;
  margin: 0;
}
@media (max-width: 720px) {
  .skill-market-filters {
    grid-template-columns: 1fr;
  }
}
.skill-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.skill-market-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem;
  margin: 0;
}
.skill-market-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.skill-market-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.skill-market-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em;
}
.skill-market-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.skill-market-card-foot {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
}
.skill-market-bind {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.skill-market-bind select {
  max-width: 11rem;
  font-size: 0.85rem;
}
.skill-market-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
}

body.admin-login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(196, 92, 38, 0.12), transparent 45%),
    linear-gradient(180deg, #f7f5f2 0%, #f3f2ef 100%);
}
body.admin-login-page .admin-login-wrap {
  width: min(100% - 2rem, 440px);
}
body.admin-login-page .login-card {
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(28, 25, 23, 0.08);
}
.notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(196, 92, 38, 0.08);
  border: 1px solid rgba(196, 92, 38, 0.2);
  color: var(--ink);
}
.notice-inline {
  margin: 0;
  color: var(--muted);
}
.login-card {
  max-width: 420px;
  margin: 3rem auto;
}
.list-meta { margin: 0.75rem 0; }
.pager { display: flex; gap: 0.75rem; margin-top: 1rem; }
.filters-bar { margin-bottom: 1rem; align-items: end; }
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
}
.inline-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.inline-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  background: var(--bg-elevated);
}
.prompt-preview {
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
}
.skill-bind-row { padding: 0.55rem 1rem !important; }
.skill-bind-form {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
}
.skill-bind-form .bind-order,
.skill-bind-form .check-inline {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.skill-bind-form .bind-order input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  background: var(--bg-elevated);
}
.skill-bind-form .bind-meta strong { display: block; }
.skill-bind-form .bind-actions { display: flex; gap: 0.4rem; }
.kind-pill.kind-tool { background: rgba(66, 133, 244, 0.12); color: #1a73e8; }
.kind-pill.kind-reason { background: rgba(156, 39, 176, 0.1); color: #7b1fa2; }
.kind-pill.kind-biz { background: rgba(196, 92, 38, 0.12); color: var(--accent-2); }

/* 兼容旧 table.table / 裸 table（云上与未迁移模板） */
.admin-shell table.table,
.admin-shell .panel > table:not(.data-table) {
  width: 100%;
  border-collapse: collapse;
}
.admin-shell table.table th,
.admin-shell table.table td,
.admin-shell .panel > table:not(.data-table) th,
.admin-shell .panel > table:not(.data-table) td {
  text-align: left;
  vertical-align: middle;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.admin-shell table.table thead th,
.admin-shell .panel > table:not(.data-table) thead th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
}

@media (max-width: 900px) {
  .skill-bind-form {
    grid-template-columns: 1fr 1fr;
  }
  .skill-bind-form .bind-meta { grid-column: 1 / -1; }
  .skill-bind-form .bind-actions { grid-column: 1 / -1; }
}

/* Admin data tables */
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.data-table th,
.data-table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.4;
}
.data-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  background: var(--surface-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(196, 92, 38, 0.03); }
.data-table .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.data-table .col-pri { width: 4.5rem; color: var(--muted); }
.data-table .col-key { white-space: nowrap; }
.data-table .col-num { width: 4.5rem; text-align: center; }
.data-table .col-kind { white-space: nowrap; }
.data-table .col-teacher { white-space: nowrap; }
.data-table .col-provider { min-width: 9.5rem; max-width: 14rem; }
.data-table .col-status { width: 5rem; white-space: nowrap; }
.data-table .col-actions { min-width: 5.5rem; text-align: right; white-space: nowrap; }
.data-table .col-name { font-weight: 500; }
.data-table .empty-row { text-align: center; color: var(--muted); padding: 1.5rem; }
.key-chip {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
}
.kind-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.kind-pill.kind-main { background: rgba(26, 26, 26, 0.08); color: var(--ink); }
.kind-pill.kind-expert { background: rgba(196, 92, 38, 0.12); color: var(--accent-2); }
.kind-pill.kind-knowledge { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.on { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.status-pill.off { background: rgba(197, 34, 31, 0.1); color: var(--danger); }
.provider-stack { display: grid; gap: 0.2rem; }
.provider-line {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.provider-line.muted { color: var(--muted); font-size: 0.8rem; }
.provider-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.28rem;
  line-height: 1.4;
}
.btn-link {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-elevated);
}
.btn-link.danger-text {
  color: var(--danger);
  border-color: rgba(197, 34, 31, 0.25);
}
.btn-link.danger-text:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.col-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}
.form-grid-wide {
  max-width: 960px;
  grid-template-columns: 1fr 1fr;
}
.form-grid-wide .span-2 { grid-column: 1 / -1; }
.form-grid-wide .check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.6rem;
}
.form-grid-wide .check-row input { width: auto; }
.form-actions { display: flex; gap: 0.75rem; padding-top: 0.25rem; }
@media (min-width: 1200px) {
  .form-grid-wide {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .form-grid-wide { grid-template-columns: 1fr; }
  .form-grid-wide .check-row { padding-top: 0; }
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface-2);
}
.stat strong { display: block; font-size: 1.6rem; font-family: var(--font-display); }

/* —— 首页舞台 —— */
.stage-hero {
  margin: 0.25rem 0 1.75rem;
  overflow: hidden;
}
.stage-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
}
.stage-slide {
  scroll-snap-align: start;
  min-height: 220px;
  padding: 1.5rem 1.4rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
}
.stage-slide.is-focus {
  background: linear-gradient(180deg, #fffaf6, #ffffff);
  border-color: #e8c4a8;
}
.stage-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stage-slide h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
}
.stage-slide p {
  margin: 0 0 0.55rem;
  color: var(--muted);
}

.home-section { margin-bottom: 1.75rem; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.section-head a { color: var(--muted); font-size: 0.9rem; }
.section-head a:hover { color: var(--accent); text-decoration: none; }

.create-row,
.discover-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.create-tile {
  min-height: 132px;
  padding: 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
a.create-tile:hover,
button.create-tile:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.create-plus {
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: auto;
}
.create-tile strong { font-size: 1.05rem; }
.create-tile span { color: var(--muted); font-size: 0.84rem; }

.discover-card {
  position: relative;
  min-height: 190px;
  padding: 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
}
.discover-card.alt {
  background: #fafafa;
}
.discover-card.warm {
  background: linear-gradient(180deg, #fffaf6, #ffffff);
}
.discover-card:hover { text-decoration: none; border-color: #c45c26; }
.discover-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 600;
}
.discover-card strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
}
.discover-card span { color: var(--muted); font-size: 0.86rem; }
.home-footnote {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}

/* —— 全屏咨询页（文心式 + 会话历史） —— */
body.chat-page-body {
  height: 100vh;
  overflow: hidden;
}
body.chat-page-body .app-frame {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
body.chat-page-body .workspace.workspace-chat {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0.75rem;
}
.workspace-chat {
  width: min(1120px, calc(100% - 1.5rem));
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 84px);
}
.chat-page {
  flex: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
}
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0.35rem 0.15rem 0.5rem 0;
  border-right: 1px solid var(--line);
}
.chat-history-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.chat-history-new:hover {
  border-color: rgba(196, 92, 38, 0.45);
  color: var(--accent);
}
.chat-history-label {
  flex-shrink: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 0.35rem;
}
.chat-history-list {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
}
.chat-history-list::-webkit-scrollbar {
  width: 6px;
}
.chat-history-list::-webkit-scrollbar-thumb {
  background: rgba(95, 99, 104, 0.35);
  border-radius: 999px;
}
.chat-history-list::-webkit-scrollbar-track {
  background: transparent;
}
.chat-history-empty {
  margin: 0.35rem;
  line-height: 1.5;
}
.chat-history-item-title {
  font-size: 0.92rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-history-item-time {
  font-size: 0.72rem;
  color: var(--muted);
}
.chat-history-item,
.chat-favorite-item {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  width: 100%;
  border-radius: 12px;
  position: relative;
}
.chat-session-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 0.65rem 0.45rem 0.65rem 0.7rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  min-width: 0;
}
.chat-history-item:hover,
.chat-favorite-item:hover {
  background: rgba(196, 92, 38, 0.06);
}
.chat-history-item.is-active,
.chat-favorite-item.is-active {
  background: rgba(196, 92, 38, 0.12);
}
.chat-session-more {
  flex: 0 0 auto;
  width: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
}
.chat-history-item:hover .chat-session-more,
.chat-favorite-item:hover .chat-session-more,
.chat-session-more:focus {
  opacity: 1;
}
.chat-session-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.3rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
  vertical-align: 0.05em;
}
.chat-session-badge.is-pin {
  color: var(--accent);
  background: rgba(196, 92, 38, 0.12);
}
.chat-session-badge.is-star {
  color: #8a5a12;
  background: rgba(196, 150, 38, 0.14);
}
.chat-favorites {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.chat-favorites.is-collapsed .chat-favorites-list {
  display: none;
}
.chat-favorites.is-collapsed .chat-favorites-caret {
  transform: rotate(-90deg);
}
.chat-favorites-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.35rem;
  cursor: pointer;
}
.chat-favorites-ico {
  color: var(--accent);
}
.chat-favorites-caret {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.chat-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 180px;
  overflow-y: auto;
}
.chat-session-menu {
  position: fixed;
  z-index: 80;
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.chat-session-menu[hidden] {
  display: none !important;
}
.chat-session-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.chat-session-menu button:hover {
  background: rgba(196, 92, 38, 0.08);
}
.chat-session-menu button.is-danger {
  color: #b42318;
}
.chat-page-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-page-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-page-welcome {
  text-align: center;
  padding: 3.5rem 1rem 1.5rem;
}
.chat-page-welcome h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--ink);
}
.chat-page-welcome p {
  margin: 0;
  color: var(--muted);
}
.chat-page-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.25rem 1rem;
  min-height: 160px;
}
.chat-page-dock {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}
.chat-page-composer {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem 0.75rem;
}
.chat-page-input-wrap textarea {
  width: 100%;
  border: none;
  resize: none;
  outline: none;
  font: inherit;
  color: var(--ink);
  background: transparent;
  min-height: 64px;
  line-height: 1.5;
}
.chat-page-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.chat-page-agent-label { flex: 1; }
.chat-page-send { border-radius: 999px; padding: 0.55rem 1.1rem; }
.chat-page-stop {
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.chat-page-stop:hover {
  border-color: rgba(197, 34, 31, 0.45);
  color: var(--danger);
}
.chat-queue-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.chat-expert-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
  justify-content: center;
}
.expert-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}
.expert-pill:hover,
.expert-pill.is-active {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.expert-pill-more { color: var(--muted); }

/* —— 智能体推荐页 —— */
.agents-hero { margin: 0.5rem 0 1.75rem; }
.agents-greeting {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  color: var(--ink);
}
.agents-composer { max-width: 720px; }
.agents-composer-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.agents-composer-hint {
  margin: 0 0 1rem;
  color: var(--muted);
}
.agents-composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.agent-main-grid {
  display: grid;
  gap: 0.85rem;
}
.agent-main-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.agent-main-copy h3 {
  margin: 0.2rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.agent-main-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}
.agent-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.agent-search input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  min-width: 200px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.agent-rec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.home-agent-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.agent-rec-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  color: inherit;
}
a.agent-rec-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.agent-rec-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(196, 92, 38, 0.12);
  color: var(--accent);
  font-weight: 700;
}
.agent-rec-body h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--accent-2);
}
.agent-rec-title {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.86rem;
  color: var(--ink);
  font-weight: 600;
}
.agent-rec-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.agent-rec-cta { white-space: nowrap; }
@media (max-width: 960px) {
  .agent-rec-grid { grid-template-columns: 1fr; }
  .agent-rec-card { grid-template-columns: auto 1fr; }
  .agent-rec-cta { grid-column: 2; justify-self: start; }
}

/* 客服抽屉 */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 70;
}
.chat-overlay[hidden],
.chat-drawer[hidden] {
  display: none !important;
}
.chat-drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(400px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 48px));
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatIn 0.22s ease;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(196, 92, 38, 0.06), transparent);
}
.chat-drawer-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.chat-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 0.2rem;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}
.bubble {
  max-width: 92%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.95rem;
}
.bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 6px;
}
.bubble.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border-bottom-left-radius: 6px;
}
.agent-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-2);
  margin-bottom: 0.35rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.65rem; }
.cta {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 0.85rem;
}
.cta:hover { border-color: var(--accent); text-decoration: none; }

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem 1rem;
  margin: 0;
  flex-shrink: 0;
}
.chat-form input[type="text"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font: inherit;
  background: var(--bg-elevated);
  color: var(--ink);
}
.chat-file-input { display: none; }
.chat-form-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-form-controls input[type="text"] { min-width: 0; }
.chat-attachment-btn {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.65rem;
  background: var(--bg-elevated);
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.chat-attachment-btn:hover { border-color: var(--accent); }
.chat-attachment-btn:disabled,
.chat-form .btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.chat-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chat-attachment-preview[hidden] { display: none; }
.chat-attachment-item {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.chat-attachment-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.chat-attachment-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font: 16px/20px sans-serif;
  cursor: pointer;
}
.chat-attachment-progress {
  position: absolute;
  inset: auto 0 0;
  padding: 0.2rem;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.7rem;
  text-align: center;
}
.chat-upload-status {
  min-height: 1em;
  color: var(--muted);
  font-size: 0.78rem;
}
.chat-upload-status.error { color: var(--danger); }
.chat-message-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.chat-message-image-link {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}
.chat-message-image {
  display: block;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.chat-message-image-link:hover {
  outline: 2px solid rgba(196, 92, 38, 0.4);
  text-decoration: none;
}
.chat-drawer .bubble.pending {
  opacity: 0.75;
  font-style: italic;
}
.bubble.streaming .stream-body::after {
  content: "▍";
  display: inline-block;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
.consult-experts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.15rem 0 0.65rem;
}
.consult-expert {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fa;
  padding: 0.15rem 0.55rem 0.45rem;
}
.consult-expert > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
}
.consult-expert > summary::-webkit-details-marker {
  display: none;
}
.consult-expert-ico {
  color: var(--accent);
  font-size: 0.75rem;
}
.consult-expert-title {
  font-weight: 500;
}
.consult-expert-body {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #5f6368;
  white-space: pre-wrap;
  padding: 0 0.15rem 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}
.consult-expert.is-live .consult-expert-title::after {
  content: "";
  display: inline-block;
  width: 0.35em;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
.consult-expert.is-live .consult-expert-body::after {
  content: "▍";
  margin-left: 1px;
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink {
  50% { opacity: 0; }
}
.chat-placeholder { opacity: 0.85; }

.assessment-chat {
  height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
}
.assessment-chat .chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.assessment-chat .chat-form { flex-shrink: 0; }

@media (max-width: 960px) {
  .create-row,
  .discover-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-nav { display: none; }
  .chat-page {
    grid-template-columns: 1fr;
  }
  .chat-history {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 220px;
    height: auto;
    padding-bottom: 0.75rem;
  }
  .chat-history-list {
    min-height: 0;
  }
}
@media (max-width: 720px) {
  :root { --rail-width: 68px; }
  .app-rail {
    left: 8px;
    top: 8px;
    bottom: 8px;
    padding: 0.55rem 0.25rem;
  }
  .app-frame { margin-left: calc(var(--rail-width) + 16px); }
  .brand { font-size: 1.15rem; }
  .create-row,
  .discover-row { grid-template-columns: 1fr; }
  .chat-drawer {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(78vh, 640px);
    border-radius: 18px 18px 0 0;
  }
}
/* —— 分享 / 信息流 —— */
.share-board { margin-top: 0.25rem; }
.share-board-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
.share-tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.share-tabs a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.share-tabs a:hover { color: var(--ink); text-decoration: none; }
.share-tabs a.active {
  color: var(--accent);
  background: rgba(196, 92, 38, 0.08);
}
.share-search {
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 320px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.share-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0.9rem;
  font: inherit;
  outline: none;
  min-width: 0;
}
.share-search button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0 0.85rem 0 0.2rem;
  cursor: pointer;
  font-size: 1rem;
}
.share-write-btn {
  flex: none;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
}
.share-board-body {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-top: 1rem;
}
.share-cats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: sticky;
  top: 5.5rem;
}
.share-cat {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}
.share-cat:hover { color: var(--ink); background: #f5f5f5; text-decoration: none; }
.share-cat.active {
  color: var(--accent);
  background: #f1f3f4;
  font-weight: 600;
}
.share-articles { min-width: 0; }
.share-article {
  display: block;
  padding: 1.15rem 0.15rem 1.2rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.share-article:hover { text-decoration: none; }
.share-article:hover .share-article-title { color: var(--accent); }
.share-article-title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  font-family: var(--font-body);
}
.share-article-summary {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.share-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.share-article-score { color: var(--accent); font-size: 0.75rem; }
.share-article-author { color: var(--muted); }
.share-empty {
  padding: 2.5rem 0.5rem;
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  color: var(--muted);
}
.share-empty p { margin: 0; }

.share-form {
  max-width: 40rem;
  gap: 1.15rem;
}
.share-form label > span:first-child {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
}
.field-optional {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82em;
  margin-left: 0.25rem;
}
.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.share-form textarea {
  min-height: 11rem;
  resize: vertical;
  line-height: 1.55;
}
.share-file-field input[type="file"] {
  padding: 0.45rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.share-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.25rem;
}

.feed-detail { max-width: 44rem; }
.feed-detail-block + .feed-detail-block {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.feed-detail-block h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.feed-detail-block p {
  margin: 0;
  line-height: 1.65;
  color: var(--ink);
}
.feed-detail-source { margin: 1.25rem 0 0; }
.feed-detail-body .article-body {
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
}
.feed-detail-body .article-body p {
  margin: 0 0 0.85rem;
}
.feed-detail-body .article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0.75rem 0;
}

@media (max-width: 820px) {
  .share-board-body { grid-template-columns: 1fr; }
  .share-cats {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .share-search { margin-left: 0; max-width: none; width: 100%; order: 3; }
  .share-write-btn { margin-left: auto; }
}
