/* ============================================================
 * AICloud 主题增强包（2026-10-20）
 *
 * 目的：
 * 1. 统一 Arco Design 与自定义组件的主题色系
 * 2. 增强深色模式支持
 * 3. 优化响应式设计
 * 4. 改进交互动画
 *
 * 用法：在 index.php 中 <head> 标签末尾引入：
 *   <link rel=\"stylesheet\" href=\"<?= asset('/assets/css/theme-enhancements.css') ?>\">
 * ============================================================ */

/* ================= CSS 变量增强 ================= */
:root {
  /* 扩展颜色体系（配合 Arco 的 primary-1 到 primary-10） */
  --primary-surface: var(--brand-primary-light, #e8f3ff);
  --primary-border: var(--brand-primary, #165dff);

  /* 深色模式（prefers-color-scheme: dark） */
  --text-on-dark: #e5e7eb;
  --bg-dark-surface: #1a1a1a;
  --bg-dark-elevated: #2d2d2d;

  /* 过渡与动画 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式根元素 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-dark-surface: #121212;
    --bg-dark-elevated: #1e1e1e;
  }
  html[data-theme=\"dark\"],
  body[data-theme=\"dark\"] {
    background-color: var(--bg-dark-surface);
    color: var(--text-on-dark);
  }
}

/* ================= 导航栏优化 ================= */
.tc-nav {
  transition: background-color var(--transition-base),
              box-shadow var(--transition-base);
}

.tc-nav-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(20, 60, 140, 0.08);
}

.tc-nav .home-nav-links a {
  position: relative;
  transition: color var(--transition-fast);
}

.tc-nav .home-nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--tc-primary, #165dff);
  transition: width var(--transition-base);
}

.tc-nav .home-nav-links a.active::after {
  width: 100%;
}

/* ================= Hero 轮播增强 ================= */
.tc-hero {
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.05), rgba(255, 255, 255, 0.5));
}

.tc-hero-title {
  background: linear-gradient(120deg, #0e42d2 0%, #165dff 50%, #4080ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.tc-hero-sub {
  transition: opacity var(--transition-base);
}

.tc-hero-rail-item {
  transition: all var(--transition-base);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
}

.tc-hero-rail-item.active {
  transform: scale(1.25);
  background: var(--tc-primary);
  border-color: var(--tc-primary);
}

.tc-hero-rail-item:hover {
  transform: scale(1.15);
  border-color: var(--tc-primary);
}

/* ================= 产品卡片增强 ================= */
.tc-product-card {
  transition: all var(--transition-base);
  border: 1px solid var(--border, #e5e6eb);
  border-radius: var(--border-radius-large, 12px);
}

.tc-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(20, 60, 140, 0.12);
  border-color: var(--tc-primary);
}

.tc-product-card .card-header {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-large, 12px) var(--border-radius-large, 12px) 0 0;
}

.tc-product-card .card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  background: rgba(var(--primary-6), 0.9);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

.tc-product-card .card-price {
  color: var(--tc-primary, #165dff);
  font-size: 24px;
  font-weight: 700;
}

/* ================= Tab 切换增强 ================= */
.arco-tabs {
  transition: all var(--transition-base);
}

.arco-tabs-nav-tab {
  transition: color var(--transition-fast),
              border-color var(--transition-fast);
}

.arco-tabs-nav-tab-active {
  color: var(--brand-primary, #165dff);
  border-bottom-color: var(--brand-primary, #165dff);
}

/* ================= 按钮增强 ================= */
.arco-btn {
  transition: all var(--transition-fast);
  font-weight: 500;
}

.arco-btn-primary {
  background: linear-gradient(135deg, var(--brand-primary, #165dff) 0%, #4080ff 100%);
  border: none;
}

.arco-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 93, 255, 0.3);
}

.arco-btn-secondary {
  transition: all var(--transition-fast);
}

/* ================= 表单优化 ================= */
.arco-input,
.arco-select,
.arco-picker {
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.arco-input:hover,
.arco-select:hover,
.arco-picker:hover {
  border-color: var(--brand-primary, #165dff);
}

.arco-input:focus,
.arco-input-focused,
.arco-select-focused,
.arco-picker-focused {
  border-color: var(--brand-primary, #165dff);
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

/* ================= 响应式优化 ================= */

/* 平板设备 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .tc-hero-title { font-size: 36px; }
  .tc-hero-copy { padding-left: 32px; }
  .tc-product-card { flex: 0 0 calc(50% - 12px); }
}

/* 移动设备 (< 768px) */
@media (max-width: 767px) {
  :root {
    --border-radius-small: 4px;
    --border-radius-medium: 6px;
    --border-radius-large: 8px;
  }

  .tc-hero-title {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .tc-hero-sub {
    font-size: 14px;
    line-height: 1.5;
  }

  .tc-hero-copy {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tc-product-card {
    flex: 0 0 100%;
    margin-bottom: 12px;
  }

  .tc-product-card .card-price {
    font-size: 18px;
  }

  .arco-tabs-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ================= 深色模式适配 ================= */
@media (prefers-color-scheme: dark) {
  .tc-nav-scrolled {
    background: rgba(20, 20, 20, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .tc-hero {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.1), rgba(0, 0, 0, 0.2));
  }

  .tc-product-card {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
  }

  .tc-product-card:hover {
    border-color: var(--tc-primary);
    background: rgba(255, 255, 255, 0.08);
  }
}

/* ================= 无障碍与键盘导航 ================= */
*:focus-visible {
  outline: 2px solid var(--brand-primary, #165dff);
  outline-offset: 2px;
}

/* 移除默认焦点轮廓，使用统一样式 */
button:focus,
a:focus,
input:focus {
  outline: none;
}

/* ================= 打印样式 ================= */
@media print {
  .tc-nav,
  .tc-hero-rail,
  .arco-btn,
  .home-footer {
    display: none;
  }
}
