/* ==========================================
   CSS Reset & Base Styles
   ========================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
}

/* 链接 */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover);
}

a:active {
    color: var(--link-active);
}

/* 列表 */
ul,
ol {
    list-style: none;
}

/* 图片 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮 */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* 输入框 */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* 表格 */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* 标题 */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 选中文本 */
::selection {
    background: var(--primary-200);
    color: var(--text-primary);
}

[data-theme="dark"] ::selection {
    background: var(--primary-700);
    color: var(--text-primary);
}