:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

html.dark {
    color-scheme: dark;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

html.light {
    color-scheme: light;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.1s ease, color 0.1s ease !important;
}

* {
    transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease !important;
}

html.dark *,
html.light * {
    transition-duration: 0.1s !important;
    transition-delay: 0s !important;
}

.search-container,
.search-input,
.search-suggestion,
.search-history {
    transition: all 0.1s ease !important;
}

html, body {
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
    /* 设置滚动条为内饰样式 */
    scrollbar-gutter: stable both-edges;
}

/* 自定义滚动条样式 - WebKit浏览器 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

/* 深色主题下的滚动条样式 */
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.6);
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

/* Firefox浏览器的滚动条样式 */
html, body {
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 114, 128, 0.3) transparent;
}

html.dark {
    scrollbar-color: rgba(107, 114, 128, 0.6) transparent;
}