﻿/**
 * 澶ф垚鐒婃帴 - 璁捐绯荤粺 (Design System)
 * 鐗堟湰: 1.0.0
 * 鏇存柊: 2026-05-07
 * 
 * 鍖呭惈: 璁捐浠ょ墝銆佷富棰樺彉閲忋€佸熀纭€閲嶇疆銆佸伐鍏风被
 */

/* ============================================
   1. 璁捐浠ょ墝 (Design Tokens)
   ============================================ */

:root {
  /* ---- 涓诲搧鐗岃壊 ---- */
  --primary: #E65C00;
  --primary-dark: #CC5200;
  --primary-light: #FF8C42;
  --primary-alpha-10: rgba(230, 92, 0, 0.1);
  --primary-alpha-15: rgba(230, 92, 0, 0.15);
  --primary-alpha-20: rgba(230, 92, 0, 0.2);

  /* ---- 杈呭姪鑹?---- */
  --secondary: #162136;
  --accent: #FF8C42;
  --success: #4CAF50;
  --warning: #FFC107;
  --error: #F44336;
  --info: #2196F3;

  /* ---- 鎵╁睍鑹叉澘锛堝尯鍒嗗害浼樺寲锛?--- */
  --steel: #2D3748;
  --steel-light: #4A5568;
  --steel-dark: #1A202C;

  /* ---- 瀛椾綋 ---- */
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-heading: 'Oswald', var(--font-sans);
  
  /* 瀛楀彿绯荤粺 */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  
  /* 瀛楅噸 */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-black: 900;

  /* ---- 闂磋窛绯荤粺 (4px 鍩哄噯) ---- */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */

  /* ---- 鍦嗚 ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ---- 闃村奖 ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 8px 25px rgba(230, 92, 0, 0.35);
  --shadow-card: 0 12px 40px rgba(230, 92, 0, 0.12);
  --shadow-card-hover: 0 12px 40px rgba(230, 92, 0, 0.2);

  /* ---- 鍔ㄧ敾 ---- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* ---- Z-Index 灞傜骇 ---- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 500;
  --z-modal-backdrop: 800;
  --z-modal: 900;
  --z-tooltip: 1000;
}

/* ============================================
   2. 涓婚鍙橀噺 (Theme Variables)
   ============================================ */

/* ---- 娣辫壊涓婚 (榛樿) ---- */
[data-theme="dark"],
:root {
  --bg-primary: #0A0A14;
  --bg-secondary: #141428;
  --bg-tertiary: #1E1E38;
  --bg-card: #141428;
  --bg-overlay: rgba(10, 10, 20, 0.95);
  --text-primary: #E8E8EC;
  --text-secondary: #B8B8CC;
  --text-muted: #8888A8;
  --text-disabled: #555570;
  --border-color: #2A2A48;
  --border-light: #222240;
  --gradient-start: #0A0510;
  --gradient-end: #0F0F1A;
  --header-bg: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  --header-text: #ffffff;
  --header-text-muted: #8888A8;
  --footer-bg: #16162A;
  --footer-text: #9A9AAF;
  --footer-brand: #E8E8E8;
  --footer-border: #2A2A40;
  color-scheme: dark;
}

/* ---- 娴呰壊涓婚 ---- */
[data-theme="light"] {
  --bg-primary: #F8F9FC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EEF1F7;
  --bg-card: #FFFFFF;
  --bg-overlay: rgba(255, 255, 255, 0.95);
  --text-primary: #1A1A2E;
  --text-secondary: #2D3748;
  --text-muted: #4A5568;
  --text-disabled: #BBBBCC;
  --border-color: #D1D5DB;
  --border-light: #E5E7EB;
  --gradient-start: #FFFFFF;
  --gradient-end: #F0F4FF;
  --header-bg: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  --header-text: #1A1A2E;
  --header-text-muted: #4A5568;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 30px rgba(230, 92, 0, 0.15);
  --shadow-primary: 0 8px 25px rgba(230, 92, 0, 0.25);
  /* AI宸ュ叿鍗＄墖娴呰壊涓婚 */
  --ai-card-bg: linear-gradient(135deg, #FFF7F0, #FFF0E8);
  --ai-card-border: #E65C00;
  --ai-card-bg-2: linear-gradient(135deg, #F0F7FF, #E8F0FF);
  --ai-card-border-2: #4CAF50;
  --footer-bg: #1a1a2e;
  --footer-text: #A0A0C0;
  --footer-brand: #f7fafc;
  --footer-border: #2A2A40;
  color-scheme: light;
}

/* 娴呰壊妯″紡涓媡heme-toggle澧炲己 */
[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.9);
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-option {
  color: #4A5568;
}

[data-theme="light"] .theme-toggle-option:hover {
  color: #1A1A2E;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle-option.active {
  color: #ffffff;
}

/* ---- 绯荤粺鍋忓ソ璺熼殢 ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg-primary: #F8F9FC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EEF1F7;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(255, 255, 255, 0.95);

    --text-primary: #1A1A2E;
    --text-secondary: #2D3748;
    --text-muted: #4A5568;
    --text-disabled: #BBBBCC;

    --border-color: #D1D5DB;
    --border-light: #E5E7EB;

    --gradient-start: #FFFFFF;
    --gradient-end: #F0F4FF;
    --header-bg: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    --header-text: #1A1A2E;
    --header-text-muted: #4A5568;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 30px rgba(230, 92, 0, 0.15);
    --shadow-primary: 0 8px 25px rgba(230, 92, 0, 0.25);

    /* AI宸ュ叿鍗＄墖娴呰壊涓婚 */
    --ai-card-bg: linear-gradient(135deg, #FFF7F0, #FFF0E8);
    --ai-card-border: #E65C00;
    --ai-card-bg-2: linear-gradient(135deg, #F0F7FF, #E8F0FF);
    --ai-card-border-2: #4CAF50;

    color-scheme: light;
  }

  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    border-color: #D1D5DB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle-option {
    color: #4A5568;
  }

  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle-option:hover {
    color: #1A1A2E;
    background: rgba(0, 0, 0, 0.05);
  }

  :root:not([data-theme="dark"]):not([data-theme="light"]) .theme-toggle-option.active {
    color: #ffffff;
  }
}

/* ============================================
   鍏煎鏃х増 index.html 鍙橀噺鍒悕
   (鍘熸湁鍐呰仈 CSS 浣跨敤 --bg-dark, --text, --border 绛?
   ============================================ */

:root {
  /* 鍏煎 --bg-dark, --bg (鍘熸湁鍐呰仈CSS浣跨敤) */
  --bg-dark: var(--bg-primary);
  --bg: var(--bg-primary);
  /* 鍏煎 --text (鍘熸湁鍐呰仈CSS浣跨敤) */
  --text: var(--text-primary);
  /* 鍏煎 --border (鍘熸湁鍐呰仈CSS浣跨敤) */
  --border: var(--border-color);
  /* 鍏煎 --steel, --steel-light (鍘熸湁鍐呰仈CSS浣跨敤) */
  --steel: var(--bg-secondary);
  --steel-light: var(--bg-tertiary);
}

/* 娣辫壊涓婚鍏煎鍙橀噺 */
[data-theme="dark"] {
  --bg-dark: #0A0A14;
  --bg: #0A0A14;
  --text: #E8E8EC;
  --border: #2A2A48;
  --steel: #1E1E38;
  --steel-light: #2A2A50;
}

/* 娴呰壊涓婚鍏煎鍙橀噺 */
[data-theme="light"] {
  --bg-dark: #F8F9FC;
  --bg: #F8F9FC;
  --text: #1A1A2E;
  --border: #E2E5EF;
  --steel: #FFFFFF;
  --steel-light: #EEF1F7;
}

/* 绯荤粺鍋忓ソ娴呰壊鍏煎 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg-dark: #F8F9FC;
    --bg: #F8F9FC;
    --text: #1A1A2E;
    --border: #E2E5EF;
    --steel: #FFFFFF;
    --steel-light: #EEF1F7;
  }
}

/* ============================================
   3. 鍩虹閲嶇疆 (CSS Reset)
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

/* 瑙︽懜浼樺寲 */
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 鍏佽鏂囨湰閫夋嫨 */
p, h1, h2, h3, h4, h5, h6, li, span, div {
  -webkit-user-select: text;
  user-select: text;
}

/* 閾炬帴 */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* 鎸夐挳閲嶇疆 */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* 鍥剧墖 */
img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 鍒楄〃 */
ul, ol {
  list-style: none;
}

/* 杈撳叆妗?*/
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ============================================
   4. 鎺掔増 (Typography)
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

strong {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--primary);
}

/* ============================================
   5. 婊氬姩鏉＄編鍖?   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* ============================================
   6. 鐒︾偣鏍峰紡 (Focus Styles)
   ============================================ */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================
   7. 杈呭姪绫?(Utilities)
   ============================================ */

/* 鏂囨湰 */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* 鏄剧ず */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* 寮规€у竷灞€ */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* 闂磋窛 */
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* 鍦嗚 */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* 闃村奖 */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-primary { box-shadow: var(--shadow-primary); }

/* 鍔ㄧ敾 */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

/* 姣涚幓鐠冩晥鏋?*/
.glass {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 鎴柇 */
.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;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 瑙嗚闅愯棌 (鍙闂€? */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   8. 涓婚鍒囨崲缁勪欢鏍峰紡锛堢嫭绔嬬増鏈級
   ============================================ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary, #141428);
  border: 1px solid var(--border-color, #2A2A48);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  transition: all 0.3s ease;
}

.theme-toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #8888A8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: 36px;
  min-height: 32px;
}

.theme-toggle-option:hover {
  color: var(--text-primary, #E8E8EC);
  background: rgba(255, 255, 255, 0.05);
}

.theme-toggle-option.active {
  background: var(--primary, #E65C00);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(230, 92, 0, 0.3);
}

.theme-toggle-option .icon {
  font-size: 14px;
}

/* 绉诲姩绔揣鍑戞ā寮?*/
@media (max-width: 480px) {
  .theme-toggle {
    padding: 2px;
  }

  .theme-toggle-option {
    padding: 4px 8px;
    font-size: 11px;
  }

  .theme-toggle-option .icon {
    font-size: 12px;
  }
}

