/* ===================== 基础变量 ===================== */
:root {
  --bg-side: #f5f6f8;
  --bg-main: #ffffff;
  --border: #e6e7eb;
  --border-strong: #d6d8dd;
  --text: #1f2329;
  --text-sub: #6b7280;
  --text-muted: #9aa0a6;
  --primary: #ff6a1a;
  --primary-soft: #fff1e8;
  --green: #22c55e;
  --hover: #eef0f3;
  --active: #e8eaef;
  --chip-bg: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

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

.hidden { display: none !important; }

/* ===================== 整体布局 ===================== */
.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ===================== 左侧侧边栏 ===================== */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 8px 8px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  padding: 8px 12px 14px;
  letter-spacing: 0.2px;
}

.nav { flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  margin: 1px 0;
  cursor: pointer;
}
.nav-item:hover { background: var(--hover); }

.nav-item .ic {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
}

.nav-new { color: var(--text); font-weight: 500; }

.nav-group { margin-top: 4px; }
.nav-sub {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  margin: 2px 0 6px;
}
.nav-sub a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}
.nav-sub a:hover { background: var(--hover); }
.nav-sub .ic { width: 18px; text-align: center; color: var(--text-sub); font-size: 13px; }

.nav-section { margin-top: 10px; }
.nav-section-title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}
.nav-section-title .caret {
  width: 16px;
  height: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.nav-section-title .caret .caret-ic {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform 180ms ease;
}
/* 折叠态：箭头从「向下 ⌄」旋转到「向右 ›」 */
.nav-section-title.is-collapsed .caret .caret-ic {
  transform: rotate(-90deg);
}
.nav-section-title .section-ic {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
}
.nav-section-title.is-clickable {
  border-radius: 6px;
  margin: 0 4px;
  padding: 6px 8px;
  transition: background 140ms ease, color 140ms ease;
}
.nav-section-title.is-clickable:hover { background: var(--hover); color: var(--text); }
.nav-section-title.is-clickable.is-active {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}
.nav-section-title.is-clickable.is-active .section-ic { color: var(--text); }
.nav-section-title .section-ic svg {
  width: 14px;
  height: 14px;
  display: block;
}
.nav-section-title .badge {
  margin-left: 4px;
  font-size: 10px;
  background: #eaeaea;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-sub);
}

.nav-section-body { display: flex; flex-direction: column; }

/* 会话列表项 */
.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  position: relative;
}
.session-item:hover { background: var(--hover); }
.session-item.active { background: var(--active); }

