/* =============================================
   THYUU Style Override for B2 Theme
   Adapted from kunkunyu.com THYUU/星度 design system
   ============================================= */

/* === CSS Custom Properties (Design Tokens) === */
:root {
    /* 主色 (HSL 三通道) */
    --thyuu-main-h: 239;
    --thyuu-main-s: 29%;
    --thyuu-main-l: 54%;
    --thyuu-subs-h: 203;
    --thyuu-subs-s: 40%;
    --thyuu-subs-l: 57%;

    /* 组合颜色 */
    --thyuu--main-color: var(--thyuu-main-h)deg var(--thyuu-main-s) var(--thyuu-main-l);
    --thyuu--subs-color: var(--thyuu-subs-h)deg var(--thyuu-subs-s) var(--thyuu-subs-l);

    /* 文字 */
    --thyuu--color-font: 0deg 0% 25%;
    --thyuu--color-font-head: hsl(0deg 0% 20%);
    --thyuu--color-font-mask: hsl(0deg 0% 100% / .9);

    /* 背景 */
    --thyuu--color-back-none: transparent;
    --thyuu--color-back-font: hsl(0deg 0% 25% / 5%);
    --thyuu--color-back-have: hsl(0deg 0% 98%);
    --thyuu--color-back-white: hsl(0deg 0% 100%);

    /* 尺寸 */
    --thyuu--size-normal: 16px;
    --thyuu--size-medium: 0.875rem;
    --thyuu--size-small: 0.75rem;
    --thyuu--size-radius: 16px;
    --thyuu--size-height-head: 4rem;
    --thyuu--size-card: 22.5rem;
    --thyuu--size-content: 62.5rem;
    --thyuu--size-gap: 1.5rem;
    --thyuu--size-pad: 1rem;

    /* 字体 */
    --thyuu--font-normal: 'Misans VF', 'Noto Sans SC', 'PingFang SC', sans-serif;
    --thyuu--font-title: var(--thyuu--font-normal);

    /* 阴影 */
    --thyuu--shadow-normal: 0 .2rem 1rem 0 hsl(0deg 0% 15% / 10%);
    --thyuu--shadow-white: 0 .2rem 1rem 0 hsl(0deg 0% 15% / 4%);
    --thyuu--shadow-color: 0 .2rem 1rem 0 hsl(0deg 0% 15% / 10%),
                           0 2rem 2rem -2rem hsl(var(--thyuu--main-color) / 30%);

    /* 边框 */
    --thyuu--border: thin solid hsl(var(--thyuu--color-font) / 5%);

    /* 动画 */
    --thyuu--ease-out: cubic-bezier(.6, .1, 0, 1);
    --thyuu--ease-in: cubic-bezier(.6, .2, .25, 1);
}

/* === 主题切换按钮 === */

.themeToggle {
    position: relative;
    z-index: 2;
}

#themeBtn {
    width: 2.5em;
    height: 2.5em;
    border-radius: 50%;
    background: var(--thyuu--color-back-font);
    border: var(--thyuu--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--thyuu--size-small);
    transition: .7s;
}

#themeBtn:hover {
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
}

#themeOptions {
    position: absolute;
    top: calc(100% + .5em);
    right: 0;
    background: hsl(var(--thyuu--color-back-white) / .95);
    backdrop-filter: blur(20px);
    border-radius: var(--thyuu--size-radius);
    box-shadow: var(--thyuu--shadow-normal);
    border: var(--thyuu--border);
    padding: .5em;
    opacity: 0;
    visibility: hidden;
    transform: translateY(.5em);
    transition: .3s var(--thyuu--ease-in);
}

#themeOptions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-opt {
    display: block;
    width: 100%;
    padding: .5em 1em;
    background: none;
    border: none;
    text-align: left;
    font-size: var(--thyuu--size-small);
    color: hsl(var(--thyuu--color-font));
    border-radius: calc(var(--thyuu--size-radius) / 2);
    cursor: pointer;
    transition: .3s;
}

.theme-opt:hover {
    background: var(--thyuu--color-back-font);
}

/* === 回到顶部 === */
.go-top {
    position: fixed;
    bottom: 2em;
    right: 2em;
    width: 2.5em;
    height: 2.5em;
    border-radius: 50%;
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-normal);
    border: var(--thyuu--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}

.go-top.visible {
    opacity: 1;
    visibility: visible;
}

