/* ===== 主样式文件 ===== */
/* 全局变量 - GitHub 风格 */
:root {
    --primary-color: #24292f;
    --primary-hover: #57606a;
    --secondary-color: #57606a;
    --success-color: #1a7f37;
    --warning-color: #9a6700;
    --danger-color: #cf222e;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-tertiary: #6e7781;
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --border-color: #d0d7de;
    --border-light: #d8dee4;
    --shadow-sm: 0 1px 0 rgba(27, 31, 36, 0.04);
    --shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
    --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
    --shadow-xl: 0 12px 28px rgba(140, 149, 159, 0.25);
    --radius-sm: 6px;
    --radius-md: 6px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* 暗色主题 - GitHub Dark */
[data-theme="dark"] {
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --text-tertiary: #6e7681;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --border-light: #21262d;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* 导航栏 - 优化版 */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.95);
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .navbar {
    background-color: rgba(13, 17, 23, 0.95);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    align-items: center;
}

.navbar-menu > li {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    position: relative;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
}

.navbar-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 0.625rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* 按钮样式 - 黑白优化版 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* 返回顶部按钮 - 黑白优化版 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--text-secondary);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* 下拉菜单样式 */
.navbar-menu .dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.dropdown-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.dropdown-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    z-index: 1000;
    list-style: none;
}

[data-theme="dark"] .dropdown-menu {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem !important;
    color: var(--text-primary) !important;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0 !important;
    background: transparent !important;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin-top: 0;
        padding-left: 1rem;
    }
    
    .dropdown-icon {
        display: none;
    }
}
