/* 基础变量定义 */
:root {
    --primary-color: #007acc;
    --secondary-color: #00a8ff;
    --accent-color: #00d8ff;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    /* 亮色主题 */
    --bg-color: #f7fafc;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --code-bg: #edf2f7;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: rgba(0, 120, 212, 0.05);
}

/* 深色主题变量 */
body.dark-theme {
    --bg-color: #0a0e17;
    --surface-color: #1a1f2e;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --border-color: #2d3748;
    --code-bg: #1e2532;
    --shadow-color: rgba(0, 120, 212, 0.2);
    --hover-color: rgba(0, 216, 255, 0.1);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.tech-theme {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100vh;
}

/* 网格背景 */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* 头部样式 */
.main-header {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(10, 14, 23, 0.98));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.dark-theme .main-header {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(10, 14, 23, 0.98));
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: translateY(-2px);
}

.logo-icon {
    position: relative;
    margin-right: 15px;
    font-size: 32px;
    color: var(--accent-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    top: -2px;
    right: -2px;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--accent-color);
}

.logo-text h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 300;
}

/* 头部操作按钮 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: rotate(15deg);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover img {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-color);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--hover-color);
    color: var(--accent-color);
    padding-left: 25px;
}

/* 导航栏 */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--hover-color);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link i {
    font-size: 14px;
    width: 16px;
}

.nav-link.active {
    color: var(--accent-color);
    background: var(--hover-color);
}

.nav-link.active::before {
    width: 100%;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-input {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 12px 20px;
    padding-right: 45px;
    color: var(--text-primary);
    width: 300px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
    width: 320px;
}

.search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
}

.search-input:focus + .search-btn {
    color: var(--accent-color);
}

/* 主内容区 */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 300px);
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #38a169);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #dd6b20);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #e53e3e);
}

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

.btn-outline:hover {
    background: var(--accent-color);
    color: white;
}

/* 卡片样式 */
.tech-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), var(--primary-color));
    opacity: 0.8;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow-color);
    border-color: var(--accent-color);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent-color);
}

/* 代码块样式 */
.code-block {
    background: var(--code-bg);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overflow-x: auto;
    border-left: 4px solid var(--accent-color);
    position: relative;
}

.code-block pre {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 12px;
}

.code-lang {
    background: rgba(0, 216, 255, 0.1);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 技术标签 */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.tech-tag {
    background: rgba(0, 216, 255, 0.1);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(0, 216, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.tech-tag:hover {
    background: rgba(0, 216, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px var(--shadow-color);
}

/* 帖子列表 */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thread-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thread-item:hover {
    border-color: var(--accent-color);
    background: var(--hover-color);
    transform: translateX(5px);
}

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

.thread-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.thread-title a:hover {
    color: var(--accent-color);
}

.thread-excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    align-items: center;
}

.thread-meta i {
    margin-right: 5px;
    color: var(--accent-color);
}

.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.thread-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
}

.thread-count-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 版块列表 */
.forum-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forum-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    gap: 15px;
}

.forum-item:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.forum-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.forum-info {
    flex: 1;
}

.forum-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.forum-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.forum-title a:hover {
    color: var(--accent-color);
}

.forum-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.forum-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
}

.forum-latest {
    min-width: 200px;
}

.latest-post {
    text-align: right;
}

.latest-post a {
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-post a:hover {
    color: var(--accent-color);
}

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

/* 页脚样式 */
.main-footer {
    margin-top: 9px;
    padding: 60px 30px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(10, 14, 23, 0.98));
}

body.dark-theme .main-footer {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95), rgba(10, 14, 23, 0.98));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.stat i {
    color: var(--accent-color);
    width: 16px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-bottom a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

.tech-footer {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .thread-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .thread-stats {
        flex-direction: row;
        gap: 20px;
        width: 100%;
        justify-content: space-around;
    }
    
    .forum-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .forum-latest {
        min-width: 100%;
    }
    
    .latest-post {
        text-align: left;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 10px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .tech-card {
        padding: 20px;
    }
}