/**
 * WebNav - 统一样式文件
 * 整合了所有样式：基础、暗色主题、动画、响应式、背景设置
 * @version 2.0
 */

/* ==================== CSS 变量定义 ==================== */
:root {
    /* 主题色 - 简约黑白灰 */
    --primary-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --primary-color: #2c3e50;
    --primary-dark: #1a252f;
    --secondary-color: #34495e;
    --accent-color: #000000;

    /* 文字颜色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-gray: #999999;
    --text-light: #cccccc;

    /* 背景色 */
    --bg-primary: #fafafa;
    --bg-white: rgba(255, 255, 255, 0.95);
    --bg-white-light: rgba(255, 255, 255, 0.8);
    --bg-white-lighter: rgba(255, 255, 255, 0.98);
    --bg-gray-light: #f5f5f5;

    /* 边框颜色 */
    --border-light: rgba(0, 0, 0, 0.08);
    --border-lighter: rgba(0, 0, 0, 0.06);
    --border-dark: rgba(0, 0, 0, 0.12);

    /* 阴影 - 黑白灰 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-primary-lg: 0 6px 16px rgba(0, 0, 0, 0.18);

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;

    /* 间距 */
    --spacing-xs: 6px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;

    /* 过渡 */
    --transition-base: all 0.3s ease;
    --transition-cubic: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* 背景透明度 */
    --content-opacity: 0.95;

    /* 主题扩展变量 */
    --app-bg: #f4f6fb;
    --surface-nav: rgba(255, 255, 255, 0.72);
    --surface-input: rgba(255, 255, 255, 0.78);
    --surface-popover: rgba(255, 255, 255, 0.9);
    --surface-panel: rgba(255, 255, 255, 0.92);
    --card-surface: rgba(255, 255, 255, 0.95);
    --card-surface-hover: rgba(255, 255, 255, 0.98);
    --theme-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --scrollbar-thumb: rgba(0, 0, 0, 0.35);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.55);
}


:root[data-theme="dark"],
body[data-theme="dark"] {
    --text-primary: #f4f7ff;
    --text-secondary: #a3afc3;
    --text-gray: #7c859e;
    --bg-primary: #0d141f;
    --bg-white: rgba(18, 23, 35, 0.95);
    --bg-white-light: rgba(24, 30, 46, 0.72);
    --bg-white-lighter: rgba(27, 34, 50, 0.92);
    --app-bg: var(--bg-primary);
    --app-texture: url(https://img.imsyy.top/bg/dark/black-paper.png);
    --surface-nav: rgba(19, 25, 37, 0.85);
    --surface-input: rgba(22, 29, 43, 0.7);
    --surface-popover: rgba(21, 27, 40, 0.92);
    --surface-panel: rgba(16, 22, 33, 0.92);
    --card-surface: rgba(255, 255, 255, 0.2);
    --card-surface-hover: rgba(255, 255, 255, 0.3);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-lighter: rgba(255, 255, 255, 0.05);
    --border-dark: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 18px 36px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 12px 32px rgba(0, 0, 0, 0.65);
    --shadow-primary-lg: 0 18px 44px rgba(0, 0, 0, 0.7);
    --scrollbar-thumb: rgba(255, 255, 255, 0.28);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.45);
}

/* ==================== 基础样式 ==================== */
html { height: 100%; }

* {
    user-select: none;
}

body {
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !important;
    background-color: var(--app-bg) !important;
    background-image: var(--app-texture);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background var(--theme-transition), color var(--theme-transition), background-image var(--theme-transition);
}

body:not(.theme-ready) {
    transition: none;
}

a {
    text-decoration: none !important;
    transition: var(--transition-base);
}

a:hover {
    text-decoration: none;
}

p {
    color: var(--text-secondary);
}

label {
    font-weight: 400 !important;
}

/* ==================== 布局系统 ==================== */
.col-sm-3 {
    width: 20% !important;
    float: left !important;
}

