/* CSS Variables from www.darkmi.com */
:root {
    color-scheme: light;
    --header_bg_image: url(header.webp);
    --header_bg_size: cover;
    --header_bg_position: center top;

    --font_family: "LXGW WenKai Screen", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    --font_size: 14px;

    --background_color: #f1f1f1;
    --background_image: none;

    --image_border_color: #ced4ca;
    --image_border_px: 3px;

    --image_width: 140px;
    --image_height: 140px;

    /* Header band */
    --header_band_bg: #efc;
    --title_color: #c2c2c2;
    --description_color: #c2c2c2;
    --svg_color: #c2c2c2;
    --svg_hover_color: #fff;

    --menu_background_color: transparent;
    --menu_text_color: #c2c2c2;
    --menu_active_text_color: #fff;

    /* Links / buttons — SpringSide body & forms */
    --springside_link: #477725;
    --springside_link_hover: #333;
    --button_background_color: #fafaf0;
    --button_text_color: #477725;
    --button_text_hover_color: #333;
    --button_border_color: #c1c0b5;

    --textarea_background_color: #fafaf0;
    --textarea_text_color: #444;
    --textarea_link_text_color: #477725;

    /* Footer（背景图为 HTML img，高度随图片比例变化） */
    --footer_background_solid: #000;
    --footer_text_color: #477725;
    --footer_link_text_color: #477725;
    --footer_link_hover_color: #020;
    --footer_link_hover_bg: #cfc;
}

html.dark {
    color-scheme: dark;
    --background_color: #121212;
    --header_band_bg: #1f1f1f;
    --title_color: #f0f0f0;
    --description_color: #f0f0f0;
    --svg_color: #bbb;
    --svg_hover_color: #fff;
    --menu_text_color: #bbb;
    --menu_active_text_color: #fff;
    --button_background_color: #333;
    --button_text_color: #8bc34a;
    --button_text_hover_color: #fff;
    --button_border_color: #555;
    --textarea_background_color: #1e1e1e;
    --textarea_text_color: #e0e0e0;
    --textarea_link_text_color: #8bc34a;
    --footer_background_solid: #000;
    --footer_text_color: #888;
    --footer_link_text_color: #8bc34a;
    --footer_link_hover_color: #fff;
    --footer_link_hover_bg: transparent;
}

/* Flexbox utility classes */
.flex_column_center {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.flex_row_center {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.flex_no_wrap_row_center {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font_family);
    background-color: var(--background_color);
    color: #444;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark body {
    color: #e0e0e0;
}

/* Header Styles from www.darkmi.com */
#header {
    width: 100%;
    text-align: center;
    background-color: var(--header_band_bg);
    background-image: var(--header_bg_image);
    background-repeat: no-repeat;
    background-position: var(--header_bg_position);
    background-size: var(--header_bg_size);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding-bottom: 0.35rem;
    position: relative;
    z-index: 100;
}

html.dark #header {
    border-bottom-color: #333;
    background-image: none;
    background-color: #1f1f1f;
    min-height: auto;
}

/* Header social row */
.header_social_row {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.65rem 1.25rem 0;
    box-sizing: border-box;
}

.header_social_row .header_svg_list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1em;
}

.header_img {
    padding-top: 0.35em;
}

.header_img img {
    height: var(--image_height);
    width: var(--image_width);
    border: var(--image_border_px) solid var(--image_border_color);
    border-radius: 10%;
    margin-bottom: 0.5em;
}

#header .title {
    color: var(--description_color);
    font-size: 1.5em;
    height: auto;
    margin: 0;
}

#header .description {
    display: none;
}

#header a {
    color: var(--menu_text_color);
    text-decoration: none;
    transition: color 0.15s ease;
}

#header a:hover {
    color: var(--menu_active_text_color);
}

/* menu */
#menu {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#menu-left {
    list-style: none;
    width: 100%;
    margin: 0.5em auto 0;
    height: auto;
    line-height: normal;
    display: flex;
    justify-content: center;
    padding: 0;
    gap: 0.4em;
}

#menu-left li {
    display: inline;
    margin: 0;
}

