/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 黑夜模式（默认） */
:root {
    --bg0: #070A12;
    --bg1: #0B1220;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #22c55e;
    --card: rgba(255,255,255,.06);
    --stroke: rgba(255,255,255,.10);
    --text: #ffffff;
    --text-muted: rgba(255,255,255,.65);
    --text-secondary: rgba(255,255,255,.55);
    --shadow: 0 18px 50px rgba(0,0,0,.55);
}

/* 白天模式 */
:root[data-theme="light"] {
    --bg0: #f8fafc;
    --bg1: #ffffff;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #22c55e;
    --card: rgba(0,0,0,.03);
    --stroke: rgba(0,0,0,.10);
    --text: #1e293b;
    --text-muted: #475569;
    --text-secondary: #64748b;
    --shadow: 0 4px 12px rgba(0,0,0,.08);
}

html, body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* 黑夜模式背景 */
body {
    background: radial-gradient(1100px 700px at 20% 0%, rgba(99,102,241,.25), transparent 55%),
                radial-gradient(900px 600px at 90% 10%, rgba(34,197,94,.18), transparent 60%),
                radial-gradient(1000px 700px at 60% 110%, rgba(236,72,153,.14), transparent 55%),
                linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* 白天模式背景 */
:root[data-theme="light"] body {
    background: radial-gradient(1100px 700px at 20% 0%, rgba(99,102,241,.08), transparent 55%),
                radial-gradient(900px 600px at 90% 10%, rgba(34,197,94,.06), transparent 60%),
                radial-gradient(1000px 700px at 60% 110%, rgba(236,72,153,.05), transparent 55%),
                linear-gradient(180deg, var(--bg0), var(--bg1));
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.14);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.20);
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,.20);
}

.glass {
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

:root[data-theme="light"] .glass {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
}

.glass-soft {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="light"] .glass-soft {
    background: #f9fafb;
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部 */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--stroke);
    background: rgba(0,0,0,.20);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

:root[data-theme="light"] .header {
    background: rgba(255,255,255,.80);
}

.header-content {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-secondary);
}

.nav {
    display: flex;
    gap: 0.5rem;
    margin-right: auto;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,.05);
    border-color: var(--stroke);
}

:root[data-theme="light"] .nav-link:hover {
    background: rgba(99,102,241,.08);
    border-color: rgba(99,102,241,.20);
}

.nav-link.active {
    color: var(--text);
    background: rgba(99,102,241,.15);
    border-color: rgba(99,102,241,.30);
}

/* 主题切换按钮 */
.theme-toggle {
    padding: 0.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--stroke);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

:root[data-theme="light"] .theme-toggle {
    background: #f3f4f6;
    border: 1px solid rgba(0,0,0,.12);
}

.theme-toggle:hover {
    background: rgba(255,255,255,.10);
    transform: scale(1.05);
}