.page-container {
    display: table;
    width: 100%;
    height: 100%;
    vertical-align: top;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.page-container .main-content {
    display: table-cell;
    position: relative;
    z-index: 1;
    padding: 0 !important;
    vertical-align: top;
    word-break: break-word;
    width: 100%;
    transition: opacity 0.1s ease-in-out;
}

.main-content > #search,
.main-content > #links-container {
    padding-left: 60px;
    padding-right: 60px;
}

/* ==================== Logo 区域 ==================== */
.logo-env {
    width: 100%;
    height: 100px;
    min-height: 60px;
    max-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    margin: 0 auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    will-change: transform, box-shadow;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.logo-env:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.logo-env .logo {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-env .logo:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

.logo-env .logo i {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 顶部导航栏 ==================== */
.user-info-navbar {
    background: var(--surface-nav);
    min-height: 0;
    border: 0;
    padding: 0;
    margin: 0 !important;
    margin-bottom: var(--spacing-xl) !important;
    border-radius: 0 !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
}

.list-inline {
    display: flex;
    height: 70px;
    margin: 0 !important;
    align-items: center;
}

.menu-item {
    display: flex !important;
    align-items: center;
    margin-left: var(--spacing-md);
    padding: 0 !important;
    font-size: 1.75rem;
}

.menu-item a {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    will-change: transform, box-shadow, background;
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.menu-item a:hover {
    background: var(--primary-gradient);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.menu-item a:active {
    transform: scale(0.95);
}

.menu-item a i {
    transition: var(--transition-cubic);
}

.menu-item a:hover i {
    transform: scale(1.1);
}

.menu-item.desktop-only {
    display: flex !important;
    align-items: center;
    margin-left: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.75rem;
}

.menu-item.desktop-only i {
    font-size: 1.75rem;
    margin-right: var(--spacing-xs);
}

/* ==================== 搜索框区域 ==================== */
#search {
    max-width: 700px;
    margin: 60px auto 20px;
}

#search form {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    margin: 0;
}

#search-text {
    flex: 1;
    border-radius: 15px 0 0 15px !important;
    margin: 0;
    height: 50px !important;
    padding: 9pt;
    width: 100%;
    font-size: 1pc;
    border: 1px solid var(--border-lighter);
    background: var(--surface-input);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s, transform 0.2s, background-color var(--theme-transition), color var(--theme-transition), border-color var(--theme-transition);
}

#search-text:focus {
    outline: none;
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

#search-text:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

#search button {
    border-radius: 0 15px 15px 0;
    margin: 0;
    height: 50px !important;
    width: 60px !important;
    min-width: 60px !important;
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border: 0;
    transition: var(--transition-cubic);
}

#search button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    cursor: pointer;
    transform: scale(1.05);
}

#search button i {
    color: #fff;
    font-size: 18px;
}

/* 搜索类型选择 */
.search-group {
    display: none;
    padding-left: 75px;
}

.s-current {
    display: block;
}

.s-current .search-type {
    padding-left: 0;
    display: block;
}

#search-list {
    position: relative;
}

.s-type {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 13;
    width: 75px;
}

.s-type > span {
    display: block;
    height: 31px;
    width: 75px;
}