#header #menu li a {
    font-size: 1.1em;
    color: var(--menu_text_color);
    background-color: var(--menu_background_color);
    text-align: center;
    cursor: pointer;
    padding: 0.5em;
    border-radius: 0.3em;
    transition: color 0.15s ease, background-color 0.15s ease;
    display: inline-block;
}

#header #menu li a:hover {
    color: var(--menu_active_text_color);
}

/* Header SVG items */
.header_svg_item {
    width: 2.1em;
    height: 2.1em;
    cursor: pointer;
}

.header_svg_item:hover {
    transform: scale(1.1);
    transition: 0.1s ease;
}

.header_svg_item svg {
    fill: var(--svg_color);
    transition: fill 0.15s ease;
}

.header_svg_item:hover svg {
    fill: var(--svg_hover_color);
}

.header_svg_item a {
    color: inherit;
}

/* 页面布局 */
.page-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative; /* 添加相对定位 */
}

.content-main {
    flex: 1;
    min-width: 0;
}

.sidebar-nav {
    width: 240px;
    min-width: 240px;
    position: sticky;
    top: 20px;
    margin-left: 16px;
    background-color: transparent;
    border-left: none;
    border-radius: 0;
    padding: 0 10px 0 5px;
    margin-top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    font-size: 12px;
}

/* 侧边栏标题：参考 springside 的 #sidebar h2 样式 */
.sidebar-nav-title {
    padding-bottom: 10px;
    color: #000000;
    font-size: 1.4em;
    font-weight: bold;
    border-color: #91895B #91895B #91895B #6D9441;
    border-style: dashed dashed dashed solid;
    border-width: 0 0 1px 0;
    margin: 0 0 10px 0;
    padding-left: 5px;
    line-height: 1.5em;
}

html.dark .sidebar-nav-title {
    color: #ccc;
    border-color: #555 #555 #555 #6D9441;
}

.sidebar-nav .category-name {
    /* 参考 springside 的 #sidebar ul ul li 样式 */
    padding-bottom: 5px !important;
    color: #477725 !important;
    font-size: 1em !important;
    font-weight: normal !important;
    border: none !important;
    margin-bottom: 0 !important;
    display: block;
    width: 100%;
    text-decoration: none;
    line-height: 1.5em;
}

.sidebar-nav .category-name:hover {
    color: #c30 !important;
}

html.dark .sidebar-nav .category-name {
    color: #8bc34a !important;
}

html.dark .sidebar-nav .category-name:hover {
    color: #fff !important;
}

.sidebar-category-link {
    color: inherit;
    text-decoration: none;
}

.sidebar-category-link:hover {
    color: inherit;
}

