/* ============================================
   上清单 - 样式优化 v2.0
   ============================================ */

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

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --primary-light: rgba(230, 57, 70, 0.08);
    --dark: #0d1b2a;
    --dark-light: #1b2838;
    --accent: #f77f00;
    --blue: #457b9d;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ Header ============ */
.header {
    background: var(--dark);
    color: white;
    padding: 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--primary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    line-height: 1;
}

.logo h1, .logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* ============ Announcement ============ */
.announcement {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    padding: 0.65rem 0;
    border-bottom: 1px solid #fde68a;
    font-size: 0.88rem;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.announcement-icon {
    color: #f59e0b;
}

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, #1a2332 100%);
    color: white;
    padding: 1.5rem 0 1.8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(230,57,70,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(247,127,0,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.6);
    max-width: 600px;
    margin: 0 auto 1rem;
    line-height: 1.5;
}

#totalCount {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.2em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 0.8rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ============ Filters ============ */
.filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
    gap: 1.5rem;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    padding: 0.45rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-light);
}

.tag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.tag-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230,57,70,0.25);
}

.sort-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 0.45rem 0.9rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
}

.sort-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.sort-btn.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
    box-shadow: 0 2px 8px rgba(69,123,157,0.25);
}

.advanced-search-btn {
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.advanced-search-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

/* ============ Person Grid ============ */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.person-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0,0,0,0.04);
}

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

.person-card.pinned::before {
    content: "📌 置顶";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 700;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(247,127,0,0.3);
    letter-spacing: 0.5px;
}

.person-photo {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 4.5rem;
    overflow: hidden;
}

.person-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.person-card:hover .person-photo img {
    transform: scale(1.05);
}

.person-info {
    padding: 1.2rem 1.3rem 1.3rem;
}

.person-name {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--dark);
    letter-spacing: 0.3px;
}

.person-aliases {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.8rem;
}

.tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    color: white;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.person-description {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.person-weight {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.weight-bar {
    flex: 1;
    height: 6px;
    background: #edf2f7;
    border-radius: 6px;
    overflow: hidden;
}

.weight-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 6px;
    transition: width 0.6s ease;
}

.view-detail-btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
    letter-spacing: 0.3px;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

.view-detail-btn:hover {
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230,57,70,0.25);
}

/* ============ Empty State ============ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #a0aec0;
    font-size: 0.95rem;
}

/* ============ Loading ============ */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #edf2f7;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ Pagination ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230,57,70,0.25);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============ Modal ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--dark);
    font-size: 1.3rem;
    font-weight: 800;
}

.modal-close {
    background: var(--bg);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: #fee2e2;
    color: var(--primary);
}

.modal-body {
    padding: 0 1.5rem 1rem;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
    background: #fff;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-inputs input {
    flex: 1;
}

.range-inputs span {
    color: var(--text-light);
    font-weight: 500;
}

.tag-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-select .tag-btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
}

.btn {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-light);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: #cbd5e0;
    background: #edf2f7;
}

/* ============ Footer ============ */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.5);
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.footer-nav {
    margin-top: 0.75rem;
}

.footer-nav a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: rgba(255,255,255,0.7);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    /* --- Header: 单行横排，logo左 + 导航右 --- */
    .header-content {
        flex-direction: row;
        height: 50px;
        padding: 0;
        gap: 0;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
    }

    .logo h1, .logo-text {
        font-size: 1.1rem;
    }

    .logo {
        gap: 8px;
    }

    .nav {
        gap: 0.2rem;
    }

    .nav-link {
        font-size: 0.82rem;
        padding: 0.35rem 0.7rem;
    }

    /* --- 公告栏: 单行跑马灯 --- */
    .announcement {
        padding: 0.45rem 0;
        overflow: hidden;
    }

    .announcement-content {
        white-space: nowrap;
        animation: marquee 20s linear infinite;
        justify-content: flex-start;
    }

    @keyframes marquee {
        0% { transform: translateX(100%); }
        100% { transform: translateX(-100%); }
    }

    /* --- Hero: 极简紧凑 --- */
    .hero {
        padding: 0.6rem 0 0.7rem;
    }

    .hero-content h1 {
        font-size: 1rem;
        margin-bottom: 0.15rem;
    }

    .hero-content p {
        font-size: 0.75rem;
        padding: 0 1rem;
        margin-bottom: 0.3rem;
    }

    .hero::before, .hero::after {
        display: none;
    }

    .stats {
        gap: 1.8rem;
        margin-top: 0.25rem;
    }

    .stat-number {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    /* --- 标签: 横向可滑动，不换行 --- */
    .filters {
        padding: 0.8rem;
        gap: 0.6rem;
    }

    .tag-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .tag-filters::-webkit-scrollbar {
        display: none;
    }

    .tag-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.35rem 0.8rem;
        font-size: 0.82rem;
    }

    /* --- 排序 + 搜索: 紧凑横排 --- */
    .filter-row-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        padding-top: 0.6rem;
        margin-top: 0.15rem;
    }

    .sort-options {
        gap: 0.35rem;
    }

    .sort-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
    }

    .advanced-search-btn {
        padding: 0.35rem 0.8rem;
        font-size: 0.8rem;
    }

    /* --- 卡片网格 --- */
    .person-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .person-photo {
        height: 180px;
    }
}

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

    .hero {
        padding: 0.5rem 0 0.6rem;
    }

    .hero-content h1 {
        font-size: 0.95rem;
    }

    .stats {
        gap: 1.2rem;
    }

    .stat-number {
        font-size: 0.95rem;
    }

    .person-photo {
        height: 200px;
    }

    .modal-content {
        width: 95%;
        border-radius: var(--radius-sm);
    }

    /* 排序按钮 480px 以下横向滑动 */
    .sort-options {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sort-options::-webkit-scrollbar {
        display: none;
    }

    .sort-btn {
        flex-shrink: 0;
        text-align: center;
    }
}

/* ============ Skeleton Loading ============ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

.skeleton-photo {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, #e9ecef 25%, #f3f4f6 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-info {
    padding: 1rem;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e9ecef 25%, #f3f4f6 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin-bottom: 0.6rem;
}

.skeleton-line.title {
    height: 20px;
    width: 60%;
    margin-bottom: 0.8rem;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.long { width: 90%; }
.skeleton-line.btn { height: 36px; width: 100%; margin-top: 0.5rem; border-radius: var(--radius-xs); }

/* ============ Animations ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.person-card {
    opacity: 0;
    animation: fadeInUp 0.35s ease forwards;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ============ Selection ============ */
::selection {
    background: rgba(230, 57, 70, 0.15);
    color: var(--primary-dark);
}
