/* ============================================
   主题系统 CSS（注入到所有页面）
   - 亮色（默认）：字节蓝 Arco Design（对标主站）
   - 暗色：深海蓝 Glass 高级感
   - 内嵌 Tailwind 兼容层（应急使用）
   ============================================ */

/* ===== 主题变量定义 ===== */
:root, [data-theme="light"] {
  --bg-base: #f7f8fa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f2f3f5;
  --bg-active: #E6EFFF;
  --bg-overlay: rgba(0, 0, 0, 0.4);
  
  --border-base: #e5e6eb;
  --border-strong: #c9cdd4;
  --border-focus: #165DFF;
  
  --text-primary: #1d2129;
  --text-secondary: #4e5969;
  --text-tertiary: #86909c;
  --text-disabled: #c9cdd4;
  --text-inverse: #ffffff;
  
  --brand-primary: #165DFF;
  --brand-primary-hover: #0E50E5;
  --brand-primary-active: #0f4acc;
  --brand-light: #E6EFFF;
  --brand-text: #165DFF;
  
  --success: #00b42a;
  --success-light: #e8ffea;
  --warning: #ff7d00;
  --warning-light: #fff7e8;
  --danger: #f53f3f;
  --danger-light: #ffece8;
  --info: #165DFF;
  --info-light: #E6EFFF;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

[data-theme="dark"] {
  --bg-base: #0a0e1a;
  --bg-surface: rgba(15, 23, 42, 0.5);
  --bg-elevated: rgba(15, 23, 42, 0.7);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(56, 189, 248, 0.15);
  --bg-overlay: rgba(0, 0, 0, 0.6);
  
  --border-base: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-focus: #38bdf8;
  
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-disabled: #475569;
  --text-inverse: #0a0e1a;
  
  --brand-primary: #38bdf8;
  --brand-primary-hover: #0ea5e9;
  --brand-primary-active: #0284c7;
  --brand-light: rgba(56, 189, 248, 0.15);
  --brand-text: #38bdf8;
  
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.15);
  --warning: #fb923c;
  --warning-light: rgba(251, 146, 60, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
  --info: #38bdf8;
  --info-light: rgba(56, 189, 248, 0.15);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
}

/* ===== 基础 reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
table { border-collapse: collapse; width: 100%; }
ul, ol { list-style: none; }

/* ===== Flex 工具类（Tailwind 兼容） ===== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-2\.5 { gap: 10px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-10 { gap: 40px; }
.gap-12 { gap: 48px; }

/* ===== Grid ===== */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== Spacing ===== */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-1\.5 > * + * { margin-top: 6px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-1\.5 { margin-top: 6px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-10 { margin-top: 40px; }
.mt-12 { margin-top: 48px; }
.mt-16 { margin-top: 64px; }
.mt-20 { margin-top: 80px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mb-12 { margin-bottom: 48px; }
.mb-16 { margin-bottom: 64px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-2\.5 { padding: 10px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.p-10 { padding: 40px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-8 { padding-left: 32px; padding-right: 32px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-5 { padding-top: 20px; }
.pb-3 { padding-bottom: 12px; }
.pl-3 { padding-left: 12px; }
.pl-5 { padding-left: 20px; }
.pr-3 { padding-right: 12px; }

/* ===== Size ===== */
.w-1 { width: 4px; }
.w-1\.5 { width: 6px; }
.w-2 { width: 8px; }
.w-2\.5 { width: 10px; }
.w-3 { width: 12px; }
.w-4 { width: 16px; }
.w-5 { width: 20px; }
.w-6 { width: 24px; }
.w-7 { width: 28px; }
.w-8 { width: 32px; }
.w-9 { width: 36px; }
.w-10 { width: 40px; }
.w-12 { width: 48px; }
.w-14 { width: 56px; }
.w-16 { width: 64px; }
.w-20 { width: 80px; }
.w-24 { width: 96px; }
.w-32 { width: 128px; }
.w-40 { width: 160px; }
.w-48 { width: 192px; }
.w-56 { width: 224px; }
.w-60 { width: 240px; }
.w-64 { width: 256px; }
.w-72 { width: 288px; }
.w-80 { width: 320px; }
.w-96 { width: 384px; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }

.h-1 { height: 4px; }
.h-1\.5 { height: 6px; }
.h-2 { height: 8px; }
.h-2\.5 { height: 10px; }
.h-3 { height: 12px; }
.h-4 { height: 16px; }
.h-5 { height: 20px; }
.h-6 { height: 24px; }
.h-7 { height: 28px; }
.h-8 { height: 32px; }
.h-9 { height: 36px; }
.h-10 { height: 40px; }
.h-12 { height: 48px; }
.h-14 { height: 56px; }
.h-16 { height: 64px; }
.h-20 { height: 80px; }
.h-24 { height: 96px; }
.h-32 { height: 128px; }
.h-40 { height: 160px; }
.h-48 { height: 192px; }
.h-64 { height: 256px; }
.h-96 { height: 384px; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

.min-h-screen { min-height: 100vh; }
.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-7xl { max-width: 1280px; }
.min-w-0 { min-width: 0; }

/* ===== Position ===== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.-top-3 { top: -12px; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.-z-1 { z-index: -1; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }

/* ===== Text ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.align-middle { vertical-align: middle; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }
.text-5xl { font-size: 48px; }
.text-6xl { font-size: 60px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, SFMono-Regular, monospace; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ===== Color ===== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-disabled { color: var(--text-disabled); }
.text-inverse { color: var(--text-inverse); }
.text-brand { color: var(--brand-text); }
.text-white { color: #fff; }
.text-red-500 { color: #f53f3f; }
.text-amber-500 { color: #f59e0b; }
.text-emerald-500 { color: #00b42a; }
.text-blue-500 { color: #3b82f6; }
.text-orange-500 { color: #f97316; }
.text-purple-500 { color: #a855f7; }
.text-pink-500 { color: #ec4899; }
.text-indigo-500 { color: #6366f1; }
.text-cyan-500 { color: #06b6d4; }
.text-slate-500 { color: #64748b; }
.text-green-400 { color: #4ade80; }
.text-yellow-400 { color: #facc15; }

.bg-white { background: #fff; }
.bg-black { background: #000; }
.bg-transparent { background: transparent; }
.bg-base { background: var(--bg-base); }
.bg-brand-light { background: var(--brand-light); }
.bg-red-500 { background: #f53f3f; }
.bg-amber-500 { background: #f59e0b; }
.bg-emerald-500 { background: #00b42a; }
.bg-emerald-400 { background: #4ade80; }
.bg-blue-500 { background: #3b82f6; }
.bg-orange-500 { background: #f97316; }
.bg-purple-500 { background: #a855f7; }
.bg-pink-500 { background: #ec4899; }
.bg-indigo-500 { background: #6366f1; }
.bg-cyan-500 { background: #06b6d4; }
.bg-slate-500 { background: #64748b; }
.bg-green-400 { background: #4ade80; }
.bg-yellow-400 { background: #facc15; }
.bg-gradient-to-br { background: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background: linear-gradient(to right, var(--tw-gradient-stops)); }

/* ===== Border ===== */
.border { border: 1px solid var(--border-base); }
.border-0 { border: 0; }
.border-2 { border-width: 2px; border-style: solid; border-color: var(--border-base); }
.border-4 { border-width: 4px; border-style: solid; border-color: var(--border-base); }
.border-b { border-bottom: 1px solid var(--border-base); }
.border-t { border-top: 1px solid var(--border-base); }
.border-l { border-left: 1px solid var(--border-base); }
.border-l-4 { border-left: 4px solid var(--border-base); }
.border-r { border-right: 1px solid var(--border-base); }
.border-dashed { border-style: dashed; }
.border-solid { border-style: solid; }
.border-base { border-color: var(--border-base); }
.border-brand-primary { border-color: var(--brand-primary); }
.border-white { border-color: #fff; }
.border-red-500 { border-color: #f53f3f; }
.border-amber-500 { border-color: #f59e0b; }
.border-orange-500 { border-color: #f97316; }
.border-emerald-500 { border-color: #00b42a; }
.border-blue-500 { border-color: #3b82f6; }
.border-purple-500 { border-color: #a855f7; }
.border-pink-500 { border-color: #ec4899; }
.border-indigo-500 { border-color: #6366f1; }
.border-cyan-500 { border-color: #06b6d4; }

/* ===== Radius ===== */
.rounded { border-radius: 4px; }
.rounded-sm { border-radius: 2px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* ===== Shadow ===== */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ===== Transition ===== */
.transition { transition: all 0.15s; }
.transition-all { transition: all 0.3s; }
.transition-colors { transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.transition-opacity { transition: opacity 0.2s; }
.transition-transform { transition: transform 0.2s; }
.duration-150 { transition-duration: 0.15s; }
.duration-200 { transition-duration: 0.2s; }
.duration-300 { transition-duration: 0.3s; }
.duration-500 { transition-duration: 0.5s; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.hover\:bg-base:hover { background: var(--bg-hover); }
.hover\:bg-brand-light:hover { background: var(--brand-light); }
.hover\:text-primary:hover { color: var(--text-primary); }
.hover\:text-brand:hover { color: var(--brand-text); }
.hover\:text-red-500:hover { color: var(--danger); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:no-underline:hover { text-decoration: none; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-110:hover { transform: scale(1.10); }
.hover\:-translate-y-1:hover { transform: translateY(-4px); }
.hover\:opacity-80:hover { opacity: 0.8; }
.hover\:opacity-100:hover { opacity: 1; }
.hover\:border-brand-primary:hover { border-color: var(--brand-primary); }
.hover\:border-red-500:hover { border-color: var(--danger); }
.hover\:bg-red-500:hover { background: var(--danger); color: #fff; }
.hover\:bg-brand:hover { background: var(--brand-primary); color: #fff; }
.group:hover .group-hover\:text-brand { color: var(--brand-text); }
.group:hover .group-hover\:translate-x-1 { transform: translateX(4px); }

/* ===== Transform ===== */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)); }
.scale-105 { --tw-scale-x: 1.05; --tw-scale-y: 1.05; transform: scale(1.05); }
.translate-y-1 { --tw-translate-y: 4px; }
.-translate-y-1 { --tw-translate-y: -4px; }

/* ===== Animation ===== */
.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.animate-fade-in { animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-up { animation: slideUp 0.4s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-bounce { animation: bounce 1s infinite; }
@keyframes bounce { 50% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } }

/* ===== 装饰背景 ===== */
.bg-grid {
  background-image:
    linear-gradient(rgba(22, 93, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 93, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
[data-theme="dark"] .bg-grid {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
}
.bg-dot-pattern {
  background-image: radial-gradient(circle, var(--border-base) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ===== ECharts 防御性样式 ===== */
.echarts-container, [id^="chart_"], [id^="radarChart"], [id^="barChart"], [id^="industryChart"], [id^="sentimentChart"], [id^="typeChart"] {
  transform: none !important;
  rotate: 0deg !important;
}
canvas { transform: none !important; }

/* ===== Whitespace ===== */
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.break-all { word-break: break-all; }

/* ===== 进度条 ===== */
.progress { width: 100%; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand-primary); border-radius: 3px; transition: width 0.6s; }
.progress-thin { height: 4px; }
.progress-thick { height: 8px; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-tertiary); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-title { color: var(--text-primary); font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.empty-state-desc { font-size: 12px; }

/* ===== Divider ===== */
.divider { height: 1px; background: var(--border-base); margin: 12px 0; }
.divider-vertical { width: 1px; background: var(--border-base); margin: 0 12px; }

/* ===== 提示框 ===== */
.alert { padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin: 8px 0; border-left: 3px solid; }
.alert-info { background: var(--info-light); color: var(--info); border-color: var(--info); }
.alert-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ===== 头像 ===== */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 500; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-xl { width: 56px; height: 56px; font-size: 20px; }

/* ===== Skeleton ===== */
.skeleton { background: linear-gradient(90deg, var(--bg-hover) 0%, var(--border-base) 50%, var(--bg-hover) 100%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Theme-aware utilities ===== */
.surface {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  transition: all 0.3s;
  transform: none !important;
  rotate: 0deg !important;
}
.surface-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary);
}
.bg-brand { background: var(--brand-primary); }
.bg-hero { background: linear-gradient(135deg, var(--brand-primary) 0%, #722ed1 100%); }

/* Arco 风格输入 */
.arco-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 14px;
  width: 100%;
  color: var(--text-primary);
  transition: all 0.2s;
  outline: none;
}
.arco-input:hover { border-color: var(--border-focus); }
.arco-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.15); }
.arco-input::placeholder { color: var(--text-tertiary); }

/* Arco 风格按钮 */
.arco-btn-primary {
  background: var(--brand-primary);
  color: white;
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  cursor: pointer;
}
.arco-btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}
.arco-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.arco-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.arco-btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-text);
}
.arco-btn-danger {
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.arco-btn-danger:hover { background: #d73527; }

/* 侧边栏 */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-base);
  backdrop-filter: blur(20px);
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: var(--bg-active);
  color: var(--brand-text);
  font-weight: 500;
}

/* 顶栏 */
.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-base);
  backdrop-filter: blur(20px);
}

/* Arco Tag */
.arco-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 20px;
  border-radius: var(--radius-sm);
  font-weight: 400;
}
.tag-blue { background: var(--brand-light); color: var(--brand-text); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: var(--bg-hover); color: var(--text-secondary); }
.tag-purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

/* 表格 */
.table-row { transition: background 0.15s; }
.table-row:hover { background: var(--bg-hover); }
.table-header {
  background: var(--bg-hover);
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: left;
  font-weight: 500;
}
.table-header th { padding: 12px 16px; }

/* 主题切换按钮 */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border-base);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.theme-toggle:hover {
  background: var(--bg-active);
  color: var(--brand-text);
  border-color: var(--brand-primary);
}
.theme-toggle svg { width: 18px; height: 18px; }

/* 卡片 */
.card-gradient {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-hover) 100%);
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* 暗色模式动画背景 */
[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
}
[data-theme="dark"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black 0%, transparent 80%);
  pointer-events: none;
}

/* 表单 */
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
input[type="radio"] { width: 16px; height: 16px; cursor: pointer; }
  风格：字节蓝 Arco Design + 大量留白 + 圆角 + 微动效
  ============================================ -->
  /* ===== 卡片层级 ===== */
  .card-elevated {
    background: var(--bg-elevated);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .card-elevated:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary);
    transform: translateY(-2px);
  }
  .card-gradient {
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--bg-elevated) 100%);
  }

  /* ===== 大数字卡 ===== */
  .stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative; overflow: hidden;
    transition: all 0.3s;
  }
  .stat-card:hover { box-shadow: var(--shadow-md); }
  .stat-card::before {
    content: ''; position: absolute; top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, var(--brand-light) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.3s;
  }
  .stat-card:hover::before { opacity: 0.5; }
  .stat-card-content { position: relative; }
  .stat-label { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }
  .stat-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-top: 8px; line-height: 1.2; }
  .stat-suffix { font-size: 14px; color: var(--text-tertiary); font-weight: 400; margin-left: 4px; }
  .stat-trend { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
  .stat-trend.up { color: var(--success); }
  .stat-trend.down { color: var(--danger); }
  .stat-icon { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

  /* ===== 按钮系列 ===== */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; transition: all 0.2s; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
  .btn-primary { background: var(--brand-primary); color: #fff; }
  .btn-primary:hover { background: var(--brand-primary-hover); box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3); transform: translateY(-1px); }
  .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
  .btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
  .btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-text); }
  .btn-ghost { background: transparent; color: var(--text-secondary); }
  .btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover { background: #d73527; }
  .btn-success { background: var(--success); color: #fff; }
  .btn-warning { background: var(--warning); color: #fff; }
  .btn-sm { padding: 4px 10px; font-size: 12px; }
  .btn-lg { padding: 12px 24px; font-size: 16px; }
  .btn-icon { padding: 6px; width: 32px; height: 32px; }

  /* ===== 标签 Badge ===== */
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5; }
  .badge-blue { background: var(--brand-light); color: var(--brand-text); }
  .badge-green { background: var(--success-light); color: var(--success); }
  .badge-orange { background: var(--warning-light); color: var(--warning); }
  .badge-red { background: var(--danger-light); color: var(--danger); }
  .badge-gray { background: var(--bg-hover); color: var(--text-secondary); }
  .badge-purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

  /* ===== 列表项 ===== */
  .list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-md);
    background: var(--bg-hover); transition: all 0.2s;
    border: 1px solid transparent;
  }
  .list-item:hover { background: var(--bg-active); border-color: var(--brand-primary); }
  .list-item-primary { flex: 1; min-width: 0; }
  .list-item-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
  .list-item-subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
  .list-item-meta { display: flex; align-items: center; gap: 8px; }

  /* ===== 区块标题 ===== */
  .section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
  }
  .section-title { display: flex; align-items: center; gap: 8px; }
  .section-title h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .section-title-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

  /* ===== 输入 ===== */
  .input {
    width: 100%; padding: 8px 12px; font-size: 14px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: all 0.2s; outline: none;
  }
  .input:hover { border-color: var(--border-focus); }
  .input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1); }
  .input::placeholder { color: var(--text-tertiary); }

  /* ===== 提示框 ===== */
  .callout {
    padding: 12px 16px; border-radius: var(--radius-md);
    font-size: 13px; line-height: 1.6;
    border-left: 3px solid; margin: 12px 0;
  }
  .callout-info { background: var(--info-light); color: var(--info); border-color: var(--info); }
  .callout-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
  .callout-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
  .callout-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

  /* ===== 进度条 ===== */
  .progress { width: 100%; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
  .progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-primary) 0%, #4080ff 100%); border-radius: 3px; transition: width 0.6s ease; }
  .progress-bar.success { background: linear-gradient(90deg, var(--success) 0%, #34d399 100%); }
  .progress-bar.warning { background: linear-gradient(90deg, var(--warning) 0%, #fb923c 100%); }
  .progress-bar.danger { background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%); }

  /* ===== 空状态 ===== */
  .empty-state { text-align: center; padding: 48px 20px; }
  .empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
  .empty-state-title { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
  .empty-state-desc { font-size: 13px; color: var(--text-tertiary); }

  /* ===== 渐入动画 ===== */
  .fade-in { animation: fadeIn 0.4s ease-out; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .stagger-1 { animation-delay: 0.05s; animation-fill-mode: backwards; }
  .stagger-2 { animation-delay: 0.1s; animation-fill-mode: backwards; }
  .stagger-3 { animation-delay: 0.15s; animation-fill-mode: backwards; }
  .stagger-4 { animation-delay: 0.2s; animation-fill-mode: backwards; }
</style>

/* ============================================
   统一设计语言 v3.0 (追加)
   ============================================ */

/* ===== 页面头部 ===== */
.page-header {
  display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important;
  padding: 20px 24px !important; background: var(--bg-elevated) !important; border-bottom: 1px solid var(--border-base) !important;
  position: sticky !important; top: 0 !important; z-index: 10 !important; flex-wrap: nowrap !important;
  min-height: 72px !important; width: 100% !important;
  gap: 16px;
}
.page-title { display: flex !important; flex-direction: column !important; gap: 4px !important; flex: 0 0 auto !important; }
.page-title h1 { font-size: 20px !important; font-weight: 600 !important; color: var(--text-primary) !important; display: flex !important; align-items: center !important; gap: 8px !important; margin: 0 !important; }
.page-title p { font-size: 12px !important; color: var(--text-tertiary) !important; margin: 0 !important; }
.page-actions { display: flex !important; align-items: center !important; gap: 12px !important; flex-shrink: 0 !important; margin-left: auto !important; }

/* ===== 卡片层级 ===== */
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-elevated:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}
.card-gradient {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--bg-elevated) 100%);
}

/* ===== 统计卡 ===== */
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: all 0.3s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-content { position: relative; }
.stat-label { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-top: 8px; line-height: 1.2; }
.stat-suffix { font-size: 14px; color: var(--text-tertiary); font-weight: 400; margin-left: 4px; }
.stat-trend { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-icon { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* ===== 按钮系列 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; transition: all 0.2s; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-hover); box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-text); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d73527; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }

/* ===== 标签 Badge ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.6; }
.badge-blue { background: var(--brand-light); color: var(--brand-text); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: var(--bg-hover); color: var(--text-secondary); }
.badge-purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

/* ===== 列表项 ===== */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--bg-hover); transition: all 0.2s;
  border: 1px solid transparent;
}
.list-item:hover { background: var(--bg-active); border-color: var(--brand-primary); }
.list-item-primary { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.list-item-subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.list-item-meta { display: flex; align-items: center; gap: 8px; }

/* ===== 区块标题 ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
.section-title-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* ===== 输入 ===== */
.input { width: 100%; padding: 8px 12px; font-size: 14px; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: all 0.2s; outline: none; }
.input:hover { border-color: var(--border-focus); }
.input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1); }
.input::placeholder { color: var(--text-tertiary); }

/* ===== 提示框 ===== */
.callout { padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.6; border-left: 3px solid; margin: 12px 0; }
.callout-info { background: var(--info-light); color: var(--info); border-color: var(--info); }
.callout-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.callout-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.callout-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ===== 进度条（带渐变） ===== */
.progress { width: 100%; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-primary) 0%, #4080ff 100%); border-radius: 3px; transition: width 0.6s ease; }
.progress-bar.success { background: linear-gradient(90deg, var(--success) 0%, #34d399 100%); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning) 0%, #fb923c 100%); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; color: var(--text-tertiary); }

/* ===== 渐入动画 ===== */
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.stagger-1 { animation-delay: 0.05s; animation-fill-mode: backwards; }
.stagger-2 { animation-delay: 0.1s; animation-fill-mode: backwards; }
.stagger-3 { animation-delay: 0.15s; animation-fill-mode: backwards; }
.stagger-4 { animation-delay: 0.2s; animation-fill-mode: backwards; }
