/*
 * 识文阁 · 拆书仿写工具 — 主题覆盖层
 *
 * 职责：仅覆盖 daisyUI 无法表达的全局样式。
 * 原则：每加一行都要问"daisyUI 为什么做不到？"
 *
 * 注意：本文件不参与 Tailwind 编译（仅 input.css 参与），
 *       禁止使用 @apply / @layer / @variant 等 Tailwind 指令，
 *       必须使用原生 CSS。
 *
 * 允许的内容：
 *   - 品牌主色（emerald 绿）统一覆盖
 *   - 护眼模式变量覆盖
 *   - 自定义滚动条
 *   - 导航激活态（.nav-item-active）
 *   - HTML 全局重置
 *
 * daisyUI v5 变量命名规范：
 *   --color-base-100 / --color-base-200 / --color-base-300
 *   --color-base-content
 *   --color-primary / --color-primary-content
 *   --color-secondary / --color-secondary-content
 *   --color-accent / --color-accent-content
 *   --color-neutral / --color-neutral-content
 *   --color-success / --color-success-content
 *   --color-warning / --color-warning-content
 *   --color-error / --color-error-content
 *   --color-info / --color-info-content
 */

/* ===== 浅色主题（纯白底） ===== */
[data-theme="light"] {
    --color-primary: #059669;
    --color-primary-content: #ffffff;
    --color-secondary: #10b981;
    --color-secondary-content: #ffffff;
}

/* ===== 深色主题（墨色底） ===== */
[data-theme="dark"] {
    --color-primary: #059669;
    --color-primary-content: #ffffff;
    --color-secondary: #10b981;
    --color-secondary-content: #ffffff;
}

/* ===== 护眼模式（暖米色底，模拟纸张质感） ===== */
[data-theme="eye-care"] {
    color-scheme: light;
    --color-base-100: #F7F5F0;       /* 暖白（RGB差值<10，柔和纸张感） */
    --color-base-200: #EDEAE3;       /* 暖浅灰（卡片/面板底色） */
    --color-base-300: #DDD9D0;       /* 暖中灰（边框/分割线） */
    --color-base-content: #3D3929;   /* 暖深棕（正文，非纯黑，降低对比刺激） */
    --color-primary: #3D8B5E;        /* 柔和翡翠绿（品牌色降饱和） */
    --color-primary-content: #ffffff;
    --color-secondary: #5A8F6E;      /* 灰绿（辅助色） */
    --color-secondary-content: #ffffff;
    --color-accent: #8B7355;         /* 暖铜棕（强调色） */
    --color-accent-content: #ffffff;
    --color-neutral: #4A4540;        /* 暖炭灰 */
    --color-neutral-content: #F5F2EB;
    --color-success: #4A7C59;        /* 柔绿 */
    --color-success-content: #ffffff;
    --color-warning: #B8860B;        /* 暗金 */
    --color-warning-content: #ffffff;
    --color-error: #C0392B;          /* 柔红 */
    --color-error-content: #ffffff;
    --color-info: #5B7FA5;           /* 柔钢蓝 */
    --color-info-content: #ffffff;
}

/* ===== HTML 全局重置 ===== */
html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
}

/* ===== 自定义滚动条 =====
 * 注：::-webkit-scrollbar 不支持 CSS 变量作用域的 var() 主题切换，
 *     此处直接用半透明色，足够覆盖三种主题。
 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background-color: var(--color-base-300, #d1d5db);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--color-base-content, #1f2937) 30%, transparent);
}

/* ===== 导航激活态 ===== */
.nav-item-active {
    color: var(--color-primary, #059669);
    font-weight: 500;
    position: relative;
}

.nav-item-active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    width: 100%;
    height: 0.125rem;
    background-color: var(--color-primary, #059669);
    border-radius: 9999px;
}

/* ===== 进度条：去掉默认条纹动画 ===== */
.progress {
    background-image: none;
    animation: none;
}

.progress::-webkit-progress-bar {
    background-image: none;
    animation: none;
}

.progress::-moz-progress-bar {
    background-image: none;
    animation: none;
}

.progress::-ms-fill {
    background-image: none;
    animation: none;
}

/* ===== 尊重用户的减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
