/**
 * ============================================
 * Theme Variables Bridge - 主题变量桥接
 * ============================================
 * 将 home_theme.css 中的硬编码颜色映射为 CSS 变量
 * 放置在 home_theme.css 之后加载
 * 
 * 配色体系:
 *   品牌主色：#E22C08 (活力红)
 *   品牌辅色：#FF6B3D (暖橙)
 *   强调色：  #FFB800 (暖金)
 *   页面背景：#F5F3F0 (暖灰)
 *   卡片白底：#FFFFFF
 *   页脚深色：#1E1E2D / #171725
 *   文字色：  #1A1A2E / #4A4A5A / #9CA3AF
 * ============================================
 */

:root {
    /* ===== 嗣夏助手品牌色 ===== */
    --theme-primary: #E22C08;
    --theme-primary-hover: #D02907;
    --theme-primary-light: rgba(226, 44, 8, 0.08);
    --theme-secondary: #FF6B3D;
    --theme-accent: #FFB800;
    --theme-accent-light: #FFF3D6;

    /* ===== 页面背景 ===== */
    --theme-page-bg: #F5F3F0;
    --theme-card-bg: #FFFFFF;
    --theme-section-bg: #FAFAFA;

    /* ===== 页脚深色 ===== */
    --theme-footer-dark: #1E1E2D;
    --theme-footer-darker: #171725;

    /* ===== 文字色 ===== */
    --theme-text-dark: #1A1A2E;
    --theme-text-medium: #4A4A5A;
    --theme-text-light: #9CA3AF;
    --theme-text-muted: #A0A0B0;

    /* ===== 边框 ===== */
    --theme-border: #EBEBEB;
    --theme-border-light: #F0F0F0;
    --theme-border-medium: #E5E5E5;

    /* ===== 阴影 ===== */
    --theme-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --theme-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.1);
    --theme-shadow-nav: 0 2px 8px rgba(0, 0, 0, 0.04);

    /* ===== 圆角 ===== */
    --theme-radius-sm: 4px;
    --theme-radius-md: 8px;
    --theme-radius-lg: 12px;
    --theme-radius-xl: 16px;

    /* ===== 过渡 ===== */
    --theme-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 全局背景（用更高特异性替代 !important）=== */
html body .body-content-container {
    background: var(--theme-page-bg);
}
html body {
    background: var(--theme-page-bg);
}

/* === 顶部通知栏 === */
html body .plugins-commontopnotice-top,
html body .am-alert.plugins-commontopnotice-top,
html body .am-alert-warning.plugins-commontopnotice-top {
    background: var(--theme-footer-dark);
    color: var(--theme-text-muted);
    border: none;
    font-size: 1.2rem;
    text-align: center;
    padding: 0.6rem 0;
    letter-spacing: 0.5px;
}
html body .plugins-commontopnotice-top a {
    color: var(--theme-accent);
    font-weight: 500;
}

/* === 顶部用户栏 === */
html body .header-top {
    background: var(--theme-section-bg);
    color: #666;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--theme-border);
    line-height: 36px;
}
html body .header-top a {
    color: #666;
    transition: color var(--theme-transition);
}
html body .header-top a:hover {
    color: var(--theme-primary);
}

/* === 搜索条区域 === */
html body .header-nav-simple {
    background: var(--theme-card-bg);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--theme-border);
}

/* === 主导航栏 === */
html body .am-header .am-header-nav {
    background: var(--theme-card-bg);
    box-shadow: var(--theme-shadow-nav);
}
html body .am-header .am-header-nav .am-container {
    background: transparent;
}

/* === 商品卡片 === */
html body li.items-li {
    background: var(--theme-card-bg);
    border-radius: var(--theme-radius-md);
    box-shadow: var(--theme-shadow-card);
    transition: transform var(--theme-transition), box-shadow var(--theme-transition);
}
html body li.items-li:hover {
    transform: translateY(-4px);
    box-shadow: var(--theme-shadow-hover);
}

/* === 页脚 === */
html body .am-footer {
    background: var(--theme-footer-dark);
    color: var(--theme-text-muted);
}

/* === 按钮 === */
html body .am-btn-primary {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-card-bg);
    border-radius: var(--theme-radius-sm);
    transition: all var(--theme-transition);
}
html body .am-btn-primary:hover {
    background: var(--theme-primary-hover);
    border-color: var(--theme-primary-hover);
}

html body .am-btn-outline-primary {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    border-radius: var(--theme-radius-sm);
    transition: all var(--theme-transition);
}
html body .am-btn-outline-primary:hover {
    background: var(--theme-primary);
    color: var(--theme-card-bg);
}

/* === 价格标签 === */
html body .sales-price,
html body .original-price,
html body .price {
    color: var(--theme-primary);
}

/* === 面包屑导航 === */
html body .am-breadcrumb a {
    color: var(--theme-text-medium);
}
html body .am-breadcrumb a:hover {
    color: var(--theme-primary);
}
html body .am-breadcrumb .am-active {
    color: var(--theme-text-dark);
}

/* === 分页高亮 === */
html body .am-pagination .am-active > a,
html body .am-pagination .am-active > span {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}
html body .am-pagination a:hover {
    color: var(--theme-primary);
}

/* === 侧边栏 === */
html body .sidebar-nav .active a,
html body .sidebar-nav a:hover {
    color: var(--theme-primary);
}

/* === 输入框焦点 === */
html body input:focus,
html body textarea:focus,
html body select:focus,
html body .am-form-field:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px var(--theme-primary-light);
}

/* === 标签 === */
html body .am-badge-primary,
html body .am-label-primary {
    background: var(--theme-primary);
    color: var(--theme-card-bg);
}

/* === 通知成功 === */
html body .am-alert-success {
    background: #F0FAF4;
    border: 1px solid #07A160;
    color: #07A160;
}

/* === 通知错误 === */
html body .am-alert-danger {
    background: #FFF0F0;
    border: 1px solid var(--theme-primary);
    color: var(--theme-primary);
}

/* === 提示工具 === */
html body .am-popover-primary .am-popover-bd {
    border-color: var(--theme-primary);
}
html body .am-popover-primary .am-popover-caret {
    border-top-color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

/* === 进度条 === */
html body .am-progress-bar-primary {
    background: var(--theme-primary);
}
html body .am-progress-bar-warning {
    background: var(--theme-secondary);
}

/* === 标签页 === */
html body .am-tabs-nav .am-active a {
    color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

/* === 加载动画 === */
html body .am-loading-spinner {
    border-left-color: var(--theme-primary);
    border-top-color: var(--theme-primary);
}

/* === 选中高亮 === */
html body ::selection {
    background: var(--theme-primary);
    color: var(--theme-card-bg);
}

/* === 响应式微调 === */
@media screen and (max-width: 768px) {
    html body li.items-li {
        border-radius: var(--theme-radius-sm);
    }
    html body .header-nav-simple {
        padding: 1rem 0;
    }
}

/* === 打印时移除阴影和动画 === */
@media print {
    html body li.items-li,
    html body .am-header .am-header-nav,
    html body .header-nav-simple {
        box-shadow: none;
        transition: none;
    }
}
