:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-2: #0d1220;
  --bg-3: #070911;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f6f7fb;
  --muted: #9aa4b2;
  --line: rgba(255, 255, 255, 0.12);
  --surface: rgba(8, 11, 18, 0.62);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(8, 11, 18, 0.90);
  --primary: #6d5dfc;
  --primary-2: #14c8ff;
  --danger: #ff5f73;
  --success: #36d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --pay-card-bg: #1a1f2e;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109, 93, 252, 0.38), transparent 36rem),
    radial-gradient(circle at top right, rgba(20, 200, 255, 0.28), transparent 32rem),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 50%, var(--bg-3) 100%);
}

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

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

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.hero-grid,
.chat-layout,
.admin-layout,
.login-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 24px;
}

.brand,
.nav-actions,
.hero-actions,
.section-title,
.chat-header,
.admin-header,
.form-row,
.model-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-size: 14px;
}

.nav-actions {
  gap: 14px;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  margin-top: 22px;
  padding: 46px;
  border-radius: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
}

.hero-copy {
  max-width: 680px;
  color: #cad1dc;
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.button:hover,
.text-button:hover,
.model-card:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 800;
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.danger {
  background: rgba(255, 95, 115, 0.14);
  color: #ffb3bd;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-2);
  cursor: pointer;
}

.hero-card {
  display: grid;
  gap: 14px;
}

.metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.metric strong {
  font-size: 20px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 32px;
}

.model-panel,
.chat-panel,
.admin-panel,
.form-panel,
.pricing-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
}

.model-panel {
  padding: 16px;
}

.section-title,
.chat-header,
.admin-header {
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.model-list {
  display: grid;
  gap: 10px;
}

/* ===== 模型分类侧边栏 ===== */
.model-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 13px;
  outline: none;
  margin-bottom: 12px;
}
.model-search::placeholder { color: var(--muted); }
.model-search:focus { border-color: var(--primary); }

.model-category { display: grid; gap: 6px; }
.model-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s;
  user-select: none;
}
.model-category-header:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.model-category-header .cat-name { display: flex; align-items: center; gap: 6px; }
.model-category-header .cat-count {
  font-size: 11px; font-weight: 500; padding: 1px 7px;
  border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--muted);
}
.model-category-header .cat-arrow {
  font-size: 11px; transition: transform 0.2s; color: var(--muted);
}
.model-category.collapsed .cat-arrow { transform: rotate(-90deg); }
.model-category.collapsed .model-category-items { display: none; }
.model-category-items { display: grid; gap: 6px; padding-left: 4px; }
.usage-subcat {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; font-size: 11px; font-weight: 600;
  color: var(--primary-2); text-transform: uppercase;
  letter-spacing: 0.5px; border-left: 2px solid var(--primary-2);
  margin-top: 4px;
}
.usage-subcat:first-child { margin-top: 0; }
.usage-subcat .usage-count {
  font-size: 10px; font-weight: 500; padding: 0 5px;
  border-radius: 999px; background: rgba(20,200,255,0.12); color: var(--primary-2);
}

.model-card-mini {
  width: 100%; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 14px;
  background: rgba(255,255,255,0.04); color: inherit;
  text-align: left; cursor: pointer; transition: 0.15s;
  font-size: 13px; line-height: 1.4;
}
.model-card-mini:hover { background: rgba(255,255,255,0.08); border-color: var(--line); }
.model-card-mini.active {
  border-color: rgba(20, 200, 255, 0.6);
  background: rgba(20, 200, 255, 0.1);
}
.model-card-mini .m-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.model-card-mini .m-desc { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.m-free-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; background: rgba(54,211,153,0.15);
  color: #6ee7b7; line-height: 1.5;
}
.m-paid-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; background: rgba(255,159,67,0.15);
  color: #ffb74d; line-height: 1.5;
}

.side-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.mini-form {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  gap: 8px;
}