.s-type-list {
    display: none;
    position: absolute;
    top: 31px;
    padding: 6px 0;
    width: 70px;
    background: var(--surface-popover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.s-type-list:before {
    position: absolute;
    top: -16px;
    left: 24px;
    content: '';
    display: block;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-bottom-color: var(--surface-popover);
}

.s-type:hover .s-type-list {
    display: block;
}

.s-type-list label {
    display: block;
    font-size: 15px;
    text-align: center;
    font-weight: 400;
    margin-bottom: 0;
    padding: 6px 0;
    cursor: pointer;
    transition: var(--transition-base);
    border-radius: 5px;
    margin: 2px 5px;
}

.s-type-list label:hover {
    background: var(--primary-gradient);
    color: #fff;
}

.type-text {
    position: absolute;
    left: 0;
    width: 75px;
    padding-left: 18px;
    font-size: 1.45rem;
    line-height: 31px;
    font-weight: 600;
    color: var(--text-primary);
}

.type-text:after {
    content: "\f105";
    font-family: FontAwesome;
    margin: 0 0 0 8px;
}

.search-type {
    white-space: nowrap;
    margin: 0;
    overflow: auto !important;
}

.search-type label {
    margin: 0;
}

.search-type li {
    display: inline-block;
    list-style: none;
}

.search-type li label {
    display: inline-block;
    padding: 0 11px;
    font-size: 14px;
    line-height: 31px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--bg-white-light);
    margin: 0 2px;
}

.search-type input:checked + label,
.search-type input:hover + label {
    background: var(--primary-gradient) !important;
    color: #fff;
}

.search-type input:checked + label span {
    color: #fff !important;
}

#type-site-search:checked + label span {
    color: #fff !important;
}

.set-check {
    margin-top: 3px;
    font-size: 9pt;
}

.set-check input,
.set-check label {
    opacity: 0;
    transition: var(--transition-base);
}

/* ==================== 链接卡片 ==================== */
.box2 {
    height: 86px;
    cursor: pointer;
    border-radius: var(--radius-xl);
    padding: 0 var(--spacing-xl);
    /* 日间模式下提高对比度 */
    background: var(--card-surface);
    border: 1px solid var(--border-light);
    margin: 20px 0 0 0;
    will-change: transform, box-shadow;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    /* 加强阴影以提高卡片可见性 */
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateZ(0);
}

.box2:hover {
    transform: translateY(-8px);
    background: var(--card-surface-hover);
    box-shadow: var(--shadow-primary-lg);
    border-color: var(--border-dark);
}

.box2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.box2:hover::before {
    opacity: 1;
}

.xe-comment-entry img {
    float: left;
    display: block;
    margin-right: 10px;
}

.xe-comment {
    transform: translateY(-50%);
    position: absolute;
    margin-left: 50px;
    top: 50%;
}

.xe-comment p {
    margin-bottom: 0;
    margin-right: 15px;
}

.xe-widget.xe-conversations {
    position: relative;
    background: transparent;
    margin-bottom: 0;
    padding: 15px;
}

/* 卡片标题颜色 */
.xe-user-name strong {
    color: var(--text-primary) !important;
}

.overflowClip_1 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-right: 4px;
}

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

.img-circle {
    padding: 7px 0;
}

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

/* ==================== 液态金属按钮基础 ==================== */
.liquid-button {
    --liquid-size: 60px;
    --liquid-core-size: 46px;
    --liquid-icon-size: 22px;
    border: none;
    background: transparent;
    padding: 0;
    width: var(--liquid-size);
    height: var(--liquid-size);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.liquid-button__liquid {
    position: relative;
    width: var(--liquid-size);
    height: var(--liquid-size);
    border-radius: 50%;
}

.liquid-button__liquid::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--liquid-core-size);
    height: var(--liquid-core-size);
    background: linear-gradient(#5a5a5a, #080808);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.liquid-button__liquid canvas {
    border-radius: 50%;
}

.liquid-button__outline {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--liquid-size);
    height: var(--liquid-size);
    border-radius: 50%;
    z-index: 1;
}

.liquid-button__outline::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 3px;
    border-radius: inherit;
    background: conic-gradient(from 180deg, #6aa5ff, #c471ff, #ff9292, #c471ff, #6aa5ff);
    filter: grayscale(1);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: filter 0.3s ease;
}

.liquid-button:hover .liquid-button__outline::before {
    filter: grayscale(0);
}

.liquid-button__icon {
    width: var(--liquid-icon-size);
    height: var(--liquid-icon-size);
    fill: #d5d5d5;
}

/* ==================== 返回顶部按钮 ==================== */
#back-to-top {
    display: none;
    position: fixed;
    right: 30px;
    bottom: 40px;
    z-index: 9999;
    border: none;
    background: transparent;
}

