/**
 * page-page.css - 独立页面通用样式
 * 页面头部、表单、留言板、友情链接、壁纸、统计页
 */

/* ==============================
   页面头部
   ============================== */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==============================
   友情链接页面
   ============================== */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.friend-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.friend-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-gradient);
    flex-shrink: 0;
}

.friend-info {
    min-width: 0;
    flex: 1;
}

.friend-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.friend-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==============================
   视频页面
   ============================== */
.video-search {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.video-search-input {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 300px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.video-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.video-thumb {
    width: 100%;
    padding-top: 56.25%;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.video-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==============================
   壁纸页面
   ============================== */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.wallpaper-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 9/16;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wallpaper-item:hover {
    transform: scale(1.02);
}

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

/* ==============================
   留言板页面
   ============================== */
.leaving-comments {
    margin-bottom: 32px;
}

.leaving-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

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

.leaving-card-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.leaving-card-body {
    min-width: 0;
    flex: 1;
}

.leaving-card-author {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.leaving-card-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.leaving-card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==============================
   统计页面
   ============================== */
.census-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.census-stat-card {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.census-stat-num {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.census-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.census-section {
    margin-bottom: 40px;
}

.census-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 12px;
    position: relative;
}

.census-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2em;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.census-bars {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.census-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.census-bar-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
}

.census-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.census-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.census-bar-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
}

.census-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 24px;
}

.census-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.census-list li:last-child {
    border-bottom: none;
}

.census-list li a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.census-list li a:hover {
    color: var(--accent-primary);
}

.census-list-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==============================
   响应式
   ============================== */
@media (max-width: 768px) {
    .census-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .friends-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-search {
        flex-direction: column;
    }

    .video-search-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .census-stats {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   深色模式
   ============================== */
.dark .census-section {
    background: transparent;
}

.dark .census-bars {
    background: var(--bg-secondary);
}

.dark .census-list {
    background: var(--bg-secondary);
}