.usage-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.model-card {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.history-list {
  display: grid;
  max-height: 280px;
  gap: 8px;
  overflow: auto;
}

.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-item.active {
  border-color: rgba(20, 200, 255, 0.65);
}

.history-group { display: grid; gap: 6px; }
.history-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border-radius: 10px; cursor: pointer;
  background: rgba(109,93,252,0.06); border: 1px solid rgba(109,93,252,0.1);
  transition: 0.15s; user-select: none;
}
.history-group-header:hover { background: rgba(109,93,252,0.1); }
.history-group-name {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 12px; color: var(--text);
}
.history-group-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: rgba(255,255,255,0.08);
  font-size: 10px; color: var(--muted);
}
.history-group-arrow {
  color: var(--muted); font-size: 12px; transition: transform 0.2s;
}
.history-group.collapsed .history-group-arrow { transform: rotate(-90deg); }
.history-group.collapsed .history-group-items { display: none; }
.history-group-items { display: grid; gap: 6px; padding-left: 2px; }
.history-item-row { display: flex; align-items: center; gap: 4px; }
.history-item-row .history-item { flex: 1; }
.history-delete-btn { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: 0.2s; opacity: 0; }
.history-item-row:hover .history-delete-btn { opacity: 1; }
.history-delete-btn:hover { color: #d73a49; background: rgba(255,95,115,0.1); }
.history-share-btn { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: 0.2s; opacity: 0; }
.history-item-row:hover .history-share-btn { opacity: 1; }
.history-share-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* 对话历史操作按钮组 */
.pg-history-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pg-history-export,
.pg-history-share { background: none; border: none; color: var(--pg-muted,#888); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: 0.2s; opacity: 0; line-height: 1; }
.pg-history-item:hover .pg-history-export,
.pg-history-item:hover .pg-history-share { opacity: 1; }
.pg-history-export:hover,
.pg-history-share:hover { color: var(--pg-text,#fff); background: rgba(255,255,255,0.08); }

.model-card.active {
  border-color: rgba(20, 200, 255, 0.75);
  background: rgba(20, 200, 255, 0.12);
}

.model-card strong {
  display: block;
  margin-bottom: 6px;
}

.model-card span,
.empty-state span,
.message-meta,
.form-help,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.chat-panel {
  display: grid;
  min-height: 680px;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow: auto;
}

.empty-state {
  display: grid;
  height: 100%;
  min-height: 260px;
  place-content: center;
  gap: 8px;
  color: var(--text);
  text-align: center;
}

.message {
  max-width: 82%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  white-space: pre-wrap;
  line-height: 1.75;
}

.message.user {
  align-self: flex-end;
  border-color: rgba(109, 93, 252, 0.45);
  background: rgba(109, 93, 252, 0.18);
}

.message.assistant {
  align-self: flex-start;
  background: var(--surface-2);
}

.message.error {
  align-self: flex-start;
  border-color: rgba(255, 95, 115, 0.48);
  background: rgba(255, 95, 115, 0.14);
}

/* AI 思考中动画 */
.thinking-dots {
  color: var(--text-3, #888);
  font-size: 14px;
}
.thinking-dots .dot {
  animation: thinking-blink 1.4s infinite both;
  font-weight: bold;
}
.thinking-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* 思考过程 */
.reasoning-box {
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(109, 93, 252, 0.06);
  border: 1px solid rgba(109, 93, 252, 0.15);
  overflow: hidden;
}
.reasoning-box.hidden { display: none; }
.reasoning-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  user-select: none;
  transition: 0.2s;
}
.reasoning-toggle:hover { background: rgba(109, 93, 252, 0.1); }
.reasoning-box.expanded .reasoning-content { display: block; }
.reasoning-content {
  display: none;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  border-top: 1px solid rgba(109, 93, 252, 0.1);
  max-height: 300px;
  overflow-y: auto;
}
.reasoning-icon { font-size: 11px; }
.reasoning-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--primary-2);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 56px;
  max-height: 180px;
  resize: vertical;
  padding: 14px;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

select option {
  color: #111827;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 32px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.tab-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  border-color: rgba(20, 200, 255, 0.7);
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.28), rgba(20, 200, 255, 0.18));
  color: white;
  font-weight: 800;
}

.pricing-helper {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(20, 200, 255, 0.32);
  border-radius: 20px;
  background: rgba(20, 200, 255, 0.07);
}

.pricing-preview {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce3ef;
  font-size: 13px;
  line-height: 1.7;
}

.pricing-panel {
  margin-top: 22px;
  padding: 22px;
}

.plan-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.plan-card,
.stat-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.plan-price {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.stat-card strong {
  font-size: 30px;
}

.data-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  color: #dce3ef;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.admin-panel,
.form-panel {
  padding: 18px;
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-model {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.admin-model-group { display: grid; gap: 8px; }
.admin-model-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 14px; cursor: pointer;
  background: rgba(109,93,252,0.08); border: 1px solid rgba(109,93,252,0.15);
  transition: 0.15s; user-select: none;
}
.admin-model-group-header:hover { background: rgba(109,93,252,0.14); }
.admin-model-group-header .cat-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--text);
}
.admin-model-group-header .cat-count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: rgba(255,255,255,0.1);
  font-size: 11px; color: var(--muted);
}
.admin-model-group-header .cat-arrow {
  color: var(--muted); font-size: 14px; transition: transform 0.2s;
}
.admin-model-group.collapsed .cat-arrow { transform: rotate(-90deg); }
.admin-model-group.collapsed .admin-model-group-items { display: none; }
.admin-model-group-items { display: grid; gap: 12px; padding-left: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(54, 211, 153, 0.13);
  color: #a7f3d0;
  font-size: 12px;
}

.badge.off {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.model-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.model-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.model-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.form-row {
  gap: 12px;
}

.field {
  display: grid;
  flex: 1;
  gap: 7px;
}

.field label {
  color: #d9deea;
  font-size: 13px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 28px;
}

.login-card form {
  display: grid;
  gap: 14px;
}

/* ===== Toast 消息提示 ===== */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 280px;
  width: 100%;
}
.toast {
  position: relative;
  overflow: hidden;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 24, 36, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  color: var(--text);
  font-size: 13px;
  pointer-events: auto;
  transform: translateX(120%);
  animation: toast-in 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}
.toast.out {
  animation: toast-out 0.3s cubic-bezier(0.55,0,1,0.45) forwards;
}
.toast .toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 16px 16px;
  animation: toast-bar 1.8s linear forwards;
}
.toast.success .toast-bar { background: #22c55e; }
.toast.error .toast-bar { background: #ef4444; }
.toast .toast-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}
.toast .toast-close:hover { color: var(--text); }
@keyframes toast-in {
  0% { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}
@keyframes toast-bar {
  0% { width: 100%; }
  100% { width: 0%; }
}

/* ===== 模型详情弹窗 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.65); z-index: 50000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.modal-card {
  background: #121826; border-radius: 20px; width: min(480px, 100%);
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  position: relative; animation: slide-up 0.25s cubic-bezier(0.22,1,0.36,1);
}
@keyframes slide-up { 0% { transform: translateY(30px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 28px; cursor: pointer; line-height: 1; padding: 0;
  z-index: 1; transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.mdf-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 24px 24px 0; flex-wrap: wrap;
}
.mdf-header h2 { margin: 0; font-size: 20px; }
.mdf-body { padding: 20px 24px; display: grid; gap: 12px; }
.mdf-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  font-size: 14px;
}
.mdf-row .mdf-label { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.mdf-row code {
  background: rgba(255,255,255,0.08); padding: 2px 8px;
  border-radius: 6px; font-size: 12px; font-family: monospace;
}
.mdf-footer { padding: 0 24px 24px; }
.mdf-footer .button { width: 100%; }

/* ===== 模型详情按钮 ===== */
.m-detail-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: var(--muted);
  font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all 0.2s; padding: 0; line-height: 1;
}
.m-detail-btn:hover {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 12px rgba(109,93,252,0.4);
}
.model-card-mini { position: relative; padding-right: 42px; }

/* ===== 侧边栏切换按钮 ===== */
.sidebar-toggle {
  display: none; position: fixed; top: 110px; left: 12px;
  z-index: 1000; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-strong); backdrop-filter: blur(12px);
  cursor: pointer; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 0;
}
.sidebar-toggle span {
  display: block; width: 18px; height: 2px;
  border-radius: 2px; background: var(--text);
  transition: 0.2s;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  #sidebar {
    position: fixed; top: 0; left: 0; width: min(300px, 85vw);
    height: 100dvh; z-index: 2000; padding: 16px;
    border-radius: 0 24px 24px 0;
    background: var(--surface-strong); backdrop-filter: blur(20px);
    border: 1px solid var(--line); border-left: none;
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
    overflow-y: auto;
    transform: translateX(-105%);
  }
  #sidebar.open { transform: translateX(0); }

  .chat-layout {
    position: relative;
  }
  .hero-grid,
  .chat-layout,
  .admin-layout,
  .plan-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding: 28px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .nav-actions,
  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 42px;
  }
}

/* ===== 页面导航 ===== */
.main-nav { display: flex; gap: 2px; }
.nav-tab {
  background: none; border: none; padding: 8px 16px;
  font-size: 14px; color: var(--text-muted); cursor: pointer;
  border-radius: 6px; transition: all 0.2s;
}
.nav-tab:hover { color: var(--text); background: var(--surface-2); }
.nav-tab.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.page-section { min-height: calc(100vh - 60px); }

/* ============================================
   Playground 风格 + 亮色/暗色主题
   ============================================ */