.session-item .session-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 9px;
}
.session-item .session-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-item .unread {
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

/* 父级会话标题（如 "国际站生意助手"） */
.session-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.session-parent:hover { background: var(--hover); }
.session-parent .session-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 父级未读小红标：圆形、轻微上浮、外侧白圈 + 红色阴影，明显但不打扰 */
.session-parent .unread {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef7544;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px #fff,                    /* 外侧白色描边，让红标"贴"在父项上 */
    0 2px 6px rgba(239, 68, 68, 0.40); /* 红色柔光，强化"未读"提示 */
  animation: session-unread-pulse 2.2s ease-out infinite;
}
@keyframes session-unread-pulse {
  0%   { box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70%  { box-shadow: 0 0 0 2px #fff, 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(239, 68, 68, 0); }
}
/* 数字 ≥ 10 时变胶囊形（自然撑开） */

/* 用户 */
.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-user { background: #9ca3af; }
.user-name { flex: 1; font-size: 13.5px; }

/* ===================== 主区域 ===================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
}

/* ===================== 欢迎页 ===================== */
.welcome {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 40px;
  overflow-y: auto;
}
.welcome-inner {
  width: 100%;
  max-width: 720px;
}
.welcome-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.welcome-logo img {
  width: 56px;
  height: 56px;
}
.welcome-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.title-caret {
  color: var(--text-sub);
  font-size: 14px;
}

/* ===================== 输入框 composer ===================== */
.composer {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.composer:focus-within {
  border-color: #b9bcc4;
  box-shadow: var(--shadow-md);
}
.composer-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  line-height: 1.5;
  background: transparent;
  color: var(--text);
  padding: 4px 2px;
  max-height: 200px;
  overflow-y: auto;
}
.composer-input::placeholder { color: var(--text-muted); }

.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.composer-left, .composer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  height: 28px;
  white-space: nowrap;
}
.chip:hover { background: var(--hover); }
.chip-icon {
  padding: 4px 8px;
  font-size: 14px;
  color: var(--text-sub);
}
.chip-upload { cursor: pointer; transition: color 120ms, border-color 120ms, background 120ms; }
.chip-upload:hover { color: var(--text); }
.chip-upload.has-attachments {
  color: var(--primary, #2f6df6);
  border-color: var(--primary, #2f6df6);
  background: rgba(47, 109, 246, 0.06);
}
.chip-folder .folder-ic { font-size: 13px; }

/* —— 待发送附件预览区（输入框下方） —— */
.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.composer-attachments[hidden] { display: none; }
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 4px 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text);
  max-width: 260px;
}
.attachment-chip .ac-ic {
  color: var(--text-sub);
  font-size: 13px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.attachment-chip .ac-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.attachment-chip .ac-size {
  color: var(--text-sub);
  font-size: 11px;
  flex-shrink: 0;
}
.attachment-chip-remove {
  background: transparent;
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0;
  flex-shrink: 0;
}
.attachment-chip-remove:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
.chip-perm .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: var(--green); }
.dot-grey { background: #9ca3af; }
.caret-sm { font-size: 9px; color: var(--text-sub); margin-left: 2px; }
.model-ic { color: var(--text-sub); }

/* —— chip 上的小箭头（统一升级版，替代 .caret-sm 的 ▾） —— */
.chip-caret {
  width: 11px;
  height: 11px;
  margin-left: 4px;
  color: var(--text-sub);
  flex-shrink: 0;
  transition: transform 160ms ease, color 160ms ease;
  display: inline-block;
  vertical-align: middle;
}
.chip-perm:hover .chip-caret,
.chip-model:hover .chip-caret { color: var(--text); }

/* —— 模型下拉触发器 + 弹层 —— */
.chip-model-wrap {
  position: relative;
  display: inline-block;
}
.chip-model { cursor: pointer; }
.chip-model.is-open {
  background: var(--hover);
  border-color: #b9bcc4;
}
.chip-model.is-open .chip-caret {
  transform: rotate(180deg);
  color: var(--text);
}
.chip-model-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 60;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}
.model-menu[hidden] { display: none !important; }
.model-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.model-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  line-height: 1.3;
  transition: background 100ms;
}
.model-menu-item:hover { background: var(--hover); }
.model-menu-item .mm-ic {
  width: 16px;
  color: var(--text-sub);
  flex-shrink: 0;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.model-menu-item .mm-name { flex: 1; min-width: 0; }
.model-menu-item .mm-check {
  width: 14px;
  color: var(--primary, #2f6df6);
  opacity: 0;
  flex-shrink: 0;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.model-menu-item.is-selected .mm-check { opacity: 1; }
.model-menu-item.is-selected .mm-name { color: var(--primary, #2f6df6); font-weight: 600; }
.model-menu-item.is-selected .mm-ic { color: var(--primary, #2f6df6); }

.send-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.1s, opacity 0.2s;
}
.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== Tabs ===================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
  justify-content: center;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  height: 32px;
}
.tab:hover { background: var(--hover); }
.tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.tab .tab-ic { font-size: 13px; }

/* ===================== 提示词 ===================== */
.prompts {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 4px;
}
.prompts-title {
  padding: 4px 14px 6px;
  font-size: 12.5px;
  color: var(--text-sub);
}
.prompts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.prompts-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompts-list li:hover { background: var(--hover); }
.prompts-list li .diamond {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

/* ===================== 对话页 ===================== */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-main);
}
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 16px;
}
.chat-day {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 16px;
}
.chat-day::before, .chat-day::after { content: ""; }

.chat-list {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 用户消息 */
.msg-user {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 10px;
}
.msg-user .avatar {
  background: var(--green);
}
.msg-user .bubble {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-user .user-name-tag {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
  text-align: right;
}
.msg-user .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 78%;
}
/* 用户消息中的附件区（在 bubble 上方、用户名下方） */
.msg-user .user-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 6px;
  max-width: 100%;
}
.user-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--text);
  max-width: 260px;
  box-shadow: var(--shadow-sm);
}
.user-attachment-chip .att-ic {
  color: var(--text-sub);
  flex-shrink: 0;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}
.user-attachment-chip .att-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-attachment-chip .att-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.user-attachment-chip .att-size {
  color: var(--text-sub);
  font-size: 11px;
}

/* 助手消息 */
.msg-assistant {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.msg-assistant .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.msg-assistant .avatar img { width: 100%; height: 100%; }

.msg-assistant .msg-body {
  flex: 1;
  min-width: 0;
}
.msg-assistant .msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.msg-assistant .msg-header .name { font-weight: 600; }
.msg-assistant .msg-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-sub);
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  width: fit-content;
}
.msg-assistant .msg-text {
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

/* 工具调用列表 */
.tool-list {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 12px;
  margin: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-sub);
}
.tool-item .tool-ic {
  font-size: 12px;
  color: var(--text-muted);
}
.tool-item .tool-name { color: var(--text); }
.tool-item .tool-arg {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-sub);
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-item .tool-caret { color: var(--text-muted); font-size: 10px; }

/* loading 三个点 */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: blink 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1); }
}

