/* 护眼配色方案 */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #3d4852;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --link-primary: #2d7d46;
    --link-hover: #1d5a30;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --border-color: #e2e8f0;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, 'Helvetica Neue', Arial, 'Noto Sans CJK SC', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 固定顶部和左侧板块 */
.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.fixed-left {
    position: fixed;
    top: 70px;
    left: -200px;
    bottom: 0;
    width: 200px;
    z-index: 900;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    transition: left 0.3s ease;
}

.fixed-left.show-sidebar {
    left: 0;
}

.main-content {
    margin-top: 70px;
    margin-left: 0;
    padding: 20px;
    padding-bottom: 80px;
    transition: margin-left 0.3s ease;
}

.main-content.show-sidebar {
    margin-left: 200px;
}

/* 左侧边栏列表样式 */
.fixed-left ul {
    list-style-type: none;
    padding: 0;
}

.fixed-left ul li {
    margin-bottom: 30px;
}

.fixed-left ul li a {
    font-size: 18px;
    color: var(--link-primary);
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.fixed-left ul li a:hover {
    color: var(--link-hover);
    background-color: rgba(45, 125, 70, 0.1);
    text-decoration: none;
}

/* 网址卡片样式 */
.website-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    height: 100px;
    overflow: hidden;
}

.website-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: rgba(45, 125, 70, 0.2);
}

.website-card img {
    width: 64px;
    height: 64px;
    margin-right: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.website-card a {
    font-size: 18px;
    color: var(--link-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
    font-weight: 500;
}

.website-card a:hover {
    color: var(--link-hover);
}

.website-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 搜索框样式 */
#search-input {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 12px;
}

#search-input:focus {
    outline: none;
    border-color: var(--link-primary);
    box-shadow: 0 0 0 3px rgba(45, 125, 70, 0.1);
}

#search-input::placeholder {
    color: var(--text-muted);
}

/* 按钮样式 */
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--link-primary);
    color: #fff;
    border-color: var(--link-primary);
}

/* 页脚样式 */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    z-index: 1000;
    color: var(--text-muted);
    font-size: 14px;
}

.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: var(--link-primary);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 12px 16px;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(45, 125, 70, 0.3);
}

.back-to-top:hover {
    background-color: var(--link-hover);
    transform: translateY(-2px);
}

.back-to-top.show {
    opacity: 1;
}

.custom-logo {
    margin-left: 50px;
    width: 100px;
    height: auto;
}

.main-content h2 {
    scroll-margin-top: 80px;
}

/* 分类标题样式 */
.main-content h2.h4 {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: 2px solid #16a34a;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 分类图标样式 */
.category-icon-svg {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px;
}

.category-icon-svg svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.category-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    filter: brightness(1.2);
}

/* 导航条样式 */
.nav-pills .nav-link {
    transition: all 0.3s ease;
    background-color: transparent !important;
    color: var(--link-primary);
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    color: var(--link-hover) !important;
    transform: translateY(-2px);
}

/* 主题切换按钮 */
#theme-toggle {
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
}

/* 深色模式样式 */
body.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    --link-primary: #4ade80;
    --link-hover: #22c55e;
    --accent-green: #4ade80;
    --accent-blue: #60a5fa;
    --border-color: #2d3a4f;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .fixed-top {
    background-color: rgba(22, 33, 62, 0.95);
}

body.dark-mode .website-card {
    background: linear-gradient(145deg, #16213e 0%, #0f3460 100%);
}

body.dark-mode .main-content h2.h4 {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: 2px solid #16a34a;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode .back-to-top {
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
}

body.dark-mode footer {
    border-top-color: var(--border-color);
}

/* 电脑端左侧栏默认显示 */
@media (min-width: 769px) {
    .fixed-left {
        left: 0;
    }
    .main-content {
        margin-left: 200px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .fixed-top .gap-4 {
        gap: 1rem !important;
    }
    .nav-pills {
        display: none;
    }
    .input-group {
        width: auto !important;
    }
    .fixed-top {
        padding: 10px;
    }
    .custom-logo {
        margin-left: 10px;
        width: 80px;
    }
    #sidebar-toggle {
        display: block;
    }
    .fixed-left {
        z-index: 1001;
    }
}
