/* -------- 设计令牌 / Design Tokens -------------------- */
:root {
    /* Color */
    --c-primary: #FBB;
    --c-primary-hov: #F99;
    --c-border: rgb(239, 107, 107);
    --c-link: rgb(73, 155, 213);
    --c-card: rgba(254, 229, 229, .8);
    /* Gap & Radius */
    --sp-xs: .25rem;
    --sp-sm: .5rem;
    --sp-md: 1rem;
    --radius: .375rem;
}

/* -------- Reset / Global ------------------------------ */
html {
    overflow-y: overlay
}

*,
*::before,
*::after {
    box-sizing: border-box;
    transition: .4s ease
}

body {
    padding: 80px 5% 0;
    background: url("https://cdn.jsdelivr.net/gh/Love-Kogasa/TouhouMobile/style/bg.jpg") center/cover fixed no-repeat;
}

:is(h, top, bl, [bl], tab, tab name, tab content, [fw], tool name, tool info,
    input[type=text], textarea, input[type=file]) {
    display: block
}

/* -------- Scrollbar (Chromium) ------------------------ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-thumb {
    background: #eee8;
    border-radius: 4px;
    box-shadow: inset 0 0 5px #0003
}

::-webkit-scrollbar-thumb:hover {
    background: #bbbf
}

::-webkit-scrollbar-track {
    background: #fff3;
    border-radius: 10px;
    box-shadow: inset 0 0 5px #0003
}

/* =======================================================
 *  LAYOUT
 * ===================================================== */
/* Header */
#head-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    padding-inline: 20px;
    background: var(--c-primary);
    font-size: 1.45rem;
    z-index: 999;
    box-shadow: 0 1px 5px var(--c-primary), 0 1px 20px #DDD;
}

#head-title {
    display: flex;
    align-items: center;
    gap: .625rem;
    height: 100%;
    padding-inline: .5rem;
    color: inherit;
    text-decoration: none
}

#head-title:hover {
    background: #FDD;
    transition: .15s
}

#head-title img {
    margin-right: 10px
}

/* Main card */
#main-content {
    margin-top: var(--sp-md);
    padding: 20px 20px 40px;
    background: var(--c-card);
    backdrop-filter: blur(6px);
    border-radius: var(--radius);
    animation: fade-in .3s
}

#main-content h2 {
    margin-bottom: 10px;
    padding: 0 0 10px 10px;
    border-bottom: 2px solid var(--c-border)
}

#main-content .left-border-line {
    padding-left: 10px;
    border-left: 2px solid var(--c-border)
}

/* =======================================================
 *  ELEMENTS
 * ===================================================== */
/* Link  ------------------------------------------------- */
#main-content a {
    color: var(--c-link);
    text-decoration: none;
    background: linear-gradient(var(--c-link), var(--c-link)) bottom left/0 1px no-repeat;
    transition: background-size .25s
}

#main-content a:hover {
    background-size: 100% 1px
}

#main-content div[align=right] a:hover {
    background: var(--c-primary-hov);
    background-size: 0 1px
}

/* Lists */
#main-content li::marker {
    color: var(--c-border)
}

/* Button / pseudo-attr btn ----------------------------- */
:is(#main-content button, [btn]) {
    margin: var(--sp-sm);
    padding: .3125rem .625rem;
    border: 0;
    border-radius: var(--radius);
    color: #FFF;
    background: var(--c-primary)
}

:is(#main-content button, [btn]):hover {
    background: var(--c-primary-hov)
}

:is(btn, [btn]):active {
    background: #FAA
}

/* Inputs ---------------------------------------------- */
input,
textarea {
    width: 100%;
    margin: var(--sp-sm) 0;
    padding: .375rem .625rem;
    border: 1px solid #adadad;
    background: rgba(255, 238, 238, .44);
    backdrop-filter: blur(3px)
}

input:focus,
textarea:focus {
    background: rgba(231, 216, 216, .44);
    outline: none
}

textarea {
    min-height: 125px;
    font-size: 1.15rem;
    resize: vertical;
    transition: none
}

input[type=file] {
    background: var(--c-primary);
    color: #FFF;
    border-radius: var(--radius)
}

/* =======================================================
 *  COMPONENTS
 * ===================================================== */
/* Collapse -------------------------------------------- */
.collapse-area {
    margin-bottom: .125rem;
    border-radius: var(--radius);
    background: #ffd6d6aa;
    box-shadow: -1px 2px 2px #777;
    overflow: hidden
}

