/**
 * PK100 游戏社区 - 样式表
 * 明亮简洁风格
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --bg-main: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border: #E5E7EB;
    
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition: 0.2s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-img {
    height: 36px;
    width: auto;
    border-radius: var(--radius-sm);
}

.logo:hover {
    color: var(--primary);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Nav Search */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.nav-search-input {
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 300px;
    height: 40px;
    outline: none;
    transition: border-color var(--transition);
}

.nav-search-input:focus {
    border-color: var(--primary);
}

.nav-search-input::placeholder {
    color: var(--text-muted);
}

/* Nav Icon Buttons */
.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Notification Badge */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
}

/* Nav Avatar */
.nav-avatar {
    display: flex;
    align-items: center;
}

.nav-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.nav-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.lang-selector {
    margin-right: 8px;
}

.lang-select, .lang-select-sm {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color var(--transition);
}

.lang-select:hover, .lang-select-sm:hover {
    border-color: var(--primary);
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ============================================
   Main Content
   ============================================ */
.main {
    flex: 1;
    padding: 32px 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

/* ============================================
   Game Cards
   ============================================ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.game-card-image {
    width: 100%;
    height: 160px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.game-card-content {
    padding: 16px;
}

.game-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.game-card-title a {
    color: var(--text-primary);
}

.game-card-title a:hover {
    color: var(--primary);
}

.game-card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-main);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 6px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 6px;
}

/* ============================================
   Auth Forms
   ============================================ */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
}

.auth-card {
    background: var(--bg-main);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
    margin: -32px -20px 40px;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* ============================================
   Discussion List
   ============================================ */
.discussion-list {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.discussion-item {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    transition: background var(--transition);
}

.discussion-item:last-child {
    border-bottom: none;
}

.discussion-item:hover {
    background: var(--bg-secondary);
}

.discussion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.discussion-content {
    flex: 1;
    min-width: 0;
}

.discussion-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.discussion-title a {
    color: var(--text-primary);
}

.discussion-title a:hover {
    color: var(--primary);
}

.discussion-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
}

.discussion-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ============================================
   Guide List
   ============================================ */
.guide-list {
    display: grid;
    gap: 16px;
}

.guide-item {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    transition: all var(--transition);
}

.guide-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.guide-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.guide-title a {
    color: var(--text-primary);
}

.guide-title a:hover {
    color: var(--primary);
}

.guide-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .nav {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 16px;
        gap: 16px;
    }
    
    .nav-search {
        max-width: 140px;
    }
    .nav-search-input {
        width: 100%;
        padding: 6px 10px 6px 30px;
        font-size: 13px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
    }
}
