/* ==========================================================================
   CardForge - 简约轻量、原生质感设计系统 (Clean & Modern Minimalist)
   ========================================================================== */

:root {
    --bg: #090d16;
    --surface: #111726;
    --surface-hover: #161f33;
    --border: #1e293b;
    --border-light: #334155;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 页面主体容器 */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.site-header {
    background-color: rgba(9, 13, 22, 0.9);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

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

.site-header h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-header h1 a {
    color: var(--text);
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 6px;
}

/* 按钮通用 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    background: transparent;
    color: var(--text);
}

.btn-primary {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #e2e8f0;
}

.btn-secondary {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-light);
}

.btn-outline {
    border-color: var(--border);
    color: var(--text-muted);
}

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

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-success {
    background-color: #059669;
    color: #fff;
}

.btn-warning {
    background-color: #d97706;
    color: #fff;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
}

/* 统计卡片 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.stat-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 游戏网格 */
.games-section {
    margin: 32px 0;
}

.games-section h2,
.recent-section h2,
.upload-section h2,
.my-games-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

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

.game-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}

.game-card:hover {
    border-color: var(--border-light);
}

.game-cover {
    height: 120px;
    background-color: #172033;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.game-icon {
    font-size: 40px;
    opacity: 0.9;
}

.game-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.game-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-play {
    display: block;
    text-align: center;
    padding: 8px;
    background-color: #1e293b;
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-play:hover {
    background-color: #334155;
}

/* 最近动态 */
.recent-section {
    margin: 32px 0;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.recent-item .date {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 80px;
}

.recent-item .title {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.play-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.play-link:hover {
    text-decoration: underline;
}

/* 表单组件 */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
}

.form-group .help-text {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* 提示框 */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-error {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

.alert-success {
    background-color: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    color: #34d399;
}

/* 登录/注册 */
.auth-section {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: 100%;
    max-width: 380px;
}

.auth-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: center;
    color: var(--text);
}

.auth-form {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

/* 上传模块 */
.upload-section {
    margin: 28px 0;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.upload-form-panel,
.upload-help-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.upload-form-panel h3,
.upload-help-panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.file-upload {
    position: relative;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background-color: var(--bg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.help-steps {
    margin-bottom: 16px;
}

.step {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.step-number {
    width: 22px;
    height: 22px;
    background-color: #334155;
    color: var(--text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.step p {
    color: var(--text-muted);
    font-size: 13px;
    padding-top: 1px;
}

.help-tips h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.help-tips ul {
    list-style: none;
    padding: 0;
}

.help-tips li {
    padding: 4px 0 4px 14px;
    position: relative;
    font-size: 12px;
    color: var(--text-muted);
}

.help-tips li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

/* 我的游戏条目 */
.my-games-section {
    margin: 28px 0;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.game-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.status-draft {
    background-color: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
}

.status-published {
    background-color: rgba(5, 150, 105, 0.15);
    color: #34d399;
}

.status-rejected {
    background-color: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

.game-title {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    min-width: 140px;
}

.game-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim);
}

.game-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reject-reason {
    width: 100%;
    font-size: 12px;
    color: #f87171;
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-dim);
    font-size: 14px;
}

.empty-state a {
    color: var(--primary);
    text-decoration: none;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}

/* 移动端全响应式收缩 */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .site-header .container {
        height: auto;
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .site-header h1 {
        text-align: center;
    }

    nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .welcome {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .stats-section {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 16px 0;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 22px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .upload-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .game-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .game-item .game-meta {
        width: 100%;
        justify-content: space-between;
    }

    .game-item .game-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .recent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 12px;
    }

    .recent-item .play-link {
        align-self: flex-end;
    }
}