.sidebar-nav-item {
    /* 参考 springside 的 #sidebar ul ul li 样式 */
    list-style: none;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.sidebar-sub-link {
    margin-left: -4.3em;
    color: inherit;
    text-decoration: none;
}

.sidebar-sub-link:hover {
    color: inherit;
}

/* 右侧导航栏标题和箭头分离 */
.sidebar-nav-header {
    display: flex;
    align-items: center;
    padding: 0 !important;
}

.sidebar-nav-header .sidebar-category-link {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.sidebar-nav-header .sidebar-nav-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-nav-header .sidebar-nav-toggle:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

html.dark .sidebar-nav-header .sidebar-nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .sidebar-category-header .category-name {
    border-left: 3px solid #6D9441;
    padding-left: 10px;
}

.sidebar-nav .mdui-divider {
    margin: 15px 0;
}


/* Link and Card Colors */
.link-line {
    background-color: #fff;
}

.link-title {
    color: #060 !important;
}

.link-title:hover {
    color: #c30 !important;
}

/* 锚点元素位置 */
.anchor-element {
    display: block;
    clear: both; /* 确保锚点元素在浮动元素下方 */
    /*margin-top: -80px;*/
    /*padding-top: 80px;*/
    width: 100%;
}

.cat-title {
    clear: both;
    color: #ACB200 !important;
    border-color: #91895B #91895B #91895B #6D9441 !important;
    border-style: dashed dashed dashed solid !important;
    border-width: 1px 1px 1px 3px !important;
    padding: 5px 0 5px 10px !important;
    font-size: 1.5em !important;
    font-weight: normal !important;
    line-height: 1em !important;
    width: 100% !important;
    margin-top: 20px !important;
    /*margin-bottom: 20px !important;*/
    background-color: #fff;
    position: relative;
    z-index: 10;
}

.link-line {
    font-size: 16px;
    /* border-bottom: 1px solid #dddddd; */
    height: 120px;
    position: relative;
    overflow: hidden;
}

.link-line .angle {
    width: 50px;
    height: 70px;
    position: absolute;
    background: #FF5722;
    top: -50px;
    right: -50px;
    transform: rotate(45deg);
    color: #fff;
}

.link-line .angle span {
    position: absolute;
    bottom: 0;
    display: block;
    width: 20px;
    text-align: center;
}

.link-line img {
    width: 16px;
    height: 16px;
    /*border-radius: 50%;*/
    margin-right: 1px;
    position: relative;
    top: 3px;
}

.link-line a {
    color: #212121;
    text-decoration: none;
}

.link-space {
    margin-top: 16px;
    z-index: 1;
}

.link-title {
    /*color:rgb(0,0,0);*/
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 15px;
}

.link-content {
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    color: #ccc;
}

.default-title h1 {
    font-size: 1.2em;
}

.category-name {
    padding-left: 8px;
    font-weight: bold;
}

.category-name i {
    padding-right: 12px;
}

/* Footer styles from www.darkmi.com */
.site-footer, footer {
    position: relative;
    width: 100%;
    height: 110px;
    margin-top: 1.5em;
    background-color: var(--footer_background_solid);
    background-image: url(footer.webp);
    background-repeat: repeat-x;
    background-position: center bottom;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--footer_text_color);
    transition: color 0.3s ease;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.footer_bg_img {
    display: none;
}

.footer_div_item {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: 0;
    padding: 1em;
    box-sizing: border-box;
    color: var(--footer_text_color);
    background: none;
    transition: color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer_a_item, footer a {
    color: var(--footer_link_text_color);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    padding: 0 0.2em;
}

.footer_a_item:hover, footer a:hover {
    color: var(--footer_link_hover_color);
    background-color: var(--footer_link_hover_bg);
}

html.dark .site-footer, html.dark footer {
    background-image: none;
}

.top {
    position: fixed;
    right: 10px;
    bottom: 30px;
    z-index: 1000;
    border-radius: 40px;
    /* border:1px solid red; */
}

.top i {
    font-size: 40px;
    color: #1E9FFF;
    font-weight: bold;
}

.hidden {
    display: none;
}

/* 显示二维码 */
.show_qrcode {
    height: 300px;
    width: 260px;
    text-align: center;
}

.show_qrcode img {
    text-align: center;
    max-height: 200px;
    max-width: 200px;
}

/* msg弹窗提醒 */
.msg {
    width: 40%;
    line-height: 16px;
    text-align: center;
    padding: 16px;
    position: fixed;
    top: 30%;
    left: 30%;
    /* color:#FFFFFF; */
    /* border: 1px #009933 solid; */
    background-color: rgba(0, 0, 0, 0.3);
    /* box-shadow:2px 2px 2px #aaa; */
    border-radius: 2px;
    display: none;
}

.mdui-dialog-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
}

.mdui-snackbar-top {
    background-color: #FF2377;
}

/* anchor offset handled by .anchor-element */

/* :target {
    padding-top: 70px;
    margin-top: -70px;
  } */

.category_sub {
    font-size: 14px;
    margin-left: 0px;
    /*padding-left:8px;*/
}

.category_sub i {
    padding-right: 5px;
}

#drawer {
    /* background-color: #FEFEFE; */
    /* box-shadow:1px 0 5px 0 #eeeeee; */
    /* border-right: 0.5px solid rgba(0, 0, 0, 0.12); */
}

#qrcode img {
    max-width: 200px;
}

/* 响应式：移动端隐藏侧边栏 */
@media (max-width: 768px) {
    .page-layout {
        flex-direction: column;
    }

    .sidebar-nav {
        display: none;
    }

    .content-main {
        width: 100%;
    }
}
