:root {
  --bg: #f0f2fa;
  --bg-accent: #e8eeff;
  --card: #ffffff;
  --card-soft: #f8f7ff;
  --line: #e2d9f3;
  --text: #1a1632;
  --text-soft: #6b5f8a;
  --primary: #6c5ce7;
  --primary-deep: #4834d4;
  --accent: #f89463;
  --accent-soft: #ffecd2;
  --user: #f0e6ff;
  --user-deep: #e0d0ff;
  --assistant: #faf8ff;
  --success: #00b894;
  --warn: #e84393;
  --shadow: 0 10px 30px rgba(108, 92, 231, 0.12);
  --sidebar-bg: linear-gradient(160deg, #f5f0ff 0%, #ede5ff 40%, #e8ddff 100%);
  --sidebar-text: #6b5f8a;
  --sidebar-text-bright: #2d1b69;
  --sidebar-line: rgba(108, 92, 231, 0.18);
  --sidebar-hover: rgba(108, 92, 231, 0.1);
  --sidebar-active: rgba(108, 92, 231, 0.18);
  --user-bubble-from: #8b5cf6;
  --user-bubble-mid: #a855f7;
  --user-bubble-to: #c084fc;
  --ai-bubble-bg: #ffffff;
  --ai-bubble-text: #1f2b47;
  --ai-bubble-border: #e2d9f3;
  --avatar-user-from: #ec4899;
  --avatar-user-to: #f472b6;
  --avatar-ai-from: #6c5ce7;
  --avatar-ai-to: #a855f7;
  --chat-bg: #f8fbff;
  --send-from: #6c5ce7;
  --send-mid: #a855f7;
  --send-to: #ec4899;
  --logo-from: #6c5ce7;
  --logo-mid: #a855f7;
  --logo-to: #ec4899;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(800px 600px at -5% -15%, #e8d5ff 0%, transparent 55%),
    radial-gradient(700px 500px at 105% -10%, #ffd6e8 0%, transparent 50%),
    radial-gradient(900px 400px at 50% 110%, #d5eeff 0%, transparent 50%),
    var(--bg);
}

.page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.app {
  width: min(1600px, 98%);
  height: min(96vh, 980px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 340px 1fr;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  color: var(--sidebar-text);
}

.brand {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--sidebar-line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(6px);
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--logo-from) 0%, var(--logo-mid) 50%, var(--logo-to) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--sidebar-text-bright);
}

.brand p {
  margin: 4px 0 0;
  color: var(--sidebar-text);
  font-size: 12px;
}

.panel {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--sidebar-line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
  backdrop-filter: blur(4px);
}

.panel h2 {
  margin: 0;
  font-size: 14px;
  color: var(--sidebar-text-bright);
}

.panel p {
  margin: 0;
  color: var(--sidebar-text);
  font-size: 12px;
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--sidebar-text-bright);
  font-weight: 600;
}

.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  color: var(--sidebar-text-bright);
  cursor: pointer;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: #c4b5e3;
  background: rgba(255,255,255,0.9);
}