/* === 响应式 === */
@media screen and (max-width: 768px) {
    :root {
        --thyuu--size-gap: 1rem;
    }

    .site-header-in {
        padding: 0 1rem;
    }

    .wrapper {
        padding: 0 1rem;
    }

    .b2_gap {
        grid-template-columns: 1fr;
    }

    .single-article.box {
        border-radius: var(--thyuu--size-radius);
        padding: 1.25em;
    }

    .post-pre-next {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   额外 B2 主题特定覆盖
   ============================================= */

/* === 通用卡片 .box === */
.box {
    border-radius: var(--thyuu--size-radius) !important;
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    transition: box-shadow .5s;
}

.box:hover {
    box-shadow: var(--thyuu--shadow-normal);
}

/* === 模块标题 === */
.module-title {
    font-size: var(--thyuu--size-normal);
    font-weight: 700;
    margin-bottom: var(--thyuu--size-gap);
    color: hsl(var(--thyuu--color-font-head));
}

/* === 内容区域 === */
.content-area {
    width: 100%;
}

/* === 分类导航标签 scroll === */
.hidden-line {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: .5em;
    padding-bottom: .5em;
    margin-bottom: var(--thyuu--size-gap);
    scrollbar-width: none;
}

.hidden-line::-webkit-scrollbar {
    display: none;
}

.post-list-cats {
    display: flex;
    gap: .3em;
    flex-wrap: wrap;
}

/* === 文章详情内容块 === */
.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.entry-content ul li,
.entry-content ol li {
    margin-bottom: .5em;
}

.entry-content a {
    color: hsl(var(--thyuu--main-color));
    text-decoration: underline;
    text-decoration-color: hsl(var(--thyuu--main-color) / 30%);
    text-underline-offset: .2em;
    transition: .3s;
}

.entry-content a:hover {
    text-decoration-color: hsl(var(--thyuu--main-color));
}

/* === 标签云 === */
.tagcloud a,
.post-tags a {
    display: inline-block;
    padding: .3em .8em;
    margin: .2em;
    font-size: var(--thyuu--size-small) !important;
    background: var(--thyuu--color-back-font);
    border-radius: min(32px, 2em);
    color: hsl(var(--thyuu--color-font));
    transition: .3s;
}

.tagcloud a:hover,
.post-tags a:hover {
    background: hsl(var(--thyuu--main-color));
    color: #fff;
}

/* === 分类描述/Archive 头部 === */
.archive-box {
    border-radius: var(--thyuu--size-radius);
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    padding: 1.5em;
    margin-bottom: var(--thyuu--size-gap);
}

.archive-box .archive-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--thyuu--color-font-head));
}

/* === 搜索页 === */
.search-box {
    border-radius: var(--thyuu--size-radius);
}

/* === 商城卡片 === */
.shop-box .shop-item,
.product-item {
    border-radius: var(--thyuu--size-radius);
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    overflow: hidden;
    transition: box-shadow .5s;
}

.shop-box .shop-item:hover,
.product-item:hover {
    box-shadow: var(--thyuu--shadow-color);
}

/* === 圈子卡片 === */
.circle-item {
    border-radius: var(--thyuu--size-radius);
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    overflow: hidden;
    transition: box-shadow .5s;
}

.circle-item:hover {
    box-shadow: var(--thyuu--shadow-color);
}

/* === 问答卡片 === */
.ask-item {
    border-radius: var(--thyuu--size-radius);
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    overflow: hidden;
    transition: box-shadow .5s;
}

.ask-item:hover {
    box-shadow: var(--thyuu--shadow-color);
}

/* === 快讯卡片 === */
.news-item {
    border-radius: var(--thyuu--size-radius);
    background: var(--thyuu--color-back-white);
    box-shadow: var(--thyuu--shadow-white);
    border: var(--thyuu--border);
    overflow: hidden;
    transition: box-shadow .5s;
}

.news-item:hover {
    box-shadow: var(--thyuu--shadow-color);
}

/* === 导航菜单 hover 下划线 === */
.top-menu-ul > li > a .hob {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg,
        hsl(var(--thyuu--main-color) / 50%),
        hsl(var(--thyuu--subs-color) / 50%)
    );
    border-radius: 1px;
    transition: transform .3s var(--thyuu--ease-in);
}

.top-menu-ul > li > a:hover .hob {
    transform: translateX(-50%) scaleX(1);
}

/* === 通知/消息徽章 === */
.badge,
.unread-count {
    background: hsl(var(--thyuu--main-color));
    color: #fff;
    border-radius: min(32px, 2em);
    font-size: .7rem;
    padding: .1em .5em;
}

/* === 弹窗/模态框 === */
.b2-dialog,
.modal-content {
    border-radius: var(--thyuu--size-radius);
    background: hsl(var(--thyuu--color-back-white) / .98);
    backdrop-filter: blur(30px) saturate(1.8);
    box-shadow: var(--thyuu--shadow-normal);
    border: var(--thyuu--border);
}

/* === 加载动画 === */
.b2-loading:after {
    border-color: hsl(var(--thyuu--main-color) / 20%);
    border-top-color: hsl(var(--thyuu--main-color));
}

/* === 头像圆角 === */
.avatar {
    border-radius: 50% !important;
}

/* === 毛玻璃导航背景 === */
.site-header-in .top-style-blur {
    background: hsl(var(--thyuu--color-back-have) / .8);
    backdrop-filter: blur(2em);
    -webkit-backdrop-filter: blur(2em);
}

/* === 按钮禁用状态 === */
button[disabled],
.button.disabled {
    opacity: .4;
    cursor: not-allowed;
}

button[disabled]:hover,
.button.disabled:hover {
    background: var(--thyuu--color-back-font);
    color: hsl(var(--thyuu--color-font));
    box-shadow: none;
    border: var(--thyuu--border);
}

/* === 滚动进度条 (如果存在) === */
#nprogress .bar {
    background: linear-gradient(90deg,
        hsl(var(--thyuu--main-color)),
        hsl(var(--thyuu--subs-color))
    );
}

/* === 平滑滚动 === */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--thyuu--size-height-head) + 1rem);
}

/* === 打印样式 === */
@media print {
    .site-header-in,
    .thyuu-theme-switch,
    .sidebar {
        display: none !important;
    }
    .single-article.box {
        box-shadow: none;
        border: none;
    }
}