:root[data-theme="light"] .theme-toggle:hover {
    background: #e5e7eb;
    border-color: rgba(0,0,0,.18);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.theme-icon {
    display: block;
    line-height: 1;
}

.btn-primary {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #6366f1);
    background: transparent;
    border: 1px solid var(--primary, #6366f1);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary, #6366f1);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-publish {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #6366f1);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-publish:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

a.btn-publish,
a.btn-publish:hover,
a.btn-publish:active,
a.btn-publish:visited {
    color: #fff !important;
}

/* 按钮链接样式 */
a.btn-primary {
    color: var(--primary, #6366f1) !important;
}
a.btn-primary:hover {
    color: #fff !important;
}

/* 页脚 */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--stroke);
    background: rgba(0,0,0,.20);
}

:root[data-theme="light"] .footer {
    background: rgba(0,0,0,.02);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0.25rem 0;
}

.footer-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.6rem;
}

.footer-pages a {
    color: var(--text-muted, #999) !important;
    text-decoration: none !important;
    font-size: 13px;
    padding: 2px 6px;
    transition: color 0.2s;
}

.footer-pages a:hover {
    color: var(--text-secondary, #bbb) !important;
    text-decoration: none !important;
}

.footer-pages-dot {
    color: var(--text-muted);
    font-size: 13px;
    user-select: none;
}

/* 消息通知按钮 & 签到按钮 */
.notification-btn,
.checkin-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 36px !important;
    min-width: 52px !important;
    max-width: none !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.06) !important;
    border: none !important;
    outline: none;
    box-shadow: none !important;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    appearance: none;
    line-height: 36px !important;
    font-size: 13px !important;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.notification-btn .top-text-label,
.checkin-btn .top-text-label {
    display: inline-block;
    font-size: 13px;
    line-height: 1;
}

:root[data-theme="light"] .notification-btn,
:root[data-theme="light"] .checkin-btn {
    background-color: #f3f4f6 !important;
}

/* hover 上浮效果 */
.notification-btn:hover,
.checkin-btn:hover {
    transform: translateY(-2px);
}

/* 通知按钮 hover */
.notification-btn:hover {
    background-color: rgba(49,158,236,0.12) !important;
}
:root[data-theme="light"] .notification-btn:hover {
    background-color: rgba(49,158,236,0.1) !important;
}

/* 签到按钮 hover */
.checkin-btn:hover {
    background-color: rgba(249,115,22,0.12) !important;
}
:root[data-theme="light"] .checkin-btn:hover {
    background-color: rgba(249,115,22,0.1) !important;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-btn:hover {
    background: #e5e7eb;
}

[data-theme="dark"] .mobile-menu-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: var(--text);
}

[data-theme="dark"] .mobile-menu-btn:hover {
    background: rgba(255,255,255,.12);
}

/* 移动端侧边菜单遮罩 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 移动端侧边菜单 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg1);
    border-right: 1px solid var(--stroke);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    flex-direction: column;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
    border-bottom: 1px solid var(--stroke);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-close:hover {
    background: rgba(255,255,255,.12);
}

:root[data-theme="light"] .mobile-menu-close {
    background: rgba(0,0,0,.05);
}

:root[data-theme="light"] .mobile-menu-close:hover {
    background: rgba(0,0,0,.08);
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    background: rgba(255,255,255,.08);
}

.mobile-nav-link.active {
    background: rgba(99,102,241,.15);
    color: var(--primary);
}

.mobile-nav-link.highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
}

.mobile-nav-link.highlight:hover {
    opacity: 0.9;
}

:root[data-theme="light"] .mobile-nav-link:hover {
    background: rgba(0,0,0,.05);
}

.mobile-nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--stroke);
    margin: 16px 0;
}

.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-section-title {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    font-weight: 600;
}

.mobile-theme-toggle,
.mobile-checkin-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-theme-toggle:hover,
.mobile-checkin-btn:hover {
    background: rgba(255,255,255,.08);
}

:root[data-theme="light"] .mobile-theme-toggle:hover,
:root[data-theme="light"] .mobile-checkin-btn:hover {
    background: rgba(0,0,0,.05);
}

.mobile-theme-status {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255,255,255,.08);
    padding: 4px 10px;
    border-radius: 6px;
}

:root[data-theme="light"] .mobile-theme-status {
    background: rgba(0,0,0,.05);
}

.mobile-menu-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--stroke);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* 响应式 */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu-overlay {
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    .mobile-menu-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .mobile-menu {
        display: flex;
    }
    
    .theme-toggle-btn,
    .checkin-btn,
    .notification-btn,
    .header-content > .btn-publish,
    .header-content > .btn-primary {
        display: none !important;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .header-content {
        gap: 10px;
        position: relative;
    }
    
    .btn-primary {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .mobile-menu-btn {
        position: absolute;
        left: 0;
    }
    
    .logo {
        margin: 0 auto;
    }
}