/* 对话页底部输入框 */
.composer-bottom-fixed {
  margin: 8px auto 12px;
  width: 100%;
  max-width: 760px;
  padding: 12px 14px 8px;
}
.chat-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 0 12px;
}

/* ===================== 右上角浮动按钮组 ===================== */
.float-actions {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.float-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-sub);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease,
              border-color 160ms ease, color 160ms ease;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.float-btn:hover {
  color: #818cf8;
  border-color: #c7d2fe;
  box-shadow: 0 6px 18px rgba(129, 140, 248, 0.18);
  transform: translateY(-1px);
}
.float-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.float-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.28);
}
.float-btn-ic {
  width: 18px;
  height: 18px;
  display: block;
}

/* tooltip：hover 时从按钮左侧淡入（避免遮挡下方按钮） */
.float-btn-tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%) translateX(4px);
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
  color: #ffffff;
  background: #1f2329;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.float-btn-tip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 8px;
  height: 8px;
  background: #1f2329;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
}
.float-btn:hover .float-btn-tip,
.float-btn:focus-visible .float-btn-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 720px) {
  .float-actions { top: 10px; right: 12px; gap: 8px; }
  .float-btn { width: 34px; height: 34px; }
  .float-btn-ic { width: 16px; height: 16px; }
}

