/* =========================
   移动端优先 · 全局重置
   ========================= */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 70px); /* 适配刘海屏 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0b0d14;
    color: #cfd8e6;
    line-height: 1.6;
    overflow-x: hidden; /* 关键：禁止横向滚动 */
    min-height: 100vh;
}

/* =========================
   容器 & 布局
   ========================= */
.container {
    width: 100%;
    max-width: 100vw;
    padding: 0 16px;
    margin: 0 auto;
}

/* =========================
   首页头部
   ========================= */
.site-header {
    padding: 32px 0 24px;
    text-align: center;
    border-bottom: 1px solid #252a3a;
    margin-bottom: 24px;
}

.site-header h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem); /* 流体字体 */
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #8a94b3;
    font-size: clamp(0.875rem, 3vw, 1rem);
}

/* =========================
   统计卡片 (Grid 自适应)
   ========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: #161926;
    border: 1px solid #252a3a;
    border-radius: 12px;
    padding: 16px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px; /* 确保高度一致 */
}

.stat-number {
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 800;
    color: #6c63ff;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: #8a94b3;
    margin-top: 4px;
}

/* =========================
   热门帖子列表
   ========================= */
.hot-posts h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #252a3a;
}

.hot-post-item {
    display: block;
    background: #161926;
    border: 1px solid #252a3a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}

.hot-post-item:active { /* 移动端点击反馈 */
    border-color: #6c63ff;
    background: #1a1d2e;
}

.hot-post-title {
    font-size: 1rem;
    font-weight: 500;
    color: #cfd8e6;
    margin-bottom: 8px;
    line-height: 1.4;
}

.hot-post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8a94b3;
}

/* =========================
   快捷入口 (Flex 布局)
   ========================= */
.quick-links {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-top: 32px;
    padding-bottom: 20px;
}

.quick-link-card {
    flex: 1;
    background: #161926;
    border: 1px solid #252a3a;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    color: #cfd8e6;
    font-size: 0.8125rem;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.quick-link-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

/* =========================
   底部导航栏 (Fixed + Safe Area)
   ========================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0); /* 适配底部安全区 */
    background: rgba(22, 25, 38, 0.95);
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    border-top: 1px solid #252a3a;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #8a94b3;
    font-size: 10px;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-item:active {
    color: #6c63ff;
}

.nav-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-item.tab-count span {
    background: #6c63ff;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* =========================
   通用卡片
   ========================= */
.card {
    background: #161926;
    border: 1px solid #252a3a;
    border-left: 4px solid #6c63ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    word-break: break-word; /* 防止长文本撑破布局 */
}

/* =========================
   表单元素
   ========================= */
input, textarea, select, button {
    font-family: inherit;
    font-size: 16px; /* iOS 防止自动缩放 */
}

input, textarea, select {
    width: 100%;
    padding: 14px 16px;
    background: #0f121a;
    border: 1px solid #252a3a;
    border-radius: 10px;
    color: #cfd8e6;
    margin-bottom: 16px;
    appearance: none; /* 移除默认样式 */
}

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

button {
    width: 100%;
    padding: 16px;
    background: #6c63ff;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 52px; /* 确保点击区域足够大 */
}

button:active {
    opacity: 0.8;
}

/* =========================
   表格优化
   ========================= */
.table-container {
    overflow-x: auto; /* 表格允许横向滚动 */
    margin-bottom: 20px;
}

.table {
    width: 100%;
    min-width: 600px; /* 防止表格挤压 */
    border-collapse: collapse;
}

.table th, .table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #252a3a;
    color: #cfd8e6;
    font-size: 0.875rem;
}

.table th {
    color: #8a94b3;
    font-weight: 500;
    background: #161926;
}

/* =========================
   响应式断点 (以防万一)
   ========================= */
@media (min-width: 768px) {
    .container {
        max-width: 750px;
        padding: 0 20px;
    }
    
    .quick-links {
        justify-content: center;
    }
    
    .quick-link-card {
        max-width: 160px;
    }
}

/* =========================
   防止iOS Safari橡皮筋效果干扰
   ========================= */
body {
    overscroll-behavior-y: contain;
}