/* 暗色主题（默认） */
[data-theme="dark"] {
  color-scheme: dark;
  /* 全局变量（与 :root 暗色保持一致，确保显式覆盖） */
  --bg: #080b12;
  --bg-2: #0d1220;
  --bg-3: #070911;
  --text: #f6f7fb;
  --muted: #9aa4b2;
  --line: rgba(255,255,255,0.12);
  --surface: rgba(8,11,18,0.62);
  --surface-2: rgba(255,255,255,0.08);
  --surface-strong: rgba(8,11,18,0.90);
  --panel: rgba(255,255,255,0.07);
  --panel-strong: rgba(255,255,255,0.12);
  --primary: #6d5dfc;
  --primary-2: #14c8ff;
  --shadow: 0 24px 80px rgba(0,0,0,0.35);
  --pay-card-bg: #1a1f2e;
  /* Playground 专用变量 */
  --pg-bg: #0d1117;
  --pg-sidebar: #161b22;
  --pg-sidebar-border: #30363d;
  --pg-main-bg: #0d1117;
  --pg-text: #e6edf3;
  --pg-muted: #8b949e;
  --pg-line: #30363d;
  --pg-hover: rgba(255,255,255,0.06);
  --pg-active: rgba(109,93,252,0.15);
  --pg-input-bg: #21262d;
  --pg-input-border: #30363d;
  --pg-msg-user: #1f6feb;
  --pg-msg-ai: #161b22;
  --pg-code-bg: #1e1e1e;
  --pg-code-header: #2d2d2d;
  --pg-thinking-bg: rgba(255,255,255,0.04);
  --pg-shadow: 0 8px 24px rgba(0,0,0,0.4);
  --pg-primary: #6d5dfc;
  --pg-primary-2: #14c8ff;
  --pg-overlay: rgba(0,0,0,0.5);
}

/* 亮色主题 */
[data-theme="light"] {
  color-scheme: light;
  /* 全局变量（亮色，全站统一随切换翻转） */
  --bg: #eef1f7;
  --bg-2: #f4f6fb;
  --bg-3: #e7ebf3;
  --text: #1f2328;
  --muted: #656d76;
  --line: rgba(0,0,0,0.10);
  --surface: rgba(255,255,255,0.78);
  --surface-2: rgba(0,0,0,0.05);
  --surface-strong: rgba(255,255,255,0.96);
  --panel: rgba(0,0,0,0.03);
  --panel-strong: rgba(0,0,0,0.06);
  --primary: #6d5dfc;
  --primary-2: #14c8ff;
  --shadow: 0 24px 80px rgba(0,0,0,0.10);
  --pay-card-bg: #ffffff;
  /* Playground 专用变量 */
  --pg-bg: #ffffff;
  --pg-sidebar: #f6f8fa;
  --pg-sidebar-border: #d0d7de;
  --pg-main-bg: #ffffff;
  --pg-text: #1f2328;
  --pg-muted: #656d76;
  --pg-line: #d0d7de;
  --pg-hover: rgba(0,0,0,0.04);
  --pg-active: rgba(109,93,252,0.1);
  --pg-input-bg: #f6f8fa;
  --pg-input-border: #d0d7de;
  --pg-msg-user: #0969da;
  --pg-msg-ai: #f6f8fa;
  --pg-code-bg: #f6f8fa;
  --pg-code-header: #e1e4e8;
  --pg-thinking-bg: rgba(0,0,0,0.03);
  --pg-shadow: 0 8px 24px rgba(0,0,0,0.12);
  --pg-primary: #6d5dfc;
  --pg-primary-2: #14c8ff;
  --pg-overlay: rgba(0,0,0,0.3);
}

.playground-body {
  margin: 0; padding: 0;
  background: var(--pg-bg);
  color: var(--pg-text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; height: 100vh; overflow: hidden;
  flex-direction: column;
}
/* Playground 内容区域（侧边栏 + 主区域） */
.pg-layout { display: flex; flex: 1; overflow: hidden; }
[data-theme="dark"] .playground-body { color-scheme: dark; }
[data-theme="light"] .playground-body { color-scheme: light; }

/* ===== 统一导航栏（所有页面共用） ===== */
.home-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--pg-line, var(--line));
  background: var(--pg-main-bg, var(--bg));
  position: sticky; top: 0; z-index: 90;
}
.home-nav .brand {
  display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px;
  color: var(--pg-text, var(--text));
}
.home-nav .brand-mark {
  display: grid; width: 23px; height: 23px; place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--pg-primary, #6d5dfc), var(--pg-primary-2, #14c8ff));
  color: #fff; font-size: 10px;
}
.home-nav-links { display: flex; gap: 2px; align-items: center; }
.home-nav-links a {
  padding: 4px 9px; border-radius: 7px; font-size: 12px; font-weight: 500;
  color: var(--pg-muted, var(--muted)); transition: 0.2s;
}
.home-nav-links a:hover { color: var(--pg-text, var(--text)); background: var(--pg-hover, rgba(255,255,255,0.06)); }
.home-nav-links a.active {
  color: var(--pg-text, var(--text)); background: var(--pg-active, rgba(109,93,252,0.15)); font-weight: 600;
}
.home-nav-right { display: flex; align-items: center; gap: 5px; }
.home-nav-left { display: flex; align-items: center; gap: 12px; }

.playground-body .home-nav {
  position: static; flex-shrink: 0;
}

