/* ========== GAN官网风格 · 全局样式 ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;400;500;600;700&display=swap');

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e9eef3;
    --text-primary: #1e2a3a;
    --text-secondary: #5b6e8c;
    --accent-blue: #0066ff;
    --accent-hover: #0052cc;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.06);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* 导航栏 - 简约留白 */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 1rem;
}

nav {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 40px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--accent-blue);
    background: rgba(0, 102, 255, 0.06);
}

/* 主容器 */
main {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 0 2rem;
    width: 100%;
    flex: 1;
}

/* 标题 */
h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}
h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 英雄区 - 大图标语 */
.hero {
    background: var(--bg-secondary);
    border-radius: 32px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    text-align: center;
    border: 1px solid var(--border-color);
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e2a3a 0%, #0066ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* 卡片布局 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}
.card h2 {
    margin-top: 0;
    color: var(--accent-blue);
}
.card p {
    color: var(--text-secondary);
    margin: 1rem 0;
}

/* 按钮 */
.btn {
    display: inline-block;
    background: var(--accent-blue);
    border: none;
    padding: 0.6rem 1.6rem;
    border-radius: 40px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* 列表样式 */
.problem-list, .post-list, .chat-container, .stat-card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.problem-item, .post-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.problem-item:last-child, .post-item:last-child {
    border-bottom: none;
}
.problem-item a, .post-item a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}
.problem-item a:hover {
    text-decoration: underline;
}

/* 难度星级 */
.difficulty-star {
    color: #ffaa33;
}
.difficulty {
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: bold;
}
.difficulty.简单 { background: #00a86b; color: white; }
.difficulty.中等 { background: #ffaa33; color: #1e2a3a; }
.difficulty.困难 { background: #ff4d4d; color: white; }

/* 聊天室 */
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
}
.message {
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 80%;
}
.message.sent {
    margin-left: auto;
    background: var(--accent-blue);
    color: white;
}
.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}
.chat-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    background: var(--bg-primary);
}
.chat-input button {
    margin-left: 0.5rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 4rem;
}

/* 响应式 */
@media (max-width: 768px) {
    nav a { padding: 0.3rem 0.8rem; font-size: 0.75rem; }
    main { padding: 0 1rem; margin: 1.5rem auto; }
    h1 { font-size: 2rem; }
    .hero { padding: 1.5rem; }
    .hero h1 { font-size: 2rem; }
}

/* ========== 强制白色主题覆盖（解决遗留深色） ========== */
body, .container, .main, .admin-container, .card, .chat-container, .sidebar, .post-list, .problem-list {
    background-color: #ffffff !important;
    color: #1e2a3a !important;
    border-color: #e9eef3 !important;
}
header, footer, nav {
    background-color: #ffffff !important;
    border-bottom-color: #e9eef3 !important;
}
nav a {
    color: #5b6e8c !important;
}
nav a:hover, nav a.active {
    color: #0066ff !important;
    background-color: rgba(0, 102, 255, 0.06) !important;
}
.message, .message.sent {
    background-color: #f8fafc !important;
    border-color: #e9eef3 !important;
}
.message.sent {
    background-color: #0066ff !important;
    color: white !important;
}
.btn, button, .submit-btn, .buy-btn {
    background-color: #0066ff !important;
    color: white !important;
}
.btn:hover, button:hover {
    background-color: #0052cc !important;
}
.problem-item, .post-item {
    border-bottom-color: #e9eef3 !important;
}
.stat-card, .rank-item {
    background-color: #ffffff !important;
}
pre, code {
    background-color: #f8fafc !important;
    color: #1e2a3a !important;
}
