/* styles.css - 组件化CSS架构 */
/* ========================================
   【樱雨设计风格系统 - v3.1.0】
   模块化CSS架构 · 支持深浅色主题 · 组件化设计
=========================================== */

/* ===== 1. 全局样式模块 ===== */
:root {
  --sakura-pink: #FFB7C5;
  --sakura-deep: #FF9AA2;
  --sakura-light: #FFE4E9;
  --tech-blue: #3498DB;
  --tech-green: #2ECC71;
  --tech-yellow: #F1C40F;
  --tech-red: #E74C3C;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FF;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --island-bg: rgba(255, 255, 255, 0.95);
  --island-text: var(--sakura-deep);
  --island-border: rgba(255, 183, 197, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(255, 183, 197, 0.15);
  --shadow-lg: 0 10px 25px rgba(255, 183, 197, 0.2);
  --shadow-island: 0 20px 40px rgba(255, 183, 197, 0.25);
  --radius: 12px;
  --spacing: 1rem;
  --spacing-lg: calc(var(--spacing) * 1.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --echarts-bg: transparent;
}

/* 深色主题变量覆盖 */
body.dark-theme {
  --bg-primary: #1A202C;
  --bg-secondary: #2D3748;
  --bg-card: #2D3748;
  --border: #4A5568;
  --text-primary: #F7FAFC;
  --text-secondary: #E2E8F0;
  --text-muted: #A0AEC0;
  --island-bg: rgba(45, 55, 72, 0.98);
  --island-text: var(--sakura-pink);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-island: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* 全局重置与基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 120px;
  transition: var(--transition);
  min-height: 100vh;
  position: relative;
}

/* Particles.js 背景容器 */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--particles-bg);
  z-index: -1;
}

body.dark-theme #particles-js {
  background: var(--bg-secondary);
}

/* 可访问性增强 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.keyboard-nav .btn:focus,
.keyboard-nav .form-input:focus,
.keyboard-nav .tab:focus,
.keyboard-nav [role="button"]:focus {
  outline: 3px solid var(--sakura-pink);
  outline-offset: 2px;
  border-color: var(--sakura-pink) !important;
}

/* ===== 布局模块 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ===== 2. 导航模块 ===== */
.dynamic-island-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--island-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 8px 16px;
  box-shadow: var(--shadow-island);
  z-index: 1000;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 200px;
  max-width: 220px;
  height: 60px;
  border: 1px solid var(--island-border);
  color: var(--island-text);
  overflow: hidden;
}

.dynamic-island-nav:hover,
.dynamic-island-nav.expanded {
  max-width: 800px;
}

.dynamic-island-nav:hover .island-menu,
.dynamic-island-nav.expanded .island-menu {
  opacity: 1;
  visibility: visible;
  max-width: 600px;
}

.island-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--island-text);
  white-space: nowrap;
  font-family: 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
  transition: var(--transition);
}

.island-logo:hover .logo-icon {
  transform: rotate(15deg) scale(1.1);
}

.island-menu {
  display: flex;
  gap: 12px;
  max-width: 0;
  overflow: hidden;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  flex-grow: 1;
  justify-content: flex-end;
}

.island-item {
  color: var(--island-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

.island-item:hover {
  background: rgba(255, 183, 197, 0.2);
  transform: translateY(-2px);
  color: var(--sakura-deep);
}

.island-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--sakura-pink);
  transform: translateX(-50%);
  transition: width 0.3s;
}

.island-item:hover::after {
  width: 70%;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--island-text);
  transform: rotate(0deg);
  transition: transform 0.3s;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  border: none;
}

.dynamic-island-nav.scrolled {
  top: 10px;
  background: var(--island-bg);
}

/* ===== 3. 头部模块 ===== */
.hero-section {
  position: relative;
  padding-bottom: 40px;
  margin-bottom: 40px;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--sakura-pink) 0px,
    var(--sakura-pink) 15px,
    var(--tech-blue) 15px,
    var(--tech-blue) 30px,
    var(--tech-green) 30px,
    var(--tech-green) 45px,
    var(--tech-yellow) 45px,
    var(--tech-yellow) 60px
  );
  animation: divider-flow 3s linear infinite;
  border-radius: 4px;
}