@media (max-width: 768px) {
  .home-nav-links a { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .home-nav { padding: 8px 14px; flex-wrap: wrap; gap: 10px; }
  .home-nav-right { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .home-nav-links { order: 3; width: 100%; justify-content: center; margin-top: 6px; }
  .home-nav-links a { padding: 5px 12px; font-size: 13px; }
}

/* Playground 布局 */
.pg-sidebar {
  width: 280px; min-width: 280px;
  background: var(--pg-sidebar);
  border-right: 1px solid var(--pg-sidebar-border);
  display: flex; flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}
.pg-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--pg-sidebar-border);
}
.pg-sidebar-title { font-size: 15px; font-weight: 700; color: var(--pg-text); }
.pg-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--pg-text); }
.pg-brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--pg-primary), var(--pg-primary-2)); color: #fff; font-size: 13px; }
.pg-icon-btn { background: none; border: none; color: var(--pg-muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; transition: 0.2s; }
.pg-icon-btn:hover { color: var(--pg-text); background: var(--pg-hover); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.pg-new-chat-btn {
  margin: 12px 16px; padding: 10px 16px;
  border: 1px solid var(--pg-line); border-radius: 10px;
  background: var(--pg-hover); color: var(--pg-text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: 0.2s;
}
.pg-new-chat-btn:hover { background: var(--pg-active); border-color: var(--pg-primary); }

.pg-sidebar-section { flex: 1; overflow-y: auto; padding: 0 12px; }
.pg-sidebar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pg-muted); padding: 8px 8px 4px; font-weight: 600; }
.pg-history-list { display: flex; flex-direction: column; gap: 2px; }
.pg-history-title { font-size: 13px; font-weight: 500; color: var(--pg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-history-meta { font-size: 11px; color: var(--pg-muted); margin-top: 2px; }

/* 用户信息 */
.pg-sidebar-footer { padding: 16px; border-top: 1px solid var(--pg-sidebar-border); }
.pg-user-info { display: flex; flex-direction: column; gap: 8px; }
.pg-user-email { font-size: 13px; color: var(--pg-text); font-weight: 500; }
.pg-usage-bar-wrap { display: flex; flex-direction: column; gap: 4px; }
.pg-usage-bar { height: 6px; border-radius: 3px; background: var(--pg-line); overflow: hidden; }
.pg-usage-bar span { display: block; height: 100%; border-radius: 3px; background: var(--pg-primary); transition: width 0.4s; }
.pg-usage-bar span.mid { background: #f0ad4e; }
.pg-usage-bar span.over { background: #d73a49; }
.pg-usage-text { font-size: 11px; color: var(--pg-muted); }
.pg-logout-btn { background: none; border: 1px solid var(--pg-line); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: var(--pg-muted); cursor: pointer; transition: 0.2s; }
.pg-logout-btn:hover { color: #d73a49; border-color: #d73a49; }
.pg-not-logged { text-align: center; padding: 8px; }
.pg-login-link { color: var(--pg-primary); font-size: 14px; font-weight: 600; }

/* 主区域 */
.pg-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--pg-main-bg); position: relative; }
.pg-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--pg-line);
  background: var(--pg-main-bg);
}
.pg-topbar-title { font-size: 16px; font-weight: 700; margin: 0; flex: 1; }
.pg-topbar-actions { display: flex; gap: 8px; align-items: center; }
.pg-nav-link { font-size: 13px; color: var(--pg-muted); padding: 6px 12px; border-radius: 8px; transition: 0.2s; }
.pg-nav-link:hover { color: var(--pg-text); background: var(--pg-hover); }
.pg-download { color: var(--pg-primary); font-weight: 600; }

/* 消息区域 */
.pg-messages { flex: 1; overflow-y: auto; padding: 20px 0; }
.pg-empty-state { text-align: center; padding: 80px 20px; color: var(--pg-muted); }
.pg-empty-icon { font-size: 48px; margin-bottom: 16px; }
.pg-empty-state h2 { font-size: 22px; color: var(--pg-text); margin: 0 0 8px; }
.pg-empty-state p { font-size: 14px; }

.pg-msg { display: flex; gap: 12px; max-width: 820px; margin: 0 auto 24px; padding: 0 20px; }
.pg-msg.user { justify-content: flex-end; }
.pg-msg-bubble { background: var(--pg-msg-user); color: #fff; padding: 10px 16px; border-radius: 16px 16px 4px 16px; max-width: 70%; font-size: 14px; line-height: 1.6; word-break: break-word; }
[data-theme="light"] .pg-msg-bubble { color: #fff; }
.pg-msg-image { max-width: 200px; max-height: 150px; border-radius: 10px; margin-bottom: 4px; }
.pg-msg-avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--pg-primary), var(--pg-primary-2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.pg-msg-body { flex: 1; min-width: 0; }
.pg-msg-model { font-size: 12px; color: var(--pg-muted); margin-bottom: 4px; }
.pg-msg-content { font-size: 14px; line-height: 1.7; color: var(--pg-text); word-break: break-word; }
.pg-msg-content p { margin: 0 0 8px; }
.pg-msg-content p:last-child { margin-bottom: 0; }
.pg-msg-content ul, .pg-msg-content ol { margin: 0 0 8px; padding-left: 20px; }
.pg-msg-content li { margin-bottom: 2px; }
.pg-msg-content a { color: var(--pg-primary-2); text-decoration: underline; }
.pg-msg-content table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.pg-msg-content th, .pg-msg-content td { border: 1px solid var(--pg-line); padding: 6px 10px; text-align: left; font-size: 13px; }
.pg-msg-content th { background: var(--pg-hover); font-weight: 600; }
.pg-msg-content blockquote { border-left: 3px solid var(--pg-primary); margin: 8px 0; padding: 4px 12px; color: var(--pg-muted); }
.pg-msg-content code:not(.hljs) { background: var(--pg-hover); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: "JetBrains Mono","Fira Code","Consolas",monospace; }
.pg-msg-content h1, .pg-msg-content h2, .pg-msg-content h3, .pg-msg-content h4 { margin: 12px 0 6px; line-height: 1.3; }
.pg-msg-content h1 { font-size: 20px; }
.pg-msg-content h2 { font-size: 17px; }
.pg-msg-content h3 { font-size: 15px; }
.pg-msg-content hr { border: none; border-top: 1px solid var(--pg-line); margin: 12px 0; }
.pg-msg-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.pg-msg-meta { font-size: 11px; color: var(--pg-muted); margin-top: 6px; }
/* 上传图片/文件「还有多久自动删除」标注 */
.pg-upload-expire { font-size: 11px; color: var(--pg-muted); margin: -2px 0 8px; display: flex; align-items: center; gap: 4px; opacity: .85; }
.pg-msg-image + .pg-upload-expire { margin-top: -2px; }
.pg-upload-expire.pending { opacity: .55; }
.pg-typing { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.pg-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--pg-muted); display: inline-block; animation: pg-typing 1.2s infinite ease-in-out both; }
.pg-typing i:nth-child(2) { animation-delay: .2s; }
.pg-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pg-typing { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 思考过程 */
.pg-thinking { margin-bottom: 8px; border-left: 3px solid var(--pg-primary); border-radius: 0 8px 8px 0; background: var(--pg-thinking-bg); }
.pg-thinking summary { padding: 8px 12px; font-size: 13px; color: var(--pg-muted); cursor: pointer; user-select: none; }
.pg-thinking summary:hover { color: var(--pg-text); }
.pg-thinking-content { padding: 8px 12px; font-size: 13px; color: var(--pg-muted); font-style: italic; line-height: 1.6; white-space: pre-wrap; }

/* 代码块 */
.code-block { margin: 12px 0; border-radius: 10px; overflow: hidden; background: var(--pg-code-bg); border: 1px solid var(--pg-line); box-shadow: 0 2px 10px rgba(0,0,0,0.18); }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px 7px 14px; background: var(--pg-code-header); border-bottom: 1px solid var(--pg-line); }
.code-lang { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pg-muted); background: rgba(127,127,127,0.18); padding: 3px 10px; border-radius: 999px; }
.code-copy { background: rgba(127,127,127,0.10); border: 1px solid var(--pg-line); color: var(--pg-text); font-size: 12px; cursor: pointer; padding: 4px 12px; border-radius: 999px; transition: 0.2s; }
.code-copy:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.code-body { display: flex; overflow-x: auto; }
.code-lines { display: flex; flex-direction: column; padding: 12px 0; background: rgba(0,0,0,0.15); min-width: 44px; text-align: right; user-select: none; border-right: 1px solid var(--pg-line); }
.code-lines span { padding: 0 10px 0 6px; font-family: "JetBrains Mono","Fira Code","Consolas",monospace; font-size: 12px; line-height: 1.55; color: var(--pg-muted); }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; flex: 1; }
.code-block code { font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; font-size: 13px; line-height: 1.6; }

/* KaTeX 数学公式 - 暗色模式适配 */
.katex { font-size: 1.05em; color: var(--pg-text); }
.katex-display { margin: 10px 0; overflow-x: auto; padding: 8px 0; }
[data-theme="dark"] .katex { color: #e4e4e7; }
[data-theme="dark"] .katex .mord, [data-theme="dark"] .katex .mbin, [data-theme="dark"] .katex .mrel, [data-theme="dark"] .katex .mopen, [data-theme="dark"] .katex .mclose, [data-theme="dark"] .katex .mpunct, [data-theme="dark"] .katex .minner { color: #e4e4e7; }
[data-theme="dark"] .katex .mord .it { color: #a78bfa; } /* 变量/符号 */
[data-theme="dark"] .katex .mord .textbf { color: #f472b6; } /* 加粗 */
[data-theme="dark"] .katex .msupsub .vlist-t { color: #67e8f9; } /* 上标下标 */
[data-theme="dark"] .katex .frac-line { border-top-color: #52525b; } /* 分数线 */
[data-theme="dark"] .katex .sqrt > .root { margin-left: 0.15em; }

/* AI消息操作按钮 */
.pg-msg-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.pg-msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.pg-msg.assistant:hover .pg-msg-actions { opacity: 1; }
.pg-msg-btn { background: none; border: 1px solid var(--pg-line); color: var(--pg-muted); font-size: 13px; cursor: pointer; padding: 2px 8px; border-radius: 6px; transition: 0.2s; }
.pg-msg-btn:hover { color: var(--pg-text); background: var(--pg-hover); border-color: var(--pg-muted); }

/* 对话管理 */
.pg-history-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.pg-history-item:hover { background: var(--pg-hover); }
.pg-history-item.active { background: var(--pg-active); }
.pg-history-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pg-history-text { flex: 1; min-width: 0; }
.pg-history-del { background: none; border: none; color: var(--pg-muted); font-size: 12px; cursor: pointer; padding: 4px; border-radius: 4px; transition: 0.2s; flex-shrink: 0; }
.pg-history-del:hover { color: var(--pg-text); background: var(--pg-hover); }
.pg-history-title { font-size: 13px; font-weight: 500; color: var(--pg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-history-meta { font-size: 11px; color: var(--pg-muted); margin-top: 2px; }
.pg-btn { background: var(--pg-hover); border: 1px solid var(--pg-line); color: var(--pg-text); font-size: 13px; cursor: pointer; padding: 8px 14px; border-radius: 8px; transition: 0.2s; }
.pg-btn:hover { background: var(--pg-active); }
.pg-btn-primary { background: var(--pg-primary); border: 1px solid var(--pg-primary); color: #fff; font-size: 13px; cursor: pointer; padding: 8px 14px; border-radius: 8px; transition: 0.2s; }
.pg-btn-primary:hover { filter: brightness(1.08); }

/* 输入区域 */
.pg-composer-wrap { padding: 12px 20px 20px; }
.pg-composer {
  max-width: 820px; margin: 0 auto;
  background: var(--pg-input-bg); border: 1px solid var(--pg-input-border);
  border-radius: 16px; box-shadow: var(--pg-shadow); overflow: hidden;
}
.pg-file-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--pg-line); font-size: 13px; }
.pg-file-preview img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.pg-file-preview .file-name { flex: 1; color: var(--pg-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-file-preview .file-remove { cursor: pointer; color: var(--pg-muted); padding: 2px 6px; }
.pg-file-preview .file-remove:hover { color: #d73a49; }
.pg-input {
  width: 100%; border: none; outline: none; resize: none;
  background: transparent; color: var(--pg-text);
  padding: 14px 16px 4px; font-size: 14px; line-height: 1.5;
  min-height: 24px; max-height: 200px;
}
.pg-input::placeholder { color: var(--pg-muted); }
.pg-composer-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.pg-composer-left, .pg-composer-right { display: flex; align-items: center; gap: 4px; }
.pg-tool-btn { background: none; border: none; color: var(--pg-muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; transition: 0.2s; }
.pg-tool-btn:hover { color: var(--pg-text); background: var(--pg-hover); }

/* 对话设置按钮 */
.pg-settings-label { white-space: nowrap; font-size: 12px; font-weight: 600; }
@media(max-width:600px){ .pg-settings-label { display: none; } }

/* 对话设置弹窗 */
.setting-group { margin-bottom: 18px; }
.setting-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--pg-text); margin-bottom: 10px; }
.setting-title span { font-size: 15px; }
.setting-options { display: flex; flex-wrap: wrap; gap: 8px; }
.setting-option {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--pg-hover); color: var(--pg-muted); font-size: 13px; cursor: pointer;
  transition: all .15s; user-select: none;
}
.setting-option:hover { color: var(--pg-text); border-color: var(--pg-primary, #6d5dfc); }
.setting-option.selected {
  background: rgba(109,93,252,.18); color: #a78bfa; border-color: rgba(109,93,252,.6); font-weight: 600;
}
.setting-hint { font-size: 12px; color: var(--pg-muted); opacity: .8; margin: 14px 0 0; line-height: 1.5; }
.pg-announcement-btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--pg-muted); }
.pg-announcement-btn.ghost:hover { color: var(--pg-text); opacity: 1; }

/* 联网搜索按钮样式 */
.pg-websearch-toggle[data-enabled="true"] { color: #22c55e; }
.pg-websearch-toggle[data-enabled="true"] svg { stroke: #22c55e; }
.pg-websearch-label { font-size: 11px; font-weight: 500; }
.pg-websearch-toggle[data-enabled="true"] .pg-websearch-label { color: #22c55e; }

.pg-model-selector { display: flex; align-items: center; gap: 4px; background: var(--pg-hover); border: 1px solid var(--pg-line); border-radius: 8px; padding: 6px 12px; color: var(--pg-text); font-size: 13px; cursor: pointer; transition: 0.2s; }
.pg-model-selector:hover { background: var(--pg-active); }
.pg-send-btn { background: var(--pg-primary); border: none; color: #fff; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: 0.2s; }
.pg-send-btn:hover:not(:disabled) { background: var(--pg-primary-2); }
.pg-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-send-btn.stop-mode { background: #ef4444; }
.pg-send-btn.stop-mode:hover { background: #dc2626; }

/* 模型选择浮层 */
.pg-model-panel {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 40px)); max-height: 520px;
  background: var(--pg-sidebar); border: 1px solid var(--pg-line);
  border-radius: 16px; box-shadow: var(--pg-shadow); z-index: 200;
  display: flex; flex-direction: column; overflow: hidden;
}
.pg-model-panel.hidden { display: none; }
.pg-model-panel-header { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--pg-line); }
.pg-model-search { flex: 1; background: var(--pg-input-bg); border: 1px solid var(--pg-input-border); border-radius: 8px; padding: 8px 12px; color: var(--pg-text); font-size: 13px; outline: none; }
.pg-model-list { overflow-y: auto; padding: 8px; }
.pg-model-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px; border: none; background: none; border-radius: 8px; cursor: pointer; transition: 0.2s; text-align: left; }
.pg-model-item:hover { background: var(--pg-hover); }
.pg-model-item.active { background: var(--pg-active); }
.pg-model-icon { width: 26px; height: 26px; min-width: 26px; border-radius: 7px; background: var(--pg-hover); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--pg-text); }
.pg-model-logo { width: 26px; height: 26px; min-width: 26px; border-radius: 7px; object-fit: contain; background: var(--pg-hover); padding: 4px; box-sizing: border-box; }
.pg-mini-logo { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; vertical-align: -4px; background: var(--pg-hover); padding: 2px; box-sizing: border-box; }
.pg-msg-avatar-logo { width: 100%; height: 100%; border-radius: 8px; object-fit: contain; }
.pg-model-item div { flex: 1; min-width: 0; }
.pg-model-item strong { display: block; font-size: 13.5px; line-height: 1.35; color: var(--pg-text); }
.pg-model-disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); }
.pg-model-disabled:hover { background: none; border-color: var(--pg-line); }
.pg-model-disabled .pg-model-dot { box-shadow: 0 0 0 2px rgba(239,68,68,0.20); }
.pg-model-item span { display: block; font-size: 11.5px; line-height: 1.35; color: var(--pg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 模型状态指示点 */
.pg-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pg-status-green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.20); }
.pg-status-red { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.20); }
.pg-status-gray { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.20); }

/* 禁用模型样式 - 变淡显示但仍可点击选择 */
.pg-model-row.pg-disabled { opacity: 0.55; }
.pg-model-row.pg-disabled .pg-model-item { cursor: pointer; }
.pg-model-row.pg-disabled .pg-model-item strong { opacity: 0.6; }

/* 推荐模型 */
.pg-model-rec-title { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--pg-text); display: flex; align-items: center; gap: 6px; }
.pg-model-rec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px 8px; }
.pg-model-rec { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--pg-line); border-radius: 12px; background: rgba(109,93,252,0.06); cursor: pointer; text-align: left; transition: 0.2s; }
.pg-model-rec:hover { background: var(--pg-hover); border-color: var(--pg-active); }
.pg-model-rec.active { background: var(--pg-active); border-color: var(--primary); }
.pg-model-rec div { flex: 1; min-width: 0; }
.pg-model-rec strong { display: block; font-size: 12px; color: var(--pg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-model-rec span { display: block; font-size: 11px; color: var(--pg-muted); }
.pg-model-provider { display: inline-block !important; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--pg-hover); color: var(--pg-muted); font-size: 10px !important; line-height: 1.6; }
.pg-free-badge { position: absolute; top: 6px; right: 6px; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 700; }

/* 模型能力标签 + 联网搜索徽标 */
.pg-model-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.pg-model-tag { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 9px; line-height: 1.5; color: var(--pg-text); background: rgba(109,93,252,0.14); border: 1px solid rgba(109,93,252,0.28); }
.pg-web-badge { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 9px; line-height: 1.5; font-weight: 600; color: #fff; background: linear-gradient(135deg, #11998e, #38ef7d); }
.pg-detail-row .pg-model-tags { justify-content: flex-end; }

/* 模型详情按钮 */
.pg-model-detail-btn { flex-shrink: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 13px; color: var(--pg-muted); cursor: pointer; transition: 0.2s; margin-left: 4px; }
.pg-model-detail-btn:hover { background: var(--pg-active); color: var(--primary); }
.pg-model-rec { position: relative; }
.pg-model-rec .pg-model-detail-btn { position: absolute; right: 8px; bottom: 8px; margin: 0; }

/* 模型详情模态框 */
.pg-detail-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--pg-line); font-size: 14px; }
.pg-detail-row:last-of-type { border-bottom: none; }
.pg-detail-label { flex-shrink: 0; width: 64px; color: var(--pg-muted); font-size: 13px; }

/* 模型分类折叠 */
.pg-model-group { margin-bottom: 2px; }
.pg-model-group-header { display: flex; align-items: center; gap: 6px; padding: 7px 12px; margin: 2px 6px 1px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--pg-muted); cursor: pointer; user-select: none; background: var(--pg-hover); transition: 0.2s; }
.pg-model-group-header:hover { color: var(--pg-text); background: var(--pg-active); }
.pg-model-group-header.collapsed .arrow { transform: rotate(-90deg); }
.pg-model-group-header .arrow { transition: transform 0.2s; }
.pg-model-count { margin-left: auto; font-size: 11px; opacity: 0.7; background: rgba(127,127,127,0.18); padding: 1px 8px; border-radius: 999px; }
.pg-model-group-body { display: flex; flex-direction: column; gap: 3px; max-height: none; opacity: 1; overflow: hidden; transition: max-height 0.35s ease, opacity 0.25s ease, gap 0.25s ease, padding 0.25s ease; }
.pg-model-group-body.hidden { max-height: 0; opacity: 0; padding: 0; margin: 0; gap: 0; overflow: hidden; display: flex !important; }

/* 模型行：包含模型按钮 + 详情按钮 */
.pg-model-row { display: flex; align-items: center; gap: 0; border-radius: 8px; transition: 0.15s; }
.pg-model-row.active { background: var(--pg-active); }
.pg-model-row .pg-model-item { flex: 1; min-width: 0; border-radius: 8px; }
.pg-model-row.active .pg-model-item { background: transparent; }
.pg-model-detail-btn { flex-shrink: 0; width: 26px; height: 26px; border: none; background: none; border-radius: 50%; color: var(--pg-muted); cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center; transition: 0.15s; opacity: 0.55; }
.pg-model-row:hover .pg-model-detail-btn { opacity: 0.85; }
.pg-model-detail-btn:hover { opacity: 1 !important; background: var(--pg-hover); color: var(--primary-2); }

/* 模型 logo SVG */
.pg-model-logo-svg { flex-shrink: 0; }

/* 模型详情弹窗 */
.pg-detail-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99998; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.pg-detail-modal.hidden { display: none !important; }
.pg-detail-card { background: rgba(20,24,36,0.97); border: 1px solid var(--line); border-radius: 18px; width: min(400px, calc(100% - 32px)); max-height: 80vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.5); position: relative; }
.pg-detail-card-header { position: absolute; top: 10px; right: 12px; z-index: 1; }
.pg-detail-close { font-size: 22px; cursor: pointer; color: var(--pg-muted); line-height: 1; user-select: none; }
.pg-detail-close:hover { color: var(--text); }
.pg-detail-header { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.pg-detail-logo { width: 44px; height: 44px; min-width: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: white; }
.pg-detail-title-block { flex: 1; min-width: 0; }
.pg-detail-name { font-size: 16px; font-weight: 700; color: var(--text); }
.pg-detail-provider { font-size: 11px; color: var(--pg-muted); margin-top: 2px; }
.pg-detail-desc { padding: 0 20px 12px; font-size: 12.5px; color: var(--pg-muted); line-height: 1.5; }
.pg-detail-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 20px 14px; }
.pg-detail-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; color: var(--text); background: rgba(109,93,252,0.14); border: 1px solid rgba(109,93,252,0.28); }
.pg-detail-web { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #11998e, #38ef7d); }
.pg-detail-think { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #6d5dfc, #a78bfa); }
.pg-detail-empty { font-size: 11px; color: var(--pg-muted); }
.pg-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 20px 20px; background: var(--line); border-radius: 12px; overflow: hidden; }
.pg-detail-cell { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: rgba(255,255,255,0.03); }
.pg-detail-label { font-size: 10px; color: var(--pg-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pg-detail-value { font-size: 13px; font-weight: 600; color: var(--text); }
.pg-detail-free { color: #36d399; }
.pg-detail-ok { color: #36d399; }
.pg-detail-err { color: #ff5f73; font-size: 11px; }

/* 遮罩 */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: var(--pg-overlay); z-index: 99; }
.sidebar-overlay.show { display: block; }
.hidden { display: none !important; }

/* 折叠栏按钮（左上角，桌面/移动均可见） */
.sidebar-toggle-btn { display: grid; }
/* 桌面端折叠侧边栏 */
@media (min-width: 769px) {
  .pg-layout.sidebar-collapsed .pg-sidebar { display: none; }
}
@media (max-width: 768px) {
  .pg-sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 100; transform: translateX(-100%); }
  .pg-sidebar.open { transform: translateX(0); }
  #sidebarClose { display: grid !important; }
  .pg-topbar-actions .pg-nav-link:not(.pg-download) { display: none; }
  .pg-msg { padding: 0 12px; }
  .pg-composer-wrap { padding: 8px 12px 12px; }
}

/* 支付方式弹窗 */
.pay-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.pay-modal-card {
  background: var(--pay-card-bg); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; width: min(380px, calc(100% - 32px));
  position: relative; box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.pay-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 4px;
}
.pay-modal-close:hover { color: var(--text); }
.pay-modal-title { font-size: 20px; font-weight: 700; margin: 0 0 20px; color: var(--text); text-align: center; }
.pay-options { display: flex; gap: 12px; margin-bottom: 20px; }
.pay-option {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border: 2px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.03);
}
.pay-option:hover { border-color: rgba(109,93,252,0.5); background: rgba(255,255,255,0.06); }
.pay-option.selected { border-color: var(--primary); background: rgba(109,93,252,0.12); }
.pay-option-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 11px; }
.pay-option-icon svg { width: 40px; height: 40px; display: block; }
.pay-option-name { font-size: 14px; font-weight: 600; color: var(--text); }

/* ===== 后台 UI 专业优化 ===== */

/* 统计卡片增强 */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card strong {
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 数据表格增强 */
.data-table {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.data-table thead { background: rgba(255,255,255,0.04); }
.data-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11.5px;
  white-space: nowrap;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: rgba(109,93,252,0.08);
}
.data-table td {
  vertical-align: middle;
}

/* 表单增强 */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109,93,252,0.15);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.5; }

/* 按钮统一 */
.button {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  border: 1px solid transparent;
  outline: none;
}
.button.primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  box-shadow: 0 2px 12px rgba(109,93,252,0.3);
}
.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(109,93,252,0.4);
}
.button.ghost {
  background: rgba(255,255,255,0.06);
  border-color: var(--line);
  color: var(--text);
}
.button.ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
}

