/**
 * CSS Reset & Base Styles
 * 基础重置和全局样式
 */

/* ==========================================================================
   基础重置
   ========================================================================== */

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

html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    padding-top: var(--header-height);
    min-height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   标题样式
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    font-size: 100%;
    font-weight: normal;
    font-family: var(--font-family-heading);
}

h2 {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   链接样式
   ========================================================================== */

a {
    text-decoration: none !important;
    color: inherit;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   列表样式
   ========================================================================== */

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   媒体元素
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
}

figure {
    margin: 0;
    padding: 0;
}

figcaption {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   表格样式
   ========================================================================== */

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* ==========================================================================
   表单元素
   ========================================================================== */

form {
    margin: 0;
    padding: 0;
}

input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input[type="search"] {
    -webkit-appearance: none;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   其他元素
   ========================================================================== */

p {
    margin: 0;
    padding: 0;
}

blockquote {
    margin: 0;
    padding: 0;
}

pre {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-code);
}

code {
    font-family: var(--font-family-code);
}

/* ==========================================================================
   清除浮动
   ========================================================================== */

.clearfix::after {
    content: "";
    display: block;
    clear: both;
    height: 0;
    visibility: hidden;
}

.clear {
    clear: both;
}

/* ==========================================================================
   文本省略
   ========================================================================== */

.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   隐藏内容
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* 浅色模式下的背景 */
body {
    background-color: #f7f7f7 !important;
}

body .warpper {
    background-color: #f7f7f7 !important;
}

/* 深色模式下的背景 */
html.dark-mode body {
    background-color: #2F2F2F !important;
}

html.dark-mode body .warpper {
    background-color: #2F2F2F !important;
}