/* ===================== 联系我们弹窗（与主站保持一致） ===================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.contact-modal.is-open {
  display: flex;
  animation: cmFadeIn 0.22s ease both;
}
.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 50, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.contact-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 22, 50, 0.45),
              0 6px 18px rgba(15, 22, 50, 0.25);
  padding: 32px 28px 24px;
  animation: cmPopIn 0.32s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  overflow: hidden;
}
.contact-modal-dialog::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, #1a2a66 0%, #4338ca 50%, #7c3aed 100%);
}
.contact-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 42, 102, 0.06);
  color: #4338ca;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.contact-modal-close:hover {
  background: rgba(124, 58, 237, 0.14);
  color: #7c3aed;
  transform: rotate(90deg);
}
.contact-modal-head {
  text-align: center;
  margin-bottom: 22px;
}
.contact-modal-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a2a66 0%, #4338ca 55%, #7c3aed 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 10px 24px rgba(67, 56, 202, 0.35);
  margin: 6px auto 14px;
}
.contact-modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #1a2a66;
  letter-spacing: 1px;
}
.contact-modal-sub {
  margin: 0;
  font-size: 13px;
  color: #6b7090;
  line-height: 1.7;
}
.contact-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-modal-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f5f6fb;
  border: 1px solid rgba(26, 42, 102, 0.08);
  border-radius: 12px;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.contact-modal-list li:hover {
  background: #ffffff;
  border-color: rgba(67, 56, 202, 0.35);
  transform: translateY(-1px);
}
.contact-modal-list .cm-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 6px 14px rgba(67, 56, 202, 0.28);
}
.contact-modal-list .cm-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.contact-modal-list .cm-label {
  font-size: 11.5px;
  color: #8a8fa8;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.contact-modal-list .cm-value {
  font-size: 14.5px;
  color: #1a2a66;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.contact-modal-list .cm-value:hover { color: #4338ca; }
.contact-modal-list .cm-copy {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(26, 42, 102, 0.10);
  background: #ffffff;
  color: #4338ca;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.contact-modal-list .cm-copy:hover {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #ffffff;
  transform: scale(1.05);
}
.contact-modal-foot {
  margin-top: 18px;
  text-align: center;
  min-height: 18px;
}
.cm-toast {
  display: inline-block;
  font-size: 12.5px;
  color: #22a06b;
  background: rgba(34, 160, 107, 0.10);
  border: 1px solid rgba(34, 160, 107, 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cm-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}
@keyframes cmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmPopIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
body.contact-modal-open { overflow: hidden; }
@media (max-width: 480px) {
  .contact-modal-dialog { padding: 26px 20px 18px; border-radius: 14px; }
  .contact-modal-title { font-size: 19px; }
  .contact-modal-list .cm-value { font-size: 13.5px; }
}

/* ===================== Demo 功能受限提示弹窗 ===================== */
.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.notice-modal.is-open {
  display: flex;
  animation: cmFadeIn 0.18s ease both;
}
.notice-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 50, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.notice-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 22, 50, 0.35),
              0 4px 14px rgba(15, 22, 50, 0.20);
  padding: 28px 24px 20px;
  text-align: center;
  animation: cmPopIn 0.26s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.notice-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 160ms ease, color 160ms ease;
}
.notice-modal-close:hover {
  background: var(--hover);
  color: var(--text);
}
.notice-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 4px auto 14px;
  box-shadow: 0 8px 20px rgba(129, 140, 248, 0.35);
}
.notice-modal-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.4px;
}
.notice-modal-sub {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.65;
}
#demoNoticeFeature {
  color: var(--text);
  font-weight: 600;
}
.notice-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.notice-btn {
  min-width: 96px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease,
              border-color 160ms ease, transform 160ms ease;
}
.notice-btn:active { transform: translateY(1px); }
.notice-btn-ghost {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text);
}
.notice-btn-ghost:hover {
  background: var(--hover);
}
.notice-btn-primary {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(67, 56, 202, 0.30);
}
.notice-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.36);
}
body.notice-modal-open { overflow: hidden; }

/* ===================== 技能 (Skills) 管理弹窗 ===================== */
.skills-modal {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.skills-modal.is-open {
  display: flex;
  animation: cmFadeIn 0.18s ease both;
}
.skills-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 50, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.skills-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 22, 50, 0.30),
              0 4px 14px rgba(15, 22, 50, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cmPopIn 0.26s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

/* —— 顶部 —— */
.skills-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 56px 14px 24px;  /* 右侧留位给 close × */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.skills-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}
.skills-modal-title #skillsCount { font-weight: 700; }
.skills-modal-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.skills-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 8px;
  color: var(--text-sub);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 320ms ease;
}
.skills-icon-btn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.skills-icon-btn.is-spinning { animation: skillsSpin 0.7s linear; }
@keyframes skillsSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.skills-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.skills-add-btn:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}
.skills-add-btn:active { transform: translateY(1px); }
.skills-add-btn i { font-size: 11px; color: var(--text-sub); }

.skills-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease;
}
.skills-modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* —— 列表 —— */
.skills-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  background: var(--bg-side);
}

.skill-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.skill-row:last-child { margin-bottom: 4px; }
.skill-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.skill-row.is-disabled { opacity: 0.66; }

.skill-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.10);
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.skill-row.is-disabled .skill-icon {
  background: var(--chip-bg);
  color: var(--text-muted);
}

.skill-meta { flex: 1; min-width: 0; }
.skill-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.skill-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  background: var(--chip-bg);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.skill-desc {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* iOS 风格开关 */
.skill-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.skill-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.skill-toggle .slider {
  position: absolute;
  inset: 0;
  background: #d6d8dd;
  border-radius: 999px;
  transition: background 180ms ease;
}
.skill-toggle .slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
}
.skill-toggle input:checked + .slider {
  background: linear-gradient(135deg, #22c55e, #10b981);
}
.skill-toggle input:checked + .slider::after { transform: translateX(16px); }
.skill-toggle input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
}

/* 删除按钮 */
.skill-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease;
}
.skill-remove:hover {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}

