/* 主题变量定义 - 温暖深邃风格暗色主题 */
:root {
    /* 浅色主题（默认） - 保持原有暖色调 */
    --bg-primary: #faf9f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0eeeb;
    --text-primary: #1f1c18;
    --text-secondary: #575047;
    --text-tertiary: #8a8174;
    --border-color: #e0ddd8;
    --border-hover: #c8c3bb;
    --accent: #c45d3e;
    --accent-light: #e8a090;
    --accent-dark: #8b3a25;
    --code-bg: #272822;
    --code-text: #f8f8f2;
    --scrollbar-track: #faf9f7;
    --scrollbar-thumb: #c8c3bb;
    --hover-bg: #f0eeeb;
}

[data-theme="dark"] {
    /* 暗色主题（温暖深邃） - 深棕/深炭色系 */
    --bg-primary: #1a1614;
    --bg-secondary: #241f1c;
    --bg-tertiary: #2e2925;
    --text-primary: #f0ede9;
    --text-secondary: #c8c3bb;
    --text-tertiary: #8a8174;
    --border-color: #3d3832;
    --border-hover: #575047;
    --accent: #d97a5c;
    --accent-light: #d97a5c;
    --accent-dark: #c45d3e;
    --code-bg: #1a1614;
    --code-text: #f8f8f2;
    --scrollbar-track: #1a1614;
    --scrollbar-thumb: #575047;
    --hover-bg: #2e2925;
}

/* 平滑过渡效果 - 应用于颜色相关属性 */
*, *::before, *::after {
    transition-property: background-color, color, border-color, box-shadow;
    transition-duration: 400ms;
    transition-timing-function: ease-in-out;
}

/* 禁用过渡 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}

/* Tailwind 工具类的暗色主题覆盖 */
[data-theme="dark"] .bg-ink-50 { background-color: var(--bg-primary) !important; }
[data-theme="dark"] .bg-ink-50\/80 { background-color: rgba(26, 22, 20, 0.8) !important; }
[data-theme="dark"] .bg-ink-100 { background-color: var(--bg-tertiary) !important; }
[data-theme="dark"] .bg-white { background-color: var(--bg-secondary) !important; }
[data-theme="dark"] .bg-ink-200\/60 { background-color: rgba(61, 56, 50, 0.4) !important; }
[data-theme="dark"] .text-ink-900 { color: var(--text-primary) !important; }
[data-theme="dark"] .text-ink-600 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-ink-700 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-ink-400 { color: var(--text-tertiary) !important; }
[data-theme="dark"] .border-ink-200\/60 { border-color: var(--border-color) !important; }
[data-theme="dark"] .hover\:bg-ink-50:hover { background-color: var(--hover-bg) !important; }
[data-theme="dark"] .hover\:text-ink-900:hover { color: var(--text-primary) !important; }
[data-theme="dark"] .hover\:text-ink-700:hover { color: var(--text-primary) !important; }
[data-theme="dark"] .focus\:ring-accent\/30:focus { --tw-ring-color: var(--accent); opacity: 0.3 !important; }
[data-theme="dark"] .text-accent { color: var(--accent) !important; }
[data-theme="dark"] .hover\:text-accent:hover { color: var(--accent) !important; }

/* SVG 图标颜色 */
[data-theme="dark"] svg[stroke="currentColor"] { stroke: currentColor; }

/* 主题切换按钮样式 */
#theme-toggle,
#theme-toggle-mobile {
    position: relative;
    overflow: hidden;
}

#theme-toggle:hover,
#theme-toggle-mobile:hover {
    transform: scale(1.05);
}

#theme-toggle:active,
#theme-toggle-mobile:active {
    transform: scale(0.95);
}

/* 图标显示控制 */
#theme-toggle .icon-sun,
#theme-toggle-mobile .icon-sun {
    display: none;
}

#theme-toggle .icon-moon,
#theme-toggle-mobile .icon-moon {
    display: block;
}

[data-theme="dark"] #theme-toggle .icon-sun,
[data-theme="dark"] #theme-toggle-mobile .icon-sun {
    display: block;
}

[data-theme="dark"] #theme-toggle .icon-moon,
[data-theme="dark"] #theme-toggle-mobile .icon-moon {
    display: none;
}