/* Tab 栏优化 */
.admin-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-button {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s;
}
.tab-button:not(.active):hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* 面板区域过渡 */
.admin-tab-section {
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 管理面板卡片 */
.admin-model {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.admin-model:hover {
  border-color: rgba(109,93,252,0.35);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0a0d1a 0%, #111827 50%, #0f172a 100%);
}
.login-card {
  width: min(400px, calc(100% - 40px));
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
}
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card h1 {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.login-card form { margin-top: 24px; }

/* 顶部导航 */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
}

/* 响应式 */
@media (max-width: 768px) {
  .admin-tabs { gap: 6px; padding: 8px; border-radius: 16px; }
  .tab-button { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  .admin-panel, .form-panel { padding: 14px; }
  .pricing-panel { padding: 16px; }
}

/* ============================================================
   吾爱AI · 精致化视觉升级 (Premium Polish)
   在暗色玻璃拟态基调上提升质感、层次与微交互。
   ============================================================ */
:root {
  --accent: #14c8ff;
  --accent-2: #6d5dfc;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.25s var(--ease);
}

/* 全局质感：自定义滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(20,200,255,0.4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(20,200,255,0.55), rgba(109,93,252,0.55));
  border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(20,200,255,0.85), rgba(109,93,252,0.85)); background-clip: padding-box; }
::selection { background: rgba(20,200,255,0.32); color: #fff; }

/* 背景层次增强：多层柔光 */
body {
  background:
    radial-gradient(1000px 620px at 10% -8%, rgba(109,93,252,0.26), transparent 60%),
    radial-gradient(900px 600px at 102% 2%, rgba(20,200,255,0.22), transparent 55%),
    radial-gradient(700px 520px at 48% 118%, rgba(168,85,247,0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%, var(--bg-3) 100%);
}

/* 玻璃面板内高光 */
.topbar, .hero-grid, .chat-layout, .admin-layout, .login-card, .admin-tabs,
.model-panel, .chat-panel, .pricing-panel, .admin-panel, .form-panel, .side-card {
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 24px 70px -32px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(22px) saturate(125%);
}

/* 通用卡片光泽与悬浮 */
.metric, .model-card, .plan-card, .stat-card, .admin-model, .side-card,
.history-item, .model-card-mini {
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background var(--t);
}
.metric:hover, .model-card:hover, .plan-card:hover, .stat-card:hover,
.admin-model:hover, .side-card:hover, .history-item:hover, .model-card-mini:hover {
  transform: translateY(-3px);
  border-color: rgba(20,200,255,0.42);
  box-shadow: 0 20px 54px -24px rgba(20,200,255,0.5);
}

/* 按钮精致化 */
.button {
  position: relative; overflow: hidden;
  border-radius: 999px; letter-spacing: 0.01em;
  box-shadow: 0 8px 24px -10px rgba(109,93,252,0.55);
  transition: transform var(--t), box-shadow var(--t), filter var(--t);
}
.button::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.28), transparent 42%);
  opacity: 0; transition: opacity var(--t); pointer-events: none;
}
.button:hover::after { opacity: 1; }
.button:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(20,200,255,0.6); }
.button:active { transform: translateY(1px) scale(0.99); }
.button.primary { box-shadow: 0 12px 34px -12px rgba(20,200,255,0.6); }