.btn-primary {
  background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover { background: linear-gradient(135deg, #5a4bd6 0%, #9333ea 100%); }

.meta-list {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--chat-bg);
}

.topbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 32px 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: linear-gradient(135deg, #f5f0ff 0%, #ede5ff 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%236c5ce7' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.model-select:hover {
  border-color: #a78bfa;
  background-color: #e4eeff;
}

.model-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.title {
  display: grid;
  gap: 4px;
}

.title h3 {
  margin: 0;
  font-size: 16px;
  color: #17385c;
}

.title span {
  font-size: 12px;
  color: var(--text-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #345376;
  background: #eef5ff;
  border: 1px solid #d5e5ff;
  border-radius: 999px;
  padding: 6px 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.chat {
  overflow-y: auto;
  padding: 18px;
  min-height: 0;
}

.messages {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: up 0.2s ease;
}

.message.user { flex-direction: row-reverse; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.assistant .avatar { background: linear-gradient(135deg, var(--avatar-ai-from), var(--avatar-ai-to)); }
.user .avatar { background: linear-gradient(135deg, var(--avatar-user-from), var(--avatar-user-to)); }

.bubble-wrap {
  max-width: min(760px, calc(100% - 50px));
  display: grid;
  gap: 5px;
  position: relative;
}

.bubble {
  border: 1px solid var(--ai-bubble-border);
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: var(--ai-bubble-text);
  background: var(--ai-bubble-bg);
}

.user .bubble {
  background: linear-gradient(135deg, var(--user-bubble-from) 0%, var(--user-bubble-mid) 50%, var(--user-bubble-to) 100%);
  border-color: transparent;
  color: #fff;
}

.msg-meta {
  font-size: 11px;
  color: #9b8ec4;
  padding: 0;
  line-height: 1;
}

.message.user .msg-meta {
  text-align: right;
  color: #b8a8d8;
}

.msg-more-btn {
  position: absolute;
  bottom: -2px;
  right: 0;
  background: none;
  border: none;
  font-size: 18px;
  color: #a0b4cc;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.message:hover .msg-more-btn { opacity: 1; }
.msg-more-btn:hover { background: #f0e6ff; color: #6c5ce7; }

.msg-action-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(31,78,149,0.12);
  z-index: 50;
  flex-direction: row;
  gap: 2px;
}

.msg-action-menu.open { display: flex; }

.message.menu-open {
  position: relative;
  z-index: 100;
}

.message.menu-open .bubble-wrap {
  overflow: visible;
}

.msg-action-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #5a7a9a;
  transition: all 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.msg-action-item:hover {
  background: #f5f0ff;
  color: var(--primary);
}

.msg-action-item.msg-action-danger:hover {
  background: #fff5f5;
  color: #dc2626;
}

.tts-btn.tts-loading {
  color: var(--accent);
  animation: tts-spin 1s linear infinite;
  pointer-events: none;
}
.tts-btn.tts-playing {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
}
.tts-btn.tts-playing:hover {
  background: rgba(244, 63, 94, 0.1) !important;
  color: #f43f5e !important;
}
@keyframes tts-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fav-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 auto;
  margin-top: 10px;
}

.fav-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #f5f0ff;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.fav-save-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.fav-save-btn:hover { background: #1a5cd4; }

.fav-cancel-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #5a7a9a;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.fav-cancel-btn:hover { background: #faf8ff; }

.composer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 18px 16px;
}

.model-dropdown {
  position: relative;
}

.model-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: linear-gradient(135deg, #f5f0ff 0%, #ede5ff 100%);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.model-trigger:hover {
  border-color: #a78bfa;
  background: #e4eeff;
}

.model-trigger-icon { font-size: 14px; }
.model-arrow { font-size: 10px; opacity: 0.6; }

.model-panel {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(31,78,149,0.12);
  z-index: 100;
}

.model-panel.open { display: block; }

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.model-option:hover {
  background: #f5f0ff;
}

.model-option.active {
  background: #ede5ff;
}

.mo-icon { width: 22px; height: 22px; border-radius: 4px; flex: 0 0 auto; object-fit: contain; }

.mo-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.mo-check {
  font-size: 14px;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.12s;
}

.model-option.active .mo-check { opacity: 1; }

.composer-bar {
  max-width: 920px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-inner {
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
}

#input {
  width: 100%;
  min-height: 52px;
  max-height: 200px;
  resize: none;
  border: 0;
  outline: none;
  font: inherit;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
}

#input::placeholder { color: #a89bc2; }

.composer-foot {
  max-width: 920px;
  margin: 4px auto 0;
  text-align: center;
  font-size: 11px;
  color: #b0a3c8;
  letter-spacing: 0.3px;
  padding: 0 10px;
  line-height: 1.4;
  user-select: none;
}

#latencyView {
  font-size: 10px;
  color: #c4b8d8;
  letter-spacing: 0;
}

.send {
  height: 44px;
  min-width: 90px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hint {
  max-width: 920px;
  margin: 8px auto 0;
  font-size: 12px;
  color: #748ca9;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7d95b4;
  animation: jump 1s infinite ease;
}

.typing i:nth-child(2) { animation-delay: 0.12s; }
.typing i:nth-child(3) { animation-delay: 0.24s; }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background:
    radial-gradient(1000px 500px at -10% -20%, #dceaff 0%, transparent 60%),
    radial-gradient(900px 450px at 110% -10%, #e4f8f0 0%, transparent 58%),
    var(--bg);
}

.auth-container {
  width: min(420px, 90vw);
  background: #fff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(31, 78, 149, 0.12);
  border: 1px solid var(--line);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header .logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--logo-from) 0%, var(--logo-to) 100%);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
}

.auth-header h1 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
}

.auth-header p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.auth-form h2 {
  margin: 0 0 18px;
  font-size: 18px;
  color: #214166;
}

.auth-form .field {
  margin-bottom: 14px;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 12px;
  margin-top: 6px;
}

.remember-row {
  margin-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.auth-error {
  color: var(--warn);
  font-size: 12px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-soft);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.suggestions {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 20px;
}

.suggestions-title {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-soft);
}

.suggestions-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.suggestion-btn {
  border: 1px solid #e2d9f3;
  border-radius: 12px;
  background: #fff;
  color: #4a3580;
  cursor: pointer;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.suggestion-btn:hover {
  border-color: #a855f7;
  background: #f5f0ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.1);
}

.new-chat-btn {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  border-radius: 12px;
  text-align: center;
}

.conv-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
  gap: 6px;
}

.conv-item:hover {
  background: var(--sidebar-hover);
}

.conv-item.active {
  background: var(--sidebar-active);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.conv-title {
  flex: 1;
  font-size: 13px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.conv-item:hover .conv-actions {
  opacity: 1;
}

.conv-action-btn {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.conv-action-btn:hover {
  background: rgba(108, 92, 231, 0.15);
  color: var(--primary);
  transform: scale(1.1);
}

.conv-delete:hover {
  background: rgba(232, 67, 147, 0.15);
  color: #e84393;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-soft);
}

.user-bar .username {
  font-weight: 600;
  color: var(--text);
}

.username-btn {
  border: 1px solid #d5e5ff;
  background: linear-gradient(135deg, #f5f0ff 0%, #ede5ff 100%);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s ease;
}

.username-btn:hover {
  border-color: #a78bfa;
  background: #e4eeff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.12);
}

.user-bar .logout-btn {
  border: 1px solid #ffd4d4;
  background: #fff5f5;
  color: var(--warn);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}

.user-bar .logout-btn:hover {
  background: #ffe8e8;
  border-color: #ffb3b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 899;
}

.sidebar-overlay.show {
  display: block;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
}

@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes jump {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 980px) {
  .page { padding: 0; height: 100vh; }
  .app {
    border-radius: 0;
    height: 100vh;
    grid-template-columns: 1fr;
    position: relative;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(220px, 68vw);
    height: 100vh;
    border-right: 1px solid var(--line);
    border-radius: 0;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    max-height: none;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 899;
  }
  .sidebar-overlay.active,
  .sidebar-overlay.show {
    display: block;
  }
  .menu-toggle {
    display: flex;
    flex: 0 0 auto;
  }
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .title h3 {
    font-size: 14px;
    white-space: nowrap;
  }
  .title span {
    display: none;
  }
  .topbar-right {
    gap: 0;
  }
  .status {
    padding: 4px 8px;
    font-size: 11px;
  }
  .model-trigger {
    padding: 5px 10px;
    font-size: 12px;
  }
  .composer {
    padding: 5px 8px 8px;
  }
  .composer-bar {
    margin-bottom: 4px;
  }
  .composer-inner {
    padding: 6px 8px;
    gap: 8px;
    border-radius: 11px;
  }
  #input {
    min-height: 56px;
    max-height: 180px;
    font-size: 14px;
    line-height: 1.45;
  }
  .send {
    height: 44px;
    min-width: 72px;
    width: auto;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .hint {
    display: none;
  }
  .chat {
    padding: 10px;
  }
  .suggestions {
    padding: 24px 12px;
  }
  .suggestions-list {
    gap: 6px;
  }
  .suggestion-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  .msg-more-btn {
    opacity: 1;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: min(360px, 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #17385c;
  margin-bottom: 14px;
}

.modal-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231,0.12);
}

.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.modal-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.modal-btn-cancel {
  background: #f3f6fb;
  color: #5d7089;
}

.modal-btn-cancel:hover {
  background: #e8edf5;
}

.modal-btn-confirm {
  background: var(--primary);
  color: #fff;
}

.modal-btn-confirm:hover {
  background: #1a5cd4;
}

.sidebar-version {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--sidebar-text);
  text-align: center;
  flex-shrink: 0;
}

.auth-version {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  color: #9ab0c8;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  color: #5d7089;
  transition: all 0.15s;
  flex-shrink: 0;
  background: #f3f6fb;
  border: 1px solid var(--line);
  position: relative;
}

.upload-btn:hover {
  background: #e0d5ff;
  color: var(--primary);
  border-color: #a78bfa;
  transform: scale(1.05);
}

.upload-btn:active {
  transform: scale(0.94);
  background: #d0e2ff;
}

.upload-btn .upload-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1c2a3a;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-btn .upload-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1c2a3a;
}

.upload-btn.show-tip .upload-tooltip {
  opacity: 1;
}

.upload-preview {
  max-width: 920px;
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #faf8ff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.upload-preview-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.upload-preview-inner img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.upload-preview-inner .file-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #e7effb;
  border: 1px solid var(--line);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.upload-preview-inner .file-name {
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-clear {
  width: 24px;
  height: 24px;
  border: none;
  background: #e8edf5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: #5d7089;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.upload-clear:hover {
  background: #fde8e8;
  color: #dc2626;
}

.msg-image {
  max-width: 280px;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 6px;
  cursor: pointer;
  border: 1px solid var(--line);
}

.msg-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.msg-image-list .msg-image {
  width: 92px;
  height: 72px;
  object-fit: cover;
  margin-top: 0;
}

.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  background: #faf8ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.message.user .bubble-wrap { box-shadow: none; justify-items: end; }
.auth-container, .profile-wrap .card { box-shadow: 0 10px 28px rgba(31,78,149,0.08); }

/* UI polish: focus rings, hover lifts, button presses, improved cards */
.btn,.send,.auth-btn,.back-btn,.menu-item,.fav-item,.model-trigger,.upload-btn {
  transition: box-shadow .18s ease, transform .18s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active,.send:active,.auth-btn:active,.back-btn:active,.menu-item:active,.fav-item:active,.model-trigger:active,.upload-btn:active {
  transform: translateY(0) scale(0.98);
}
.btn:hover,.auth-btn:hover,.back-btn:hover,.menu-item:hover,.fav-item:hover,.model-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(108, 92, 231,0.08);
}
.btn:focus-visible,.auth-btn:focus-visible,.back-btn:focus-visible,.menu-item:focus-visible,.model-trigger:focus-visible,.upload-btn:focus-visible,.fav-del:focus-visible,.sub-back:focus-visible {
  outline: 2px solid rgba(108, 92, 231,0.35);
  outline-offset: 2px;
}
.btn-primary,.send,.auth-btn { box-shadow: 0 8px 18px rgba(108, 92, 231,0.18); }
.btn-primary:hover,.send:hover,.auth-btn:hover { box-shadow: 0 10px 24px rgba(108, 92, 231,0.22); }
.panel,.card,.auth-container,.modal-box { box-shadow: 0 12px 28px rgba(108, 92, 231, 0.08); }
.sidebar, .topbar { backdrop-filter: saturate(1.05) blur(4px); }
.message.assistant .bubble { background: linear-gradient(180deg, var(--ai-bubble-bg), var(--assistant)); }
.message.user .bubble { background: linear-gradient(135deg, var(--user-bubble-from) 0%, var(--user-bubble-mid) 50%, var(--user-bubble-to) 100%); }

/* ============================================================
   UI 增强模块 — 动效 · 玻璃感 · 渐变 · 个性化
   ============================================================ */

/* ---- 全局变量增强 ---- */
:root {
  --glow-primary: rgba(108, 92, 231, 0.18);
  --glow-success: rgba(22, 163, 74, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(219, 231, 247, 0.6);
}

/* ---- 页面加载动画 ---- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--glow-primary); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- app 容器入场 ---- */
.app {
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---- 侧边栏玻璃感增强 ---- */
.sidebar {
  animation: fadeSlideIn 0.35s ease both;
}

@media (max-width: 980px) {
  .sidebar {
    animation: none;
  }
}

/* ---- Logo 流光效果 ---- */
.logo {
  background: linear-gradient(135deg, var(--logo-from), var(--logo-to), var(--logo-from));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  position: relative;
  overflow: hidden;
}

.logo::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 70%
  );
  animation: shimmer 3s ease-in-out infinite;
}

/* ---- 新建对话按钮增强 ---- */
.new-chat-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #ec4899 50%, var(--primary) 100%);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.new-chat-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

/* ---- 品牌卡片 ---- */
.brand {
  animation: fadeSlideUp 0.3s ease 0.05s both;
  transition: all 0.25s ease;
}

.brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.08);
}

/* ---- 顶栏增强 ---- */
.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
}

/* ---- 状态指示灯脉冲 ---- */
.status-dot {
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--glow-success);
}

/* ---- 消息气泡增强 ---- */
.message {
  animation: floatIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message.assistant .bubble {
  background: linear-gradient(180deg, var(--ai-bubble-bg) 0%, var(--assistant) 100%);
  border-color: var(--ai-bubble-border);
  transition: all 0.2s ease;
}

.message.assistant .bubble:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.08);
}

.message.user .bubble {
  background: linear-gradient(135deg, var(--user-bubble-from) 0%, var(--user-bubble-mid) 50%, var(--user-bubble-to) 100%);
  border-color: transparent;
  color: #fff;
  transition: all 0.2s ease;
}

.message.user .bubble:hover {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

/* ---- 头像增强 ---- */
.avatar {
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message:hover .avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.assistant .avatar {
  background: linear-gradient(135deg, #6c5ce7, #a855f7);
}

.user .avatar {
  background: linear-gradient(135deg, #ec4899, #f472b6);
}

/* ---- 发送按钮流光效果 ---- */
.send {
  background: linear-gradient(135deg, var(--send-from) 0%, var(--send-mid) 50%, var(--send-to) 100%);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  position: relative;
  overflow: hidden;
}

.send::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 35%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 65%
  );
  animation: shimmer 2.5s ease-in-out infinite;
  pointer-events: none;
}

.send:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(108, 92, 231, 0.35);
}

/* ---- 输入框增强 ---- */
.composer-inner {
  transition: all 0.25s ease;
  border-color: var(--line);
}

.composer-inner:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1), 0 8px 24px rgba(108, 92, 231, 0.06);
  transform: translateY(-1px);
}

