@font-face {
    font-family: "sans";
    src: url("../font/TitilliumWeb-Regular.ttf");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "sans";
    src: url("../font/TitilliumWeb-Italic.ttf");
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: "sans";
    src: url("../font/TitilliumWeb-Bold.ttf");
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: "sans";
    src: url("../font/TitilliumWeb-BoldItalic.ttf");
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: "Bilibili Icon";
    src: url("../font/Bilibili_Icons_by_Jiuru.ttf");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Web Icon";
    src: url("../font/JR_icons.ttf");
    font-weight: normal;
    font-style: normal;
}

:root {
    --color-background: rgba(32, 32, 32, 0.75);
    --color-text: white;
    --color-contrast-text: black;
    --color-active: white;
    --color-theme: rgb(157, 204, 255);
    --color-grey: rgb(166, 166, 166);

    --data-border-radius: 13px;
    --data-font-size1: 36px;
    --data-font-size2: 28px;
    --data-font-size3: 23px;
    --data-font-size4: 17px;
}

html {
    background-image:
        linear-gradient(var(--color-background), var(--color-background)),
        url("https://img-reg-ab.imagency.cn/e/ce23680f4770c1a1cb4915e4979cf88e.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: "sans", sans-serif;
    color: var(--color-text);
    font-size: var(--data-font-size4);
    margin: 0;
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
    max-width: 1520px;
    margin: 0 auto;
}

main {
    max-width: 1540px;
    margin: auto;
}

footer {
    margin: 40px 0;
}

h1,
h2 {
    font-size: var(--data-font-size1);
    font-weight: normal;
    margin: 3px;
    padding: 2px;
}

h3,
h4 {
    font-size: var(--data-font-size2);
    font-weight: normal;
    margin: 3px;
    padding: 2px;
}

h5 {
    font-size: var(--data-font-size3);
    font-weight: normal;
    margin: 3px;
    padding: 2px;
}

h6,
p,
span {
    font-size: var(--data-font-size4);
    font-weight: normal;
    margin: 3px;
    padding: 2px;
}

p, span {
    line-height: 150%;
}

h1,
h3,
h6 {
    font-weight: bold;
}

/* 超链接 */
a {
    color: var(--color-theme);
    text-decoration: none;
    margin: auto 4px;
}

a:hover,
a:active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

a.sub,
a.sub:hover,
a.sub:active {
    text-decoration: none;
    color: var(--color-grey);
}

a.tile {
    margin: 5px;
    padding: 5px 8px;
    display: block;
    background-color: var(--color-background);
    color: var(--color-text);
    border-radius: var(--data-border-radius);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a.tile:hover,
a.tile:active {
    background-color: var(--color-active);
    color: var(--color-contrast-text);
    text-decoration: none;
}

/* 图标 */
i.w {
    font-style: normal;
    font-family: "Web Icon";
    margin: 5px;
    padding: 0;
    user-select: none;
    pointer-events: none;
}

i.b {
    font-style: normal;
    font-family: "Bilibili Icon";
    margin: 5px;
    padding: 0;
    user-select: none;
    pointer-events: none;
}

img {
    display: block;
}

hr {
    border: none;
    height: 1px;
    background: var(--color-grey);
    margin: 5px;
    padding: 0;

    &.wide {
        margin-left: 0;
        margin-right: 0;
    }

    &.narrow {
        margin: 2px;
    }
}

/* 显示 */
.sub {
    color: var(--color-grey);
}

.emphasis {
    color: var(--color-active);
}

/* 布局 */
.box {
    margin: 10px;
    padding: 10px;
    background-color: var(--color-background);
    border-radius: var(--data-border-radius);
}

.flex {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    flex-direction: row;
    height: auto;
    align-items: flex-start;

    *.full *, *.full{
        flex: 1;
    }

    &.vertical {
        flex-direction: column;
    }

    &.compact {
        gap: 3px;
    }

    &.inline {
        display: inline-flex;
    }

    &.align-center {
        align-items: center;
        text-align: center;
        height: auto;
    }

    &.wrap {
        flex-wrap: wrap;
    }
}

.grid {
    display: grid;
    gap: 5px;
    grid-auto-rows: auto;
    
    &.column-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    &.column-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.center {
    display: block;
    text-align: center;
}

.inline {
    display: inline-block;
}