/* 输入框聚焦光环 */
.model-search:focus,
input:focus, textarea:focus, select:focus {
  border-color: rgba(20,200,255,0.7) !important;
  box-shadow: 0 0 0 3px rgba(20,200,255,0.18) !important;
  outline: none;
}

/* 表格精致化（后台 + 用户中心） */
.data-table, .credit-logs-table {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.data-table thead, .credit-logs-table thead { background: rgba(255,255,255,0.05); }
.data-table tbody tr:hover, .credit-logs-table tbody tr:hover { background: rgba(20,200,255,0.07); }

/* 入场动画 */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero-grid, .chat-layout, .admin-layout, .pricing-panel, .admin-panel, .form-panel,
.metric, .stat-card, .plan-card, .login-card {
  animation: panelIn 0.5s var(--ease) both;
}

/* 弹窗光泽 */
.modal-card, .pay-modal-card {
  box-shadow: 0 30px 90px -30px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.07);
}

/* 大标题渐变强调 */
.hero-grid h1 {
  background: linear-gradient(120deg, #ffffff 0%, #cfe9ff 48%, #c4b5ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== 公告弹窗 ===== */
.pg-announcement-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.pg-announcement-modal.hidden { display: none !important; }
.pg-announcement-card { background: rgba(20,24,36,0.98); border: 1px solid var(--line); border-radius: 18px; width: min(440px, calc(100% - 32px)); max-height: 80vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.pg-announcement-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.pg-announcement-title { font-size: 17px; font-weight: 700; color: var(--text); }
.pg-announcement-close { font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; user-select: none; padding: 0 4px; }
.pg-announcement-close:hover { color: var(--text); }
.pg-announcement-content { padding: 16px 20px; font-size: 14px; color: var(--text); line-height: 1.65; }
.pg-announcement-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 18px; gap: 12px; }
.pg-announcement-today { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.pg-announcement-today input { width: 16px; height: 16px; cursor: pointer; }
.pg-announcement-btn { padding: 8px 20px; border-radius: 10px; border: none; background: var(--primary-2, #6d5dfc); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.15s; }
.pg-announcement-btn:hover { opacity: 0.88; }
.pg-announcement-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 反馈表单 ===== */
.pg-feedback-select { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; }
.pg-feedback-textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; resize: vertical; font-family: inherit; }
.pg-feedback-textarea:focus { outline: none; border-color: var(--primary-2, #6d5dfc); }
.pg-feedback-input { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; margin-top: 10px; }
.pg-feedback-input:focus { outline: none; border-color: var(--primary-2, #6d5dfc); }

/* ===== 反馈浮动按钮 ===== */
.pg-feedback-fab { position: fixed; right: 20px; bottom: 80px; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--primary-2, #6d5dfc); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(109,93,252,0.4); z-index: 9990; transition: all 0.2s; }
.pg-feedback-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(109,93,252,0.55); }
.pg-feedback-fab:active { transform: scale(0.95); }
@media(max-width: 600px) { .pg-feedback-fab { right: 14px; bottom: 70px; width: 42px; height: 42px; } }

/* ===== 后台公告管理 ===== */
.admin-announcement-form textarea { width: 100%; min-height: 80px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font-size: 14px; resize: vertical; font-family: inherit; }

/* ===== 后台反馈列表 ===== */
.feedback-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.feedback-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.feedback-item-type { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.feedback-item-type.suggestion { background: rgba(109,93,252,0.15); color: #a78bfa; }
.feedback-item-type.bug { background: rgba(239,68,68,0.15); color: #f87171; }
.feedback-item-type.other { background: rgba(100,116,139,0.15); color: #94a3b8; }
.feedback-item-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.feedback-item-status.pending { background: rgba(245,158,11,0.15); color: #fbbf24; }
.feedback-item-status.resolved { background: rgba(34,197,94,0.15); color: #4ade80; }
.feedback-item-status.ignored { background: rgba(100,116,139,0.15); color: #94a3b8; }
.feedback-item-content { font-size: 13.5px; color: var(--text); line-height: 1.55; margin: 6px 0; }
.feedback-item-meta { font-size: 11px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 联网搜索展示块（仿豆包：展示搜索词与来源） ===== */
.pg-websearch { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); font-size: 13px; overflow: hidden; }
.pg-websearch-head { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; list-style: none; user-select: none; }
.pg-websearch-head::-webkit-details-marker { display: none; }
.pg-websearch-head .pg-ws-caret { margin-left: auto; font-size: 11px; opacity: .6; transition: transform .2s; }
.pg-websearch[open] .pg-ws-caret { transform: rotate(90deg); }
.pg-websearch-body { padding: 0 12px 12px; }
.pg-websearch-icon { font-size: 14px; }
.pg-websearch-title { color: var(--muted); }
.pg-websearch-q { color: var(--primary-2); font-weight: 600; word-break: break-word; }
.pg-websearch-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-websearch-item { display: flex; flex-direction: column; gap: 2px; }
.pg-websearch-link { color: var(--primary-2); text-decoration: none; font-weight: 500; line-height: 1.4; word-break: break-word; }
.pg-websearch-link:hover { text-decoration: underline; }
.pg-websearch-snippet { color: var(--muted); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-websearch-loading { margin-top: 8px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pg-spinner { width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; display: inline-block; animation: pg-spin 0.8s linear infinite; }
@keyframes pg-spin { to { transform: rotate(360deg); } }