/* ---- 建议卡片增强 ---- */
.suggestion-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.suggestion-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.05) 0%, rgba(78, 168, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.suggestion-btn:hover::before {
  opacity: 1;
}

.suggestion-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.2);
  border-color: #a855f7;
}

.suggestion-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ---- 建议区域入场动画 ---- */
.suggestions {
  animation: fadeSlideUp 0.5s ease 0.1s both;
}

.suggestion-btn:nth-child(1) { animation: floatIn 0.35s ease 0.15s both; }
.suggestion-btn:nth-child(2) { animation: floatIn 0.35s ease 0.22s both; }
.suggestion-btn:nth-child(3) { animation: floatIn 0.35s ease 0.29s both; }
.suggestion-btn:nth-child(4) { animation: floatIn 0.35s ease 0.36s both; }

/* ---- 对话列表项增强 ---- */
.conv-item {
  transition: all 0.2s ease;
  border-radius: 10px;
}

.conv-item:hover {
  background: var(--sidebar-hover);
  transform: translateX(2px);
}

.conv-item.active {
  background: var(--sidebar-active);
  border-left: 3px solid var(--accent);
}

/* ---- 模型选择面板增强 ---- */
.model-panel {
  animation: fadeSlideUp 0.2s ease both;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2d9f3;
}