@keyframes divider-flow {
  0% { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}

.title-main {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sakura-deep);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.version-badge {
  font-size: 1.2rem;
  background: var(--sakura-light);
  padding: 4px 12px;
  border-radius: 20px;
  color: var(--sakura-deep);
  font-weight: 600;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 40px;
  line-height: 1.7;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sakura-deep);
  margin: 50px 0 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--sakura-light);
}

/* ===== 4. 卡片模块 ===== */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 30px;
  transition: var(--transition);
  animation: fadeIn 0.4s ease-out;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--sakura-pink);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sakura-deep);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--sakura-light);
}

/* ===== 5. 信息框模块 ===== */
.tip-box, .warning-box, .info-box, .error-box {
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid;
  transition: var(--transition);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.tip-box:hover, .warning-box:hover, .info-box:hover, .error-box:hover {
  box-shadow: var(--shadow-sm);
}

.tip-box {
  border-color: var(--tech-blue);
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
}

.warning-box {
  border-color: var(--tech-yellow);
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
}

.info-box {
  border-color: var(--tech-green);
  background: linear-gradient(135deg, #F0FFF4, #E6FFFA);
}

.error-box {
  border-color: var(--tech-red);
  background: linear-gradient(135deg, #FFF5F5, #FFF0F0);
}

/* 深色模式下的信息框修复 */
body.dark-theme .tip-box {
  background: linear-gradient(135deg, #1E3A4A, #1A365D);
  border-left-color: var(--tech-blue);
}

body.dark-theme .warning-box {
  background: linear-gradient(135deg, #4A3C1A, #5F4B00);
  border-left-color: var(--tech-yellow);
}

body.dark-theme .info-box {
  background: linear-gradient(135deg, #1A4232, #0F2A1F);
  border-left-color: var(--tech-green);
}

body.dark-theme .error-box {
  background: linear-gradient(135deg, #4A1A1A, #5F0000);
  border-left-color: var(--tech-red);
}

.box-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-box .box-title { color: var(--tech-blue); }
.warning-box .box-title { color: var(--sakura-deep); }
.info-box .box-title { color: var(--tech-green); }
.error-box .box-title { color: var(--tech-red); }

/* 深色模式标题颜色调整 */
body.dark-theme .tip-box .box-title { color: #63B3ED; }
body.dark-theme .warning-box .box-title { color: #F6E05E; }
body.dark-theme .info-box .box-title { color: #68D391; }
body.dark-theme .error-box .box-title { color: #FC8181; }

/* ===== 6. 代码展示模块 ===== */
.code-block {
  font-family: 'Consolas', Monaco, 'Courier New', monospace;
  background: #1A202C;
  color: #E2E8F0;
  padding: 20px;
  border-radius: var(--radius);
  margin: 15px 0;
  overflow-x: auto;
  font-size: 0.85rem;
  border-left: 4px solid var(--sakura-pink);
  white-space: pre-wrap;
  line-height: 1.6;
  transition: var(--transition);
  cursor: pointer;
}

.code-block:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.code-inline {
  font-family: 'Consolas', Monaco, monospace;
  background: var(--sakura-light);
  color: var(--sakura-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

body.dark-theme .code-block {
  background: #0D1117;
  color: #C9D1D9;
}

/* ===== 7. 数据表格模块 ===== */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.param-table th {
  background: var(--bg-secondary);
  padding: 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--sakura-deep);
}

.param-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.param-table tr:hover {
  background: var(--sakura-light);
}

.param-table tr:nth-child(even) {
  background: var(--bg-secondary);
}

body.dark-theme .param-table tr:hover {
  background: rgba(255, 183, 197, 0.1);
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.success { background: var(--tech-green); }
.status-indicator.warning { background: var(--tech-yellow); }
.status-indicator.error { background: var(--tech-red); }
.status-indicator.info { background: var(--tech-blue); }

/* ===== 8. 按钮系统模块 ===== */
.button-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin: 20px 0;
}

.btn {
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  outline: none;
  user-select: none;
  white-space: nowrap;
}

/* 修复按钮尺寸过大的问题 */
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-xl { padding: 14px 32px; font-size: 1.05rem; }

.btn-primary {
  background: var(--sakura-pink);
  color: white;
}

.btn-primary:hover {
  background: var(--sakura-deep);
  transform: translateY(-3px);
}

.btn-secondary {
  background: var(--tech-blue);
  color: white;
}

.btn-success { background: var(--tech-green); color: white; }
.btn-warning { background: var(--tech-yellow); color: var(--text-primary); }
.btn-danger { background: var(--tech-red); color: white; }

.btn-ghost-primary {
  background: transparent;
  color: var(--sakura-pink);
  border: 2px solid var(--sakura-pink);
}

.btn-ghost-secondary {
  background: transparent;
  color: var(--tech-blue);
  border: 2px solid var(--tech-blue);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== 9. 表单模块 ===== */
.form-showcase { max-width: 600px; }

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--sakura-pink);
  box-shadow: 0 0 0 3px rgba(255, 183, 197, 0.2);
}

.form-input.success { border-color: var(--tech-green); }
.form-input.error { border-color: var(--tech-red); }

.form-hint {
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 500;
  transition: color 0.3s;
  color: var(--text-muted);
}

.form-hint.success { color: var(--tech-green); }
.form-hint.error { color: var(--tech-red); }

/* 复选框和单选框 */
.checkbox-group, .radio-group { margin-bottom: 15px; }

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.checkbox-input, .radio-input { display: none; }

.checkbox-custom, .radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: var(--transition);
}

.radio-custom { border-radius: 50%; }

.checkbox-input:checked + .checkbox-custom {
  background: var(--sakura-pink);
  border-color: var(--sakura-pink);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
}

.radio-input:checked + .radio-custom {
  background: var(--sakura-pink);
  border-color: var(--sakura-pink);
}

.radio-input:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* 开关 */
.switch-group { margin-bottom: 20px; }

.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
}

.switch-input { display: none; }

.switch-custom {
  width: 48px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
}

.switch-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.switch-input:checked + .switch-custom { background: var(--sakura-pink); }
.switch-input:checked + .switch-custom::after { left: 27px; }

/* 滑块 */
.slider-group { margin-bottom: 20px; }

.slider-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.slider-input {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  transition: background 0.3s;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sakura-pink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.slider-input::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-value {
  min-width: 50px;
  font-weight: 600;
  color: var(--sakura-deep);
}

/* ===== 10. 标签页模块 ===== */
.tab-container {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}

.tab {
  padding: 12px 24px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--sakura-pink);
  transform: translateX(-50%);
  transition: width 0.3s;
}

.tab:hover {
  background: var(--sakura-light);
  border-color: var(--sakura-pink);
}

.tab.active {
  background: var(--sakura-pink);
  color: white;
  border-color: var(--sakura-pink);
}

.tab.active::after { width: 100%; }

.tab-content {
  padding: 20px;
  border: 2px solid var(--border);
  border-top: none;
  display: none;
}

.tab-content:first-of-type { display: block; }

/* ===== 11. 卡片网格模块 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.gradient-bg {
  background: linear-gradient(135deg, var(--bg-secondary), var(--sakura-light));
}

/* ===== 12. 步骤条模块 ===== */
.step-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  gap: 20px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}

.step.active .step-icon {
  background: var(--sakura-pink);
  color: white;
}

.step-title {
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.step.active .step-title { color: var(--sakura-deep); }

.step-connector {
  flex-grow: 1;
  height: 2px;
  background: var(--border);
  max-width: 60px;
}

/* ===== 13. 展示网格模块 ===== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.animation-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.animation-item {
  display: flex;
  justify-content: center;
  align-items: center;
}

.demo-box {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.demo-box:hover { border-color: var(--sakura-pink); }

.animation-test-area {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-container {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.loading-demo { margin-top: 15px; }

.search-results { margin-top: 20px; }

.dynamic-content-area {
  margin-top: 20px;
}

/* ===== 14. 徽章模块 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.badge-primary { background: var(--sakura-pink); color: white; }
.badge-secondary { background: var(--tech-blue); color: white; }
.badge-success { background: var(--tech-green); color: white; }
.badge-warning { background: var(--tech-yellow); color: var(--text-primary); }
.badge-danger { background: var(--tech-red); color: white; }
.badge-lg { padding: 8px 16px; font-size: 1rem; }
.badge-sm { padding: 4px 8px; font-size: 0.75rem; }

/* ===== 15. 加载动画模块 ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--sakura-light) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-line {
  height: 20px;
  margin-bottom: 10px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-ring {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-ring-circle {
  stroke: var(--sakura-pink);
  stroke-dasharray: 226.2;
  stroke-dashoffset: 226.2;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.5s;
  fill: transparent;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  color: var(--sakura-deep);
}

/* ===== 16. 模态框模块 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.show .modal-content { transform: translateY(0); }

/* ===== 17. 步骤卡片模块 ===== */
.step-card {
  padding: 20px;
  margin: 15px 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--sakura-pink);
  transform: translateX(10px);
}

.step-card.highlight {
  background: var(--sakura-light);
  border-color: var(--sakura-pink);
}

.step-number {
  font-size: 2rem;
  margin-bottom: 10px;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sakura-deep);
  margin-bottom: 8px;
}

/* ===== 18. 通知系统模块 ===== */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}

.notification {
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border-left: 4px solid;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.3s forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.notification.success {
  border-color: var(--tech-green);
  background: linear-gradient(135deg, #F0FFF4, #E6FFFA);
}

.notification.warning {
  border-color: var(--tech-yellow);
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
}

.notification.error {
  border-color: var(--tech-red);
  background: linear-gradient(135deg, #FFF5F5, #FFF0F0);
}

.notification.info {
  border-color: var(--tech-blue);
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
}

/* 深色模式通知样式 */
body.dark-theme .notification {
  border-left-width: 4px;
}

body.dark-theme .notification.success {
  background: linear-gradient(135deg, #1A4232, #0F2A1F);
  border-left-color: var(--tech-green);
}

body.dark-theme .notification.warning {
  background: linear-gradient(135deg, #4A3C1A, #5F4B00);
  border-left-color: var(--tech-yellow);
}

body.dark-theme .notification.error {
  background: linear-gradient(135deg, #4A1A1A, #5F0000);
  border-left-color: var(--tech-red);
}

body.dark-theme .notification.info {
  background: linear-gradient(135deg, #1E3A4A, #1A365D);
  border-left-color: var(--tech-blue);
}

.notification-title {
  font-weight: 700;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

body.dark-theme .notification-content { color: var(--text-secondary); }

/* ===== 19. 主题切换器模块 ===== */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  justify-content: center;
}

.toggle-container span {
  color: var(--text-primary);
}

/* ===== 20. 搜索过滤模块 ===== */
.search-item {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  transition: var(--transition);
  cursor: pointer;
  color: var(--text-primary);
}

.search-item:hover {
  border-color: var(--sakura-pink);
  transform: translateY(-2px);
}

.search-item.hidden {
  display: none;
}

/* ===== 21. 图片懒加载模块 ===== */
.image-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.image-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

.lazy-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.lazy-image.loaded { opacity: 1; }

.image-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== 22. 评分组件模块（修复） ===== */
.rating-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 2.5rem;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  justify-content: center;
  transition: var(--transition);
}

.rating-container:hover {
  border-color: var(--sakura-pink);
}

.star {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s, text-shadow 0.3s, filter 0.3s;
  user-select: none;
  color: var(--text-muted);
  font-size: 2.5rem;
  line-height: 1;
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.star:hover {
  transform: scale(1.15) translateY(-2px);
  color: var(--tech-yellow);
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.4));
}

.star.active {
  color: var(--sakura-pink);
  text-shadow: 0 0 12px rgba(255, 183, 197, 0.6);
  animation: starPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.star.active:hover {
  color: var(--sakura-deep);
  transform: scale(1.2) translateY(-3px);
  filter: drop-shadow(0 0 12px rgba(255, 154, 162, 0.6));
}

@keyframes starPulse {
  0% { transform: scale(0.8) rotate(0deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.star::before {
  content: '★';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 悬停预览效果 - 显示半星 */
.star.hover-half::before {
  content: '✩';
  color: var(--tech-yellow);
  opacity: 0.7;
}

.rating-text {
  margin-left: 15px;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: color 0.3s;
  font-weight: 600;
}

.rating-text.highlight {
  color: var(--sakura-deep);
  font-weight: 700;
}

/* ===== 23. 轮播图模块 ===== */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}

.carousel-wrapper {
  display: flex;
  transition: transform 0.5s ease-out;
}

.carousel-slide {
  min-width: 100%;
  padding: 20px;
}

.carousel-content {
  background: var(--sakura-pink);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: var(--radius);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--bg-secondary);
}

.carousel-indicators {
  display: flex;
  gap: 8px;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.indicator.active {
  background: var(--sakura-pink);
  width: 30px;
  border-radius: 5px;
}

/* ===== 24. 浮动按钮组模块 ===== */
.floating-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fab-item {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sakura-pink);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.fab-item:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: var(--shadow-island);
  background: var(--sakura-deep);
}

.fab-item::after {
  content: attr(title);
  position: absolute;
  right: 70px;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.fab-item:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 深色模式浮动按钮 */
body.dark-theme .fab-item {
  background: var(--sakura-deep);
}

body.dark-theme .fab-item:hover {
  background: var(--sakura-pink);
}

body.dark-theme .fab-item::after {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ===== 25. 波纹动画修复 ===== */
@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

/* ===== 26. 工具提示模块 ===== */
.tooltip {
  position: absolute;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 10000;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  border: 8px solid transparent;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* 工具提示位置 */
.tooltip.top::after {
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--bg-primary);
}

.tooltip.bottom::after {
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--bg-primary);
}

.tooltip.left::after {
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--bg-primary);
}

.tooltip.right::after {
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--bg-primary);
}

/* ===== 27. 折叠面板模块 ===== */
.accordion-container {
  margin: 20px 0;
}

.accordion-item {
  margin-bottom: 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item:hover {
  border-color: var(--sakura-pink);
}

.accordion-header {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: none;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-header:hover {
  background: var(--sakura-light);
  color: var(--sakura-deep);
}

.accordion-header.active {
  background: var(--sakura-pink);
  color: white;
  border-bottom-color: var(--sakura-pink);
}

.accordion-icon {
  transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.active {
  max-height: 500px;
}

.accordion-content > * {
  padding: 0 20px;  /* 折叠状态：只有水平padding */
  transition: padding 0.4s;
}

.accordion-content.active > * {
  padding: 20px;  /* 展开状态：完整padding */
}

/* ===== 28. 树形组件模块（新增） ===== */
.tree-container {
  margin: 20px 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--bg-primary);
}

.tree-item {
  margin: 5px 0;
}

.tree-node {
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tree-node:hover {
  background: var(--sakura-light);
}

.tree-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.tree-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s;
  color: var(--text-muted);
}

.tree-children {
  margin-left: 30px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.tree-item.expanded .tree-children {
  max-height: 500px;
}

.tree-item.expanded .tree-arrow {
  transform: rotate(90deg);
}

/* ===== 29. 进度条模块（新增） ===== */
.progress-bar-container {
  width: 100%;
  height: 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--sakura-pink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  transition: width 0.5s ease;
}

.progress-bar-striped {
  background: repeating-linear-gradient(
    45deg,
    var(--sakura-pink),
    var(--sakura-pink) 10px,
    var(--sakura-deep) 10px,
    var(--sakura-deep) 20px
  );
  background-size: 28px 28px;
  animation: stripes-move 1s linear infinite;
}

@keyframes stripes-move {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

/* 条纹进度条文字优化 */
.progress-bar-striped,
.progress-bar-progressing {
  position: relative;
  color: white;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.progress-bar-striped::before,
.progress-bar-progressing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.15);
  opacity: 0.3;
  z-index: 0;
}

.progress-bar-striped > *,
.progress-bar-progressing > * {
  position: relative;
  z-index: 1;
}

.progress-bar-progressing {
  background: var(--tech-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  transition: width 0.3s ease;
}

/* ===== 30. 图表容器模块（新增） ===== */
.showcase-grid .demo-box {
  padding: 15px;
}

.showcase-grid .demo-box h4 {
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ECharts 容器适配 */
.showcase-grid [id$="Chart"] {
  border-radius: var(--radius);
  transition: var(--transition);
}

/* ===== 31. 动画模块 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 183, 197, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 183, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 183, 197, 0); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ===== 32. 响应式模块 ===== */
@media (max-width: 768px) {
  .dynamic-island-nav {
    min-width: 200px;
    max-width: 220px;
    padding: 5px 12px;
  }

  .nav-toggle {
    display: block;
  }

  .island-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--island-bg);
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-island);
    border: 1px solid var(--island-border);
    border-top: none;
    max-width: none !important;
  }

  .dynamic-island-nav:not(.expanded) .island-menu {
    display: none;
  }

  body {
    padding-top: 100px;
  }

  .title-main {
    font-size: 2rem;
  }

  .display-1 {
    font-size: 2.5rem;
  }

  .button-showcase {
    justify-content: center;
  }

  .floating-actions {
    bottom: 15px;
    right: 15px;
  }

  .fab-item {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dynamic-island-nav {
    min-width: 180px;
    max-width: 200px;
    height: 50px;
  }

  .logo-text {
    font-size: 1rem;
  }

  .fab-item::after {
    display: none;
  }

  .rating-container {
    flex-wrap: wrap;
  }

  .star {
    font-size: 2rem;
  }
}

/* 色板布局 */
.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  min-height: 80px;
}

.color-item:hover {
  transform: translateY(-2px);
  border-color: var(--sakura-pink);
}

.color-swatch {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  display: block;
}

.color-item:active .color-swatch {
  transform: scale(0.9);
}

.color-info {
  flex-grow: 1;
}

.color-name {
  font-weight: 600;
  color: var(--text-primary);
}

.color-var {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.color-hex {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Toast消息动画 */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 20px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 20px)) scale(0.95);
    }
}

.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--sakura-pink);
    color: white;
    padding: 18px 36px;
    border-radius: var(--radius);
    z-index: 9999;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    max-width: 85%;
    text-align: center;
    pointer-events: none;
    animation: toastFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform, opacity;
}

/* 页脚 */
.footer {
  text-align: center;
  margin-top: 60px;
  padding: 40px 20px;
}

.footer-subtitle {
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== 33. 图表展示专用网格模块（修复文字压缩问题）===== */
.chart-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
  gap: 30px;
  margin: 20px 0;
}

/* 响应式调整：平板设备上图表最小宽度 */
@media (max-width: 768px) {
  .chart-showcase-grid {
    grid-template-columns: 1fr; /* 平板以下设备改为单列 */
    gap: 20px;
  }
}

/* 确保图表容器有足够高度 */
.chart-showcase-grid .demo-box {
  padding: 25px;
  min-height: 520px; /* 确保450px高的图表有足够容器空间 */
  display: flex;
  flex-direction: column;
}

.chart-showcase-grid .demo-box h4 {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.chart-showcase-grid .demo-box [id$="Chart"] {
  flex-grow: 1;
  width: 100% !important; /* 覆盖可能的内联样式 */
}