#back-to-top:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 6px;
}

#back-to-top:hover {
    transform: translateY(-4px);
}

#topup {
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.3s, box-shadow 0.3s;
    width: 48px;
    height: 48px;
    font-size: 24px;
}

#topup:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== 其他组件 ==================== */
.text-gray,
.text-gray i {
    font-size: 1.45em !important;
    color: var(--text-secondary) !important;
}

.panel-body {
    border-radius: 4px;
    background: var(--surface-panel);
    padding: 15px var(--spacing-xl) !important;
    margin: var(--spacing-xl) var(--spacing-xl) var(--spacing-xl) 0;
    font-size: 1.45rem;
    color: var(--text-primary);
    line-height: 24px;
}

.panel-body h4 {
    font-weight: 700;
    font-size: 1.75rem;
    margin: 16px 0;
}

.panel-body i {
    margin-right: var(--spacing-sm);
}

.tooltip-inner {
    border-radius: 4px !important;
    padding: 6px 10px !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: var(--scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* ==================== 暗色主题 ==================== */
body[data-theme="dark"] {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* 组件背景 */
body[data-theme="dark"] .user-info-navbar {
    background: rgba(30, 30, 30, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .logo-env {
    background: var(--primary-gradient);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .logo-env:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* 文字颜色 */
body[data-theme="dark"],
body[data-theme="dark"] h1, body[data-theme="dark"] h2, body[data-theme="dark"] h3, body[data-theme="dark"] h4, body[data-theme="dark"] h5, body[data-theme="dark"] h6,
body[data-theme="dark"] .xe-user-name strong,
body[data-theme="dark"] #jinrishici-sentence,
body[data-theme="dark"] .type-text {
    color: var(--text-primary) !important;
}

body[data-theme="dark"] .text-gray,
body[data-theme="dark"] .xe-comment p {
    color: var(--text-secondary) !important;
}

body[data-theme="dark"] .menu-item .fa-solid.fa-message {
    color: #ffffff !important;
}

body[data-theme="dark"] label[for="type-git"] span,
body[data-theme="dark"] label[for="type-git1"] span,
body[data-theme="dark"] label[for="type-links"] span {
    color: var(--text-primary) !important;
}

/* 导航和菜单 */
body[data-theme="dark"] .menu-item a {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary);
}

body[data-theme="dark"] .menu-item a:hover {
    background: var(--primary-gradient) !important;
    color: #fff;
    box-shadow: var(--shadow-primary-lg);
}

/* 搜索框 */
body[data-theme="dark"] #search-text {
    background: rgba(40, 40, 40, 0.6) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #search-text:focus {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .s-type-list {
    background: rgba(35, 35, 35, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .s-type-list:before {
    border-bottom-color: rgba(35, 35, 35, 0.85);
}

body[data-theme="dark"] .search-type li label {
    background: var(--bg-white-light);
    color: var(--text-primary);
}

body[data-theme="dark"] .search-type input:checked + label,
body[data-theme="dark"] .search-type input:hover + label {
    background: var(--primary-gradient) !important;
    color: #fff;
}

/* 卡片 */
body[data-theme="dark"] .box2,
body[data-theme="dark"] .xe-widget.xe-conversations {
    background: var(--card-surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body[data-theme="dark"] .box2:hover,
body[data-theme="dark"] .xe-widget.xe-conversations:hover {
    background: var(--card-surface-hover) !important;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}


body[data-theme="dark"] .panel-body {
    background: var(--bg-white) !important;
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

body[data-theme="dark"] .panel-body h4,
body[data-theme="dark"] .panel-body p {
    color: var(--text-primary);
}

/* 滚动条 */
body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: #555555;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: #666666;
}

/* ==================== 新暗色主题（平滑过渡） ==================== */
body[data-theme="dark"] {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body[data-theme="dark"] .user-info-navbar {
    background: var(--surface-nav);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] #search-text {
    background: var(--surface-input) !important;
    border-color: var(--border-light);
    color: var(--text-primary);
}

body[data-theme="dark"] .s-type-list {
    background: var(--surface-popover) !important;
    border-color: var(--border-light);
}

body[data-theme="dark"] .s-type-list:before {
    border-bottom-color: var(--surface-popover);
}

body[data-theme="dark"] .menu-item a {
    color: var(--text-primary);
}

body[data-theme="dark"] .menu-item a:hover {
    background: var(--primary-gradient) !important;
    color: #fff;
}

body[data-theme="dark"] .panel-body {
    background: var(--surface-panel);
    color: var(--text-primary);
}

body[data-theme="dark"] .settings-panel {
    background: var(--surface-panel);
    border-left: 1px solid var(--border-light);
    box-shadow: -3px 0 30px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .settings-panel-header {
    border-bottom-color: var(--border-light);
}

body[data-theme="dark"] .setting-item input[type="text"] {
    background: rgba(24, 30, 46, 0.7);
    border-color: var(--border-light);
    color: var(--text-primary);
}

body[data-theme="dark"] .setting-item input[type="range"] {
    background: rgba(24, 30, 46, 0.7);
}

/* ==================== 背景设置面板 ==================== */
.settings-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    height: 100%;
    background-color: var(--surface-panel);
    box-shadow: -3px 0 20px rgba(0,0,0,0.15);
    transition: right 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.settings-panel.is-visible {
    right: 0;
}

.settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
}

.settings-panel-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.settings-panel .close-btn {
    border: none;
    background: none;
    font-size: 26px;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.settings-panel .close-btn:hover {
    opacity: 1;
}

.settings-panel-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.setting-item {
    margin-bottom: 25px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.setting-item input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    box-sizing: border-box;
    background: var(--bg-white-light);
    color: var(--text-primary);
}

.setting-item input[type="range"] {
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-white-light);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-top: 10px;
}

.setting-item input[type="range"]:hover {
    opacity: 1;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

.setting-item button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
    font-size: 15px;
    transition: background-color 0.2s;
}

#apply-bg-btn {
    background-color: #007bff;
}

#apply-bg-btn:hover {
    background-color: #0069d9;
}

#reset-bg-btn {
    background-color: #6c757d;
}

#reset-bg-btn:hover {
    background-color: #5a6268;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* 暗色主题设置面板 */
body[data-theme="dark"] .settings-panel {
    background-color: #32363d;
    color: var(--text-primary);
}

body[data-theme="dark"] .settings-panel-header {
    border-bottom-color: #484d55;
}

body[data-theme="dark"] .settings-panel-header h4,
body[data-theme="dark"] .settings-panel .close-btn,
body[data-theme="dark"] .setting-item label {
    color: var(--text-primary);
}

body[data-theme="dark"] .setting-item input[type="text"] {
    background-color: #282c34;
    border-color: #484d55;
    color: var(--text-primary);
}

body[data-theme="dark"] .setting-item input[type="range"] {
    background: #282c34;
}

body[data-theme="dark"] .setting-item input[type="range"]::-webkit-slider-thumb {
    background: #8ab4f8;
}

body[data-theme="dark"] .setting-item input[type="range"]::-moz-range-thumb {
    background: #8ab4f8;
}

/* 自定义背景 */
body.with-custom-bg {
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

body.with-custom-bg .page-container {
    background-color: rgba(245, 245, 245, var(--content-opacity, 0.9));
    backdrop-filter: blur(8px);
}

body.with-custom-bg[data-theme="dark"] .page-container {
    background-color: rgba(40, 44, 52, var(--content-opacity, 0.9));
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
}

/* 搜索按钮动画 */
#search button {
    position: relative;
    overflow: hidden;
}

#search button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

#search button:hover::before {
    width: 100px;
    height: 100px;
}

/* Logo 动画 */
.logo-env:hover .logo i {
    animation: pulse 1s ease-in-out;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 响应式设计 ==================== */
/* 桌面端导航栏布局 */
@media screen and (min-width: 769px) {
    .navbar.user-info-navbar .user-info-menu {
        justify-content: flex-start;
    }

    .menu-item.night-mode-btn {
        margin-left: auto;
    }

    .menu-item.desktop-only {
        display: flex !important;
        margin-left: var(--spacing-md);
    }
}

/* 中等屏幕 */
@media (max-width: 1200px) {
    .col-sm-3 {
        width: 25% !important;
    }
}

/* 平板 */
@media (max-width: 900px) {
    .main-content > #search,
    .main-content > #links-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .col-sm-3 {
        width: 33.3% !important;
    }

    /* 移动端搜索优化 */
    #search {
        margin: 25px auto 15px;
    }

    #search-text {
        border-radius: 12px;
        height: 45px;
    }

    /* 移动端卡片优化 */
    .box2 {
        border-radius: 12px;
        margin: 15px 0 0 0;
    }

    .logo-env {
        border-radius: 12px;
        margin: 10px;
    }

    /* 移动端导航栏优化 - 两端对齐布局 */
    .navbar.user-info-navbar {
        padding: 6px 15px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        min-height: auto;
        height: auto;
    }

    .navbar.user-info-navbar .user-info-menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    /* 左侧按钮组 */
    .navbar.user-info-navbar .user-info-menu .menu-item:not(.night-mode-btn) {
        margin: 0;
        flex-shrink: 0;
        min-width: auto;
    }

    /* 右侧夜间模式按钮 */
    .navbar.user-info-navbar .user-info-menu .menu-item.night-mode-btn {
        margin: 0;
        margin-left: auto;
        flex-shrink: 0;
        min-width: auto;
    }

    /* 统一所有按钮样式 */
    .navbar.user-info-navbar .user-info-menu .menu-item a {
        padding: 6px 1px;
        font-size: 0.85rem;
        text-align: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
        white-space: nowrap;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 25px;
        min-height: 25px;
    }

    .navbar.user-info-navbar .user-info-menu .menu-item a:hover {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
    }

    .navbar.user-info-navbar .user-info-menu .menu-item a i {
        font-size: 1.8rem;
        margin-right: 0;
        margin-bottom: 0;
    }

    /* 移动端隐藏所有文字 */
    .navbar.user-info-navbar .user-info-menu .menu-item a span {
        display: none !important;
    }

    /* 移动端隐藏今日诗词 */
    .navbar.user-info-navbar .user-info-menu .menu-item.desktop-only {
        display: none !important;
    }

    /* 夜间模式下的移动端导航栏 */
    body[data-theme="dark"] .navbar.user-info-navbar {
        background: rgba(36, 41, 46, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    body[data-theme="dark"] .navbar.user-info-navbar .user-info-menu .menu-item a {
        background: rgba(59, 63, 92, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }

    body[data-theme="dark"] .navbar.user-info-navbar .user-info-menu .menu-item a:hover {
        background: rgba(80, 80, 80, 0.8);
        border-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
}

/* 小屏幕手机 */
@media (max-width: 580px) {
    .col-sm-3 {
        width: 50% !important;
    }
}

/* 超小屏幕优化 */
@media screen and (max-width: 480px) {
    .navbar.user-info-navbar {
        padding: 4px 10px;
    }

    .navbar.user-info-navbar .user-info-menu {
        gap: 6px;
    }

    .navbar.user-info-navbar .user-info-menu .menu-item a {
        padding: 4px 1px;
        font-size: 0.8rem;
        min-width: 30px;
        min-height: 30px;
    }

    .navbar.user-info-navbar .user-info-menu .menu-item a i {
        font-size: 1.8rem;
        margin-right: 0;
    }
}

/* 打印样式 */
@media print {
    #search,
    .navbar.user-info-navbar,
    #back-to-top,
    .settings-panel,
    .settings-overlay {
        display: none !important;
    }
}
