html {
    overflow-y: scroll;
}

/* 确保页面主体最小高度占满视口，避免内容不足时高度变化 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 内容区域直接使用父容器的左右边距，不额外添加 */
.petitioner-content {
    padding: 20px 0;
    flex: 1;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.search-wrapper {
    position: relative;
    width: 400px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.search-results a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.search-results a:hover {
    background: #e9f2ff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c5282;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    white-space: nowrap;
}

.letter-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1;
}

.letter-item {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.letter-item:hover,
.letter-item.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.reset-btn {
    padding: 4px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
    white-space: nowrap;
}

.reset-btn:hover {
    background: #5a6268;
}

.petitioner-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 8px;
    margin-top: 15px;
    min-height: 200px;
}

/* 卡片样式：固定行高，禁止换行，允许提示框溢出 */
.petitioner-item {
    position: relative;          /* 保留相对定位，但不用于提示框定位 */
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    z-index: 1;
    min-height: 32px;
    overflow: visible;          /* 允许提示框溢出 */
}

.petitioner-item:hover {
    background: #e9f2ff;
    border-color: #0066cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
}

/* 姓名区域单独设置省略效果，禁止换行 */
.petitioner-item .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 4px;
    min-width: 0;
}

/* 数字背景色为深橙色 */
.project-count {
    background: #b02a37;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 18px;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    flex-shrink: 0;
    z-index: 2;
    line-height: 1.2;
}

/* 提示框样式 - 改用 JS 动态定位，CSS 只定义外观，不设绝对定位位置 */
.tooltip-content {
    display: none;
    position: fixed;            /* 使用 fixed 定位，由 JS 动态设置 top/left */
    z-index: 1050;
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 6px 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 280px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    color: #004085;
    white-space: normal;
    word-break: break-word;
    pointer-events: auto;
}

.tooltip-content a {
    display: block;
    color: #002752;
    text-decoration: none;
    padding: 4px 0;
    line-height: 1.4;
    border-bottom: 1px dotted #9bb7d4;
}

.tooltip-content a:last-child {
    border-bottom: none;
}

.tooltip-content a:hover {
    text-decoration: underline;
    background-color: #e9f2ff;
}

/* 分页样式 */
.pagination-container {
    margin-top: 25px;
    text-align: center;
    font-size: 13px;
}
.pagination-info {
    margin-bottom: 8px;
    color: #495057;
}
.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: 5px;
}
.page-item {
    margin: 0;
}
.page-link {
    display: block;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    background: white;
    transition: all 0.2s;
}
.page-link:hover {
    background: #e9ecef;
}
.page-item.active .page-link {
    background: #007bff;
    color: white;
    border-color: #007bff;
}
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* 响应式 */
@media (max-width: 1800px) {
    .petitioner-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}
@media (max-width: 1400px) {
    .petitioner-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}
@media (max-width: 1200px) {
    .petitioner-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}
@media (max-width: 992px) {
    .petitioner-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .letter-filter-bar {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 768px) {
    .petitioner-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-wrapper {
        width: 100%;
    }
}