/* 
 * 主样式表
 * 修改：一些样式上的问题
 * 修复：页脚颜色锁定，不随主题变化
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    --bg: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    
    --text: #0f172a;
    --text-secondary: #475569;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --bg-opacity: 0.12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

/* 背景层 - 固定 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--bg-opacity);
    transition: opacity 0.3s;
}

.bg-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 30%, transparent 70%, var(--bg) 100%);
    z-index: 1;
}

/* 加载动画 */
#page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: var(--text-gray);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 导航 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s;
}

.site-header.scrolled {
    box-shadow: var(--shadow);
    background: rgba(255,255,255,0.95);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.4rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.main-nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-switch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.theme-switch:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.icon-moon {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* 首页 */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 0;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 4px;
}

.hero-desc {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 50px;
}

.btn {
    padding: 12px 28px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* 统计栏 */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.stat-name {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: bounce 2s infinite;
    color: var(--text-gray);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

/* 通用区块 */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
}

.section-desc {
    color: var(--text-gray);
    font-size: 1.05rem;
}

/* 服务网格 */
.services-section {
    background: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.clicks {
    color: var(--primary);
    font-weight: 600;
    background: rgba(37,99,235,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

/* 轮播 */
.slider-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: var(--bg-card);
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 400px;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.slide-info h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.slide-info p {
    opacity: 0.9;
    margin: 0;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text);
    box-shadow: var(--shadow);
    z-index: 10;
    transition: all 0.3s;
}

.slider-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-card);
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dots .dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 5px;
}

/* 友链 */
.friends-section {
    background: var(--bg);
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.friend-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.friend-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
    border-color: rgba(37,99,235,0.2);
}

.friend-card:hover::before {
    opacity: 1;
}

.f-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--border), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.f-info {
    flex: 1;
    min-width: 0;
}

.f-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.f-info p {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin: 0;
}

.f-clicks {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    color: var(--text-light);
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.friend-card:hover .f-clicks {
    opacity: 1;
}

/* 关于 */
.about-section {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 60px;
}

.about-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text);
}

.about-content .lead {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 600;
}

.about-content > p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.feature-cards {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.f-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.f-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.f-icon {
    font-size: 1.5rem;
}

.f-text h4 {
    color: var(--text);
    margin-bottom: 4px;
    font-size: 1rem;
}

.f-text p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0;
}

.about-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s;
}

.about-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.about-image img {
    width: 100%;
    display: block;
}

.year-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

/* 时间线 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    justify-content: flex-end;
    padding-right: 50%;
    position: relative;
    margin-bottom: 30px;
}

.timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 50%;
}

.timeline-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 3px solid var(--bg-secondary);
    z-index: 2;
}

.timeline-content {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 300px;
    margin-right: 30px;
    border: 1px solid var(--border);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 0;
    margin-left: 30px;
}

.timeline-content h4 {
    color: var(--text);
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.timeline-content p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0;
}

/* 评论区 */
.comments-section {
    background: var(--bg);
}

.waline-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 400px;
}

.waline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-gray);
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

/* 
 * 页脚样式 - 重要：颜色锁定，不随主题变化
 * 使用!important确保不会被覆盖
 */
.site-footer {
    background: #0f172a; /* 深色背景 */
    color: #f8fafc;      /* 浅色文字 */
    padding: 60px 0 20px;
    position: relative;
    border-top: 3px solid var(--primary);
}

/* 强制所有子元素继承浅色文字 */
.site-footer * {
    color: inherit;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .footer-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 16px;
    border: 2px solid rgba(255,255,255,0.2);
}

.footer-brand h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #ffffff !important; /* 强制白色 */
    font-weight: 700;
}

.footer-brand p {
    opacity: 0.8;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8) !important;
}

.footer-links h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #ffffff !important;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-links a,
.footer-links span {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: #ffffff !important;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6) !important;
}

.footer-bottom span {
    color: var(--primary) !important; /* 统计数字用蓝色高亮 */
    font-weight: 600;
}

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

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

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--primary-dark);
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
    border: 1px solid var(--border);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--text);
    font-size: 1.2rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 20px 24px;
}

.notice-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: 8px;
}

.notice-box p {
    color: #92400e;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.notice-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.notice-box a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: flex-end;
}

/* 强制友链头像固定大小，自动缩放 */
.f-avatar-img {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    display: block;
    box-sizing: border-box;
}