.model-option {
  transition: all 0.18s ease;
}

.model-option:hover {
  background: linear-gradient(135deg, #f5f0ff, #ede5ff);
  transform: translateX(3px);
}

/* ---- 上传按钮增强 ---- */
.upload-btn {
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.upload-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

.upload-btn:active {
  transform: scale(0.92);
}

/* ---- 滚动条美化 ---- */
.chat::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.conv-list::-webkit-scrollbar {
  width: 6px;
}

.chat::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.conv-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.conv-list::-webkit-scrollbar-thumb {
  background: rgba(108, 92, 231, 0.15);
  border-radius: 3px;
}

.chat::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.conv-list::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 92, 231, 0.3);
}

/* ---- 版本信息 ---- */
.sidebar-version {
  animation: breathe 3s ease-in-out infinite;
}

/* ---- 收藏工具栏增强 ---- */
.fav-toolbar {
  background: linear-gradient(135deg, #f5f0ff, #ede5ff);
  animation: fadeSlideUp 0.25s ease both;
}

/* ---- 上传预览增强 ---- */
.upload-preview {
  background: linear-gradient(135deg, #f5f0ff, #faf8ff);
  animation: fadeSlideUp 0.2s ease both;
  transition: all 0.2s ease;
}

/* ---- 文件图标 ---- */
.file-icon {
  transition: all 0.2s ease;
}

/* ---- 图片预览增强 ---- */
.msg-image {
  transition: all 0.25s ease;
}

.msg-image:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ---- 文件卡片增强 ---- */
.msg-file {
  transition: all 0.2s ease;
}

.msg-file:hover {
  background: #f0e6ff;
  transform: translateX(2px);
}

/* ---- 登录页增强 ---- */
.auth-container {
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-header .logo {
  animation: gradientShift 4s ease infinite, scaleIn 0.4s ease both;
}

.auth-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #ec4899 50%, var(--primary) 100%);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

.auth-btn:hover {
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

/* ---- 减少动画模式 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 涟漪点击效果 ---- */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  transform: scale(0);
  animation: ripple 0.5s ease-out forwards;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---- 打字机光标 ---- */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  margin-left: 2px;
  animation: blink-cursor 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   自定义弹窗
   ============================================================ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.custom-modal-overlay.show {
  opacity: 1;
}

.custom-modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px 24px;
  width: min(380px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}

.custom-modal-overlay.show .custom-modal-box {
  transform: scale(1) translateY(0);
}

.custom-modal-icon {
  margin: 0 auto 12px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(236, 72, 153, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.custom-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.custom-modal-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.custom-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.custom-modal-btn {
  padding: 10px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.custom-modal-btn-cancel {
  background: var(--card-soft);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.custom-modal-btn-cancel:hover {
  background: var(--line);
}

.custom-modal-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.25);
}

.custom-modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
}

/* ============================================================
   设置面板
   ============================================================ */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-panel.open ~ .settings-overlay,
.settings-panel.open + .settings-overlay {
  opacity: 1;
  pointer-events: auto;
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: min(480px, 92vw);
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  z-index: 9600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.settings-panel.open ~ .settings-overlay {
  opacity: 1;
  pointer-events: auto;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.settings-header h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
  font-weight: 700;
}

.settings-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--card-soft);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.settings-close:hover {
  background: var(--line);
  color: var(--text);
}

.settings-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-desc {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-soft);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--card-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-option:hover {
  background: var(--line);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.theme-option.active {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.theme-option.active .theme-name {
  color: var(--primary);
}

.settings-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.settings-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.settings-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.settings-menu-btn:last-child {
  margin-bottom: 0;
}

.settings-menu-btn:hover {
  background: var(--user);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.usage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.usage-info strong {
  color: var(--primary);
  font-size: 16px;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.vip-active-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #b45309;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
}

.vip-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.vip-input-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--card-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.vip-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.vip-activate-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.vip-activate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.vip-activate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 设置按钮样式 */
.settings-trigger {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-trigger:hover {
  background: var(--line);
  color: var(--primary);
  transform: rotate(30deg);
}

/* ---- 通知面板 ---- */
.notify-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.notify-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.notify-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: min(500px, 92vw);
  max-height: 80vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  z-index: 9600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notify-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.notify-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.notify-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-soft);
  font-size: 13px;
}
.notify-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--card-soft);
  transition: border-color 0.2s;
}
.notify-item:hover {
  border-color: var(--primary);
}
.notify-item.notify-pinned {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(248, 148, 99, 0.06), rgba(108, 92, 231, 0.04));
}
.notify-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.notify-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.notify-pin-badge {
  padding: 1px 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #e74c3c);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.notify-item-date {
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
}
.notify-item-content {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
  white-space: pre-wrap;
}
.notify-trigger {
  position: relative;
}
.notify-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 0 2px var(--card);
}

/* ---- 暗夜主题覆盖 ---- */
[data-theme="dark"] .new-chat-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  background-size: 200% 200%;
}

[data-theme="dark"] .auth-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  background-size: 200% 200%;
}

[data-theme="dark"] body {
  background:
    radial-gradient(800px 600px at -5% -15%, #1f1840 0%, transparent 55%),
    radial-gradient(700px 500px at 105% -10%, #1a1030 0%, transparent 50%),
    radial-gradient(900px 400px at 50% 110%, #0f1020 0%, transparent 50%),
    var(--bg);
}

[data-theme="dark"] .topbar {
  background: rgba(26, 28, 40, 0.88);
}

[data-theme="dark"] .custom-modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .settings-overlay {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .custom-modal-icon {
  background: linear-gradient(135deg, rgba(124, 109, 240, 0.15), rgba(240, 148, 77, 0.15));
}

[data-theme="dark"] .status {
  background: rgba(124, 109, 240, 0.1);
  border-color: rgba(124, 109, 240, 0.2);
  color: #a78bfa;
}

[data-theme="dark"] .suggestion-btn {
  background: rgba(26, 28, 40, 0.8);
  border-color: var(--line);
  color: #a78bfa;
}

[data-theme="dark"] .suggestion-btn:hover {
  border-color: var(--primary);
  background: rgba(124, 109, 240, 0.1);
}

[data-theme="dark"] .composer {
  background: var(--card);
}

[data-theme="dark"] .composer-inner {
  background: var(--card-soft);
  border-color: var(--line);
}

[data-theme="dark"] #input {
  color: var(--text);
}

[data-theme="dark"] .msg-more-btn { color: var(--text-soft); }
[data-theme="dark"] .msg-more-btn:hover { background: rgba(124, 109, 240, 0.15); color: var(--primary); }

[data-theme="dark"] .msg-action-menu {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .msg-action-item { color: var(--text-soft); }
[data-theme="dark"] .msg-action-item:hover { background: rgba(124, 109, 240, 0.15); color: var(--primary); }
[data-theme="dark"] .msg-action-item.msg-action-danger:hover { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }

[data-theme="dark"] .conv-item.active {
  border-left-color: var(--primary);
}

[data-theme="dark"] .brand {
  background: rgba(31, 34, 50, 0.7);
}

[data-theme="dark"] .upload-btn {
  background: var(--card-soft);
  border-color: var(--line);
}

[data-theme="dark"] .upload-btn:hover {
  background: rgba(124, 109, 240, 0.15);
}

[data-theme="dark"] .msg-file {
  background: var(--card-soft);
  border-color: var(--line);
}

[data-theme="dark"] .upload-preview {
  background: var(--card-soft);
  border-color: var(--line);
}

[data-theme="dark"] .msg-image {
  border-color: var(--line);
}

[data-theme="dark"] .custom-modal-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}

[data-theme="dark"] .model-trigger {
  background: var(--card-soft);
  border-color: var(--line);
  color: var(--primary);
}

[data-theme="dark"] .model-trigger:hover {
  background: rgba(124, 109, 240, 0.1);
  border-color: var(--primary);
}

[data-theme="dark"] .model-panel {
  background: var(--card);
  border-color: var(--line);
}

[data-theme="dark"] .model-option:hover {
  background: rgba(124, 109, 240, 0.08);
}

[data-theme="dark"] .model-option.active {
  background: rgba(124, 109, 240, 0.15);
}

[data-theme="dark"] .mo-name {
  color: var(--text);
}

[data-theme="dark"] .title h3 {
  color: var(--text);
}

[data-theme="dark"] .title span {
  color: var(--text-soft);
}

[data-theme="dark"] .topbar {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .settings-header {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .settings-logout-btn {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.05);
  color: #f43f5e;
}

[data-theme="dark"] .settings-logout-btn:hover {
  background: rgba(244, 63, 94, 0.1);
}

/* ---- 手机端适配 ---- */
@media (max-width: 768px) {
  .send {
    animation: none;
    background: linear-gradient(135deg, var(--send-from), var(--send-to));
  }

  .send::before {
    display: none;
  }

  .logo {
    animation: gradientShift 6s ease infinite;
  }

  .logo::after {
    display: none;
  }

  .settings-panel {
    width: min(380px, 94vw);
    max-height: 80vh;
  }

  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .custom-modal-box {
    width: 90vw;
    padding: 24px 20px 20px;
  }
}

/* ==================== 管理后台 ==================== */
.admin-page {
  --admin-bg: #0f1117;
  --admin-bg-accent: #181a24;
  --admin-card: #1e2030;
  --admin-card-soft: #252840;
  --admin-line: #33365a;
  --admin-text: #e2e4eb;
  --admin-text-soft: #8b8fa8;
  --admin-primary: #818cf8;
  --admin-primary-deep: #6366f1;
  --admin-accent: #f59e0b;
  --admin-danger: #f43f5e;
  --admin-success: #10b981;
}
.admin-page body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
}

/* ---- 登录页 ---- */
.admin-page .login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.admin-page .login-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  padding: 36px 32px;
  width: min(400px, 100%);
}
.admin-page .login-box h1 {
  font-size: 20px; text-align: center; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-page .login-box p { text-align: center; color: var(--admin-text-soft); font-size: 13px; margin-bottom: 24px; }
.admin-page .login-box .field { margin-bottom: 14px; }
.admin-page .login-box label { display: block; font-size: 12px; font-weight: 600; color: var(--admin-text-soft); margin-bottom: 6px; }
.admin-page .login-box input {
  width: 100%; border: 1px solid var(--admin-line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--admin-card-soft); color: var(--admin-text); outline: none;
  transition: border-color 0.2s;
}
.admin-page .login-box input:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 3px rgba(129,140,248,0.15); }
.admin-page .login-btn {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-deep));
  color: #fff; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-top: 6px; transition: all 0.2s;
}
.admin-page .login-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(129,140,248,0.3); }
.admin-page .login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.admin-page .login-error { color: var(--admin-danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; }

/* ---- 主布局 ---- */
.admin-page .admin-app { display: none; flex-direction: column; min-height: 100vh; }
.admin-page .admin-app.active { display: flex; }
.admin-page .admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--admin-line);
  background: var(--admin-card);
}
.admin-page .admin-topbar h2 {
  font-size: 16px;
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-page .admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-page .admin-logout-btn {
  padding: 7px 14px; border: 1px solid var(--admin-line); border-radius: 8px;
  background: var(--admin-card-soft); color: var(--admin-text-soft); font-size: 13px;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.admin-page .admin-logout-btn:hover { border-color: var(--admin-danger); color: var(--admin-danger); }
.admin-page .admin-body { flex: 1; padding: 24px; overflow: auto; }

/* ---- 搜索栏 ---- */
.admin-page .search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.admin-page .search-bar input {
  flex: 1; border: 1px solid var(--admin-line); border-radius: 10px;
  padding: 9px 14px; font-size: 13px; font-family: inherit;
  background: var(--admin-card); color: var(--admin-text); outline: none;
  transition: border-color 0.2s;
}
.admin-page .search-bar input:focus { border-color: var(--admin-primary); }
.admin-page .search-btn {
  padding: 9px 18px; border: none; border-radius: 10px;
  background: var(--admin-primary); color: #fff; font-size: 13px;
  font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.2s;
}
.admin-page .search-btn:hover { background: var(--admin-primary-deep); }

/* ---- 统计卡片 ---- */
.admin-page .stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.admin-page .stat-card {
  background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 12px;
  padding: 16px; text-align: center;
}
.admin-page .stat-card .stat-num { font-size: 28px; font-weight: 700; color: var(--admin-primary); }
.admin-page .stat-card .stat-label { font-size: 12px; color: var(--admin-text-soft); margin-top: 4px; }

/* ---- 用户表格 ---- */
.admin-page .table-wrap {
  background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 14px;
  overflow: hidden;
}
.admin-page .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-page .data-table th {
  background: var(--admin-card-soft); padding: 12px 14px; text-align: left;
  font-weight: 600; color: var(--admin-text-soft); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.admin-page .data-table td {
  padding: 12px 14px; border-top: 1px solid var(--admin-line);
  vertical-align: middle;
}
.admin-page .data-table tr:hover td { background: rgba(129,140,248,0.04); }

.admin-page .badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.admin-page .badge-vip { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.admin-page .badge-normal { background: var(--admin-card-soft); color: var(--admin-text-soft); border: 1px solid var(--admin-line); }
.admin-page .badge-banned { background: rgba(244,63,94,0.15); color: #f43f5e; border: 1px solid rgba(244,63,94,0.3); }
.admin-page .badge-active { background: rgba(16,185,129,0.15); color: #10b981; }

.admin-page .action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-page .act-btn {
  padding: 5px 10px; border: 1px solid var(--admin-line); border-radius: 8px;
  background: var(--admin-card-soft); color: var(--admin-text-soft); font-size: 12px;
  font-family: inherit; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-page .act-btn:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.admin-page .act-btn.danger:hover { border-color: var(--admin-danger); color: var(--admin-danger); }
.admin-page .act-btn.success:hover { border-color: var(--admin-success); color: var(--admin-success); }

.admin-page .pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; padding: 16px;
}
.admin-page .page-btn {
  padding: 6px 12px; border: 1px solid var(--admin-line); border-radius: 8px;
  background: var(--admin-card-soft); color: var(--admin-text-soft); font-size: 13px;
  font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.admin-page .page-btn:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.admin-page .page-btn.active { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }
.admin-page .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-page .page-info { color: var(--admin-text-soft); font-size: 13px; }

.admin-page .admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 28px 0 16px;
}
.admin-page .admin-section-header h3 {
  font-size: 16px; font-weight: 700; color: var(--admin-text);
}
.admin-page .checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer;
}
.admin-page .modal-field .checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; font-size: 13px; cursor: pointer;
  color: var(--admin-text-soft); margin-bottom: 0;
}
.admin-page .modal-field .checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--admin-primary); cursor: pointer;
}

/* ---- 弹窗 ---- */
.admin-page .modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.admin-page .modal-overlay.open { display: flex; }
.admin-page .modal-box {
  background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 16px;
  padding: 28px; width: min(520px, 100%); max-height: 80vh; overflow: auto;
  animation: adminModalIn 0.2s ease;
}
@keyframes adminModalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.admin-page .modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.admin-page .modal-close {
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: var(--admin-card-soft); color: var(--admin-text-soft); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.admin-page .modal-close:hover { background: rgba(244,63,94,0.15); color: var(--admin-danger); }
.admin-page .modal-field { margin-bottom: 14px; }
.admin-page .modal-field label { display: block; font-size: 12px; font-weight: 600; color: var(--admin-text-soft); margin-bottom: 6px; }
.admin-page .modal-field input, .admin-page .modal-field select, .admin-page .modal-field textarea {
  width: 100%; border: 1px solid var(--admin-line); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; font-family: inherit;
  background: var(--admin-card-soft); color: var(--admin-text); outline: none;
  transition: border-color 0.2s;
}
.admin-page .modal-field input:focus, .admin-page .modal-field select:focus { border-color: var(--admin-primary); }
.admin-page .modal-field select { appearance: none; cursor: pointer; }
.admin-page .modal-field textarea { min-height: 60px; resize: vertical; }
.admin-page .modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.admin-page .m-btn {
  padding: 9px 18px; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.admin-page .m-btn-primary { background: var(--admin-primary); color: #fff; }
.admin-page .m-btn-primary:hover { background: var(--admin-primary-deep); }
.admin-page .m-btn-danger { background: var(--admin-danger); color: #fff; }
.admin-page .m-btn-danger:hover { background: #e11d48; }
.admin-page .m-btn-cancel { background: var(--admin-card-soft); color: var(--admin-text-soft); border: 1px solid var(--admin-line); }
.admin-page .m-btn-cancel:hover { border-color: var(--admin-text-soft); }

/* ---- 消息列表 ---- */
.admin-page .msg-list { display: flex; flex-direction: column; gap: 10px; }
.admin-page .msg-item {
  padding: 12px; border-radius: 10px; font-size: 13px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.admin-page .msg-user { background: rgba(129,140,248,0.1); border: 1px solid rgba(129,140,248,0.2); }
.admin-page .msg-assistant { background: var(--admin-card-soft); border: 1px solid var(--admin-line); }
.admin-page .msg-role { font-weight: 600; margin-bottom: 4px; font-size: 12px; }
.admin-page .msg-role.user-role { color: var(--admin-primary); }
.admin-page .msg-role.ai-role { color: var(--admin-accent); }
.admin-page .empty-msg { text-align: center; padding: 30px; color: var(--admin-text-soft); font-size: 13px; }

.admin-page .conv-list { display: flex; flex-direction: column; gap: 6px; }
.admin-page .conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--admin-line); border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
}
.admin-page .conv-item:hover { border-color: var(--admin-primary); background: rgba(129,140,248,0.05); }
.admin-page .conv-title { flex: 1; font-size: 13px; }
.admin-page .conv-meta { font-size: 11px; color: var(--admin-text-soft); white-space: nowrap; }

@media (max-width: 768px) {
  .admin-page .admin-body { padding: 12px; }
  .admin-page .data-table { font-size: 12px; }
  .admin-page .data-table th, .admin-page .data-table td { padding: 8px 10px; }
  .admin-page .stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-page .modal-box { padding: 20px; }
}

/* ---- 违规标记 & 紧急访问 样式 ---- */
.admin-page .badge-flagged {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: rgba(245, 158, 11, 0.15); color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.admin-page .conv-item.soft-deleted {
  opacity: 0.55; border-style: dashed;
}
.admin-page .conv-item.soft-deleted .conv-title::after {
  content: ' (已删除)'; font-size: 11px; color: var(--admin-danger); font-weight: 400;
}
.admin-page .emergency-pulse {
  animation: emergencyPulse 2s ease-in-out infinite;
}
@keyframes emergencyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
