/**
 * 游戏鸡社区 - 主样式文件
 * 设计风格：现代、简洁、移动端优先
 */

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

:root {
    --primary: #E53935;
    --primary-light: #FF6F61;
    --primary-dark: #C62828;
    --bg: #F5F5F5;
    --card: #FFFFFF;
    --text: #333333;
    --text-secondary: #666666;
    --text-hint: #999999;
    --border: #E0E0E0;
    --success: #4CAF50;
    --warning: #FF9800;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(229,57,53,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ==================== 移动端导航栏 ==================== */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.mobile-nav-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

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

.nav-icon {
    font-size: 20px;
    cursor: pointer;
    position: relative;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFC3D0, #92C9FF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

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

/* ==================== 底部导航栏 ==================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--text-hint);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item .nav-icon {
    font-size: 20px;
}

.bottom-nav-item .nav-label {
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item.post-btn {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(229,57,53,0.3);
}

.bottom-nav-item.post-btn .nav-icon {
    font-size: 24px;
}

/* ==================== 页面标题栏 ==================== */
.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.page-title-bar h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.post-btn-small {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.post-btn-small:active {
    transform: scale(0.95);
}

/* ==================== 动态列表 ==================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-card {
    background: var(--card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.activity-card:active {
    transform: scale(0.99);
}

.activity-header {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFC3D0, #92C9FF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.activity-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-hint);
}

.activity-body {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.target-link {
    color: var(--primary);
    font-weight: 600;
}

.activity-actions {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid #F0F0F0;
}

.act-btn {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-hint);
    font-size: 13px;
    padding: 6px 0;
    border-radius: 6px;
    transition: all 0.2s;
}

.act-btn:active {
    background: #F5F5F5;
    color: var(--primary);
}

/* ==================== 游戏卡片 ==================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.game-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.game-card:active {
    transform: scale(0.98);
}

.game-cover {
    position: relative;
    width: 100%;
    padding-top: 120%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.game-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
}

.game-rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #FFD700;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.game-info {
    padding: 10px;
}

.game-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-hint);
}

.platform-tag {
    background: #F0F0F0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.96);
}

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

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

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

.btn-outline:hover {
    background: #FFF5F5;
}

.btn-ghost {
    background: transparent;
    color: var(--text-hint);
}

.btn-ghost:hover {
    color: var(--text);
}

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

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

.btn-block {
    width: 100%;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
}

/* ==================== 表单样式 ==================== */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
}

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

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
    font-family: inherit;
}

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

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    color: var(--text-hint);
}

/* ==================== 消息列表 ==================== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.message-item:active {
    transform: scale(0.99);
}

.message-item.unread {
    background: #F0F7FF;
}

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

.message-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.message-text {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-hint);
}

/* ==================== 标签栏 ==================== */
.message-tabs,
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.message-tabs::-webkit-scrollbar,
.filter-bar::-webkit-scrollbar {
    display: none;
}

.tab-btn,
.filter-select {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

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

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

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.activity-card,
.game-card,
.message-item {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-info {
    background: #333;
    color: white;
}

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

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

/* ==================== 响应式 ==================== */
@media screen and (min-width: 481px) {
    body {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media screen and (min-width: 768px) {
    body {
        max-width: 100%;
    }
    
    .mobile-nav,
    .mobile-bottom-nav {
        display: none;
    }
    
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
    }
}

/* ==================== PC游戏库页面样式 ==================== */
.pc-games-page {
    padding: 20px;
}

.pc-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.pc-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

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

.pc-game-card {
    background: var(--card, #FFF);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.pc-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.pc-game-cover {
    position: relative;
    width: 100%;
    padding-top: 120%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.pc-game-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-cover-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
}

.pc-game-info {
    padding: 12px;
}

.pc-game-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text, #333);
}

.pc-game-meta {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: var(--text-hint, #999);
}

.pc-platform-tag {
    background: var(--bg, #F5F5F5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-secondary, #666);
}

/* ==================== ҳʽ ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    list-style: none;
    padding: 0;
}

.pagination li {
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border, #E0E0E0);
    border-radius: 6px;
    color: var(--text-secondary, #666);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
}

.pagination a:hover {
    background: var(--bg, #F5F5F5);
    color: var(--primary, #E53935);
    border-color: var(--primary, #E53935);
}

.pagination .active span {
    background: var(--primary, #E53935);
    color: #fff;
    border-color: var(--primary, #E53935);
}