.collapse-area>.heading {
    display: flex;
    align-items: flex-start;
    gap: .25rem;
    padding: .3125rem .625rem;
    font-size: 1.35rem;
    cursor: pointer;
    background: var(--c-primary);
    box-shadow: 0 1px 1px #777
}

.collapse-area>.heading:hover {
    background: #F99A
}

.ic-collapse-arrow {
    color: #ff6565d9;
    font-weight: bold;
    transition: .3s
}

.ic-collapse-arrow::after {
    content: '>'
}

.collapse-area>.collapse-content {
    display: none;
    height: 0;
    padding: 0 15px;
    padding-bottom: 20px;
    overflow: hidden
}

/* Pixiv preview  -------------------------------------- */
#pixiv-img-box {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    height: 200px;
    max-height: 600px;
    margin: 5px;
    padding: 5px;
    border: 1px solid #DDD;
    border-radius: var(--radius);
    background: #fffb;
    overflow: hidden
}

#pixiv-img-box img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    backdrop-filter: blur(3px);
    visibility: hidden
}

#pixiv-img-box-menu {
    position: relative;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -89%);
    width: 100%;
    height: 0;
    background: rgba(34, 34, 34, .65);
    overflow: hidden;
    scrollbar-width: none
}

#pixiv-img-box-menu nav {
    float: right;
    height: 100%;
    margin-right: 30px
}

#pixiv-img-box-menu button {
    height: 100%;
    padding: 0 15px;
    margin: 0;
    background: rgba(34, 34, 34, .155)
}

#pixiv-img-box-menu button:hover {
    background: rgba(34, 34, 34, .5)
}

/* Tool cards ------------------------------------------ */
#tool-list {
    display: inline-block;
    margin-left: 10px;
    padding: 0
}

#tool-list li::marker {
    content: ""
}

#tool-item {
    display: inline-block;
    width: 110px;
    margin: 5px;
    padding: 10px 20px;
    background: #FAA;
    border-radius: 10px;
    color: #FFF;
    vertical-align: top
}

#tool-item #name {
    margin-bottom: var(--sp-xs);
    padding-bottom: 5px;
    border-bottom: 1px solid #FFF;
    font-size: 1.25rem
}

#tool-item #info {
    padding: 7px 0
}

#tool-item a {
    color: #FFF
}

#tool-item a:hover {
    color: #67A5D8;
    transition: .25s;
    background-size: 0 1px
}

/* Tabs / Tipbox --------------------------------------- */
tab {
    width: 100%
}

tab name {
    display: block;
    padding: 2px 10px;
    font-size: 1.4rem;
    background: var(--c-primary);
    border-bottom: 3px solid #FAA
}

tab content {
    display: none
}

:is(tab:hover content, tab content:hover, tipbox) {
    background: rgba(244, 127, 127, .1);
    padding: 0 5px;
    position: absolute;
    width: 78%;
    max-height: 50%;
    overflow-y: auto;
    backdrop-filter: blur(3px)
}

tipbox {
    width: 40%;
    max-height: 40%
}

tipbox name {
    display: block;
    padding: 5px 10px;
    border-bottom: 1px solid #FFF
}

/* Copy Button fixed ----------------------------------- */
#copy-api-addr {
    position: fixed;
    top: 84%;
    left: 70%;
    padding: 10px;
    font-size: 1.15rem;
    background: #FCC;
    box-shadow: 0 1px 1px #777
}

/* Misc utilities -------------------------------------- */
.no-tap-highlight {
    -webkit-tap-highlight-color: transparent
}

.hide {
    display: none
}

.light-shadow {
    text-shadow: 0 2px 5px #222
}

.none-shadow,
.swal-text,
.swal-content,
.swal-title,
.swal-button,
.swal-content__input {
    text-shadow: none
}

/* Links list appear animation -------------------------- */
#links li {
    opacity: 0;
    transform: translateX(-20px)
}

#links li.fade-in {
    animation: slideFade .3s forwards
}

@keyframes slideFade {
    to {
        opacity: 1;
        transform: none
    }
}

/* Spinner --------------------------------------------- */
.loading {
    opacity: 0
}

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 3px solid var(--c-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%)
}

/* Fade-in -------------------------------------- */
@keyframes fade-in {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg)
    }
}