.skills-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* —— 底部 —— */
.skills-modal-foot {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}
.skills-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.28);
  transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.skills-save-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.34);
}
.skills-save-btn:active { transform: translateY(1px); }
.skills-save-btn i { font-size: 11px; }

body.skills-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .skills-modal-dialog { max-height: 92vh; }
  .skills-modal-head { padding: 14px 50px 12px 16px; flex-wrap: wrap; }
  .skills-modal-body { padding: 12px; }
  .skill-row { padding: 12px; gap: 10px; }
  .skills-add-btn span { display: none; }
  .skills-add-btn { padding: 0 10px; }
}

@media (max-width: 480px) {
  .notice-modal-dialog { padding: 24px 18px 16px; border-radius: 14px; }
  .notice-modal-title { font-size: 16px; }
  .notice-modal-sub { font-size: 13px; }
}

/* ===================== 使用统计页 ===================== */
.stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}
.stats-scroll {
  flex: 1;
  overflow-y: auto;
}
.stats-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}
.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.stats-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}
.stats-period {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--chip-bg);
  padding: 4px 10px;
  border-radius: 999px;
}

/* —— 概览卡片 —— */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.stat-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stat-card-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-ic svg { width: 16px; height: 16px; display: block; }
.stat-card-label {
  font-size: 12.5px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  line-height: 1.15;
  word-break: break-all;
}
.stat-card-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
  position: relative;
}
.stat-card-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: 999px;
}
/* 5 种主题色：余额绿 / 总费用橙 / 请求数蓝 / 输入紫 / 输出粉 */
.stat-card.tone-balance .stat-card-ic { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.stat-card.tone-cost    .stat-card-ic { background: rgba(255, 106, 26, 0.12); color: #f97316; }
.stat-card.tone-req     .stat-card-ic { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-card.tone-in      .stat-card-ic { background: rgba(129, 140, 248, 0.14); color: #6366f1; }
.stat-card.tone-out     .stat-card-ic { background: rgba(236, 72, 153, 0.12); color: #ec4899; }

/* —— 详细使用记录 —— */
.usage-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.usage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.usage-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.usage-section-ic { width: 16px; height: 16px; color: var(--text-sub); }
.usage-section-meta { font-size: 12.5px; color: var(--text-sub); }

.usage-table-wrap { overflow-x: auto; }
.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: fixed;
}
.usage-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-sub);
  background: #fafbfc;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.usage-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.usage-table tbody tr:last-child td { border-bottom: none; }
.usage-table tbody tr { transition: background 120ms ease; }
.usage-table tbody tr:hover { background: #fafbfc; }

.col-time   { width: 170px; }
.col-prompt { width: auto; }
.col-tokens { width: 120px; text-align: right; }
.col-cost   { width: 100px; text-align: right; }

.usage-table .cell-time {
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.usage-table .cell-prompt {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.usage-table .cell-tokens {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.usage-table .cell-cost {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #16a34a;
}
.usage-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* —— 分页器 —— */
.usage-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 18px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
}
.usage-pager .page-info {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--text-sub);
}
.usage-pager button {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.usage-pager button:hover:not([disabled]):not(.is-active) {
  background: var(--hover);
  border-color: var(--border-strong);
}
.usage-pager button.is-active {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
  cursor: default;
}
.usage-pager button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.usage-pager .page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  user-select: none;
}

@media (max-width: 960px) {
  .stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-inner { padding: 22px 18px 40px; }
}
@media (max-width: 480px) {
  .stats-cards { grid-template-columns: 1fr; }
  .col-time { width: 130px; }
  .col-tokens { width: 90px; }
  .col-cost { width: 80px; }
  .usage-table thead th, .usage-table tbody td { padding: 10px 12px; }
}

/* ===================== 滚动条美化 ===================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: #d6d8dd;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #b9bcc4; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== 响应式 ===================== */
@media (max-width: 720px) {
  .sidebar { width: 64px; padding: 8px 4px; }
  .brand, .nav-item span:not(.ic), .nav-sub a span:not(.ic),
  .nav-section-title, .user-name { display: none; }
  .nav-item, .nav-sub a { justify-content: center; padding: 8px; }
  .welcome { padding: 40px 16px; }
  .tabs { justify-content: flex-start; }
  .chat-list, .composer-bottom-fixed { padding: 0 12px; }
}
