* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 系统字体栈：英文优先系统字体，中文显式指定以跨平台统一（macOS 苹方 / Windows 微软雅黑 / Android 思源黑体） */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC',
                 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left a {
    color: #333;
    text-decoration: none;
    margin-right: 30px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-left a:hover,
.nav-left a.active {
    color: #2c5282;
}

.nav-right #selected-count {
    background-color: #2c5282;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.main {
    padding: 40px 0;
}

.tab-bar {
    display: flex;
    gap: 6px;
    padding: 6px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
}

.tab:hover {
    background-color: #e8eef4;
    color: #2c5282;
}

.tab.active {
    background-color: #2c5282;
    color: white;
    box-shadow: 0 2px 6px rgba(44, 82, 130, 0.3);
}

.questions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

/* 样例数据提示条 */
.sample-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 24px;
    background: #fff8e1;
    border: 1px solid #f5d78a;
    border-left: 4px solid #e8a000;
    border-radius: 8px;
    color: #7a5c00;
    font-size: 0.92rem;
}

.notice-icon {
    color: #e8a000;
    flex-shrink: 0;
    display: flex;
}

.notice-text {
    line-height: 1.6;
}

.notice-text em {
    font-style: normal;
    font-weight: 700;
    color: #a06e00;
}

/* 样例标记 */
.sample-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 8px;
    background-color: #fff3cd;
    color: #b7791f;
    border: 1px solid #f6d365;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

/* 问题编号徽标（01~57，等宽数字便于对齐） */
.card-number {
    display: inline-block;
    flex-shrink: 0;
    min-width: 30px;
    padding: 2px 6px;
    background-color: #2c5282;
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.question-card {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    display: flex;
    gap: 15px;
    align-items: stretch;
}

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

.question-card.selected {
    border: 2px solid #2c5282;
    background-color: #f0f4f8;
}

/* 选择框：位于卡片右侧，竖向排列 */
.checkbox-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 0 8px;
    border-left: 1px dashed #e5e7eb;
    user-select: none;
    flex-shrink: 0;
}

.question-checkbox {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s;
}

.question-checkbox:checked + .checkbox-custom {
    background-color: #2c5282;
    border-color: #2c5282;
}

.question-checkbox:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.75rem;
    color: #999;
    transition: color 0.3s;
}

.question-card.selected .checkbox-text {
    color: #2c5282;
    font-weight: 600;
}

.card-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.card-title-row .card-title {
    margin-bottom: 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.4;
    transition: color 0.3s;
}

.card-title:hover {
    color: #2c5282;
}

.card-summary {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: #e8eef4;
    color: #2c5282;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 查看详情入口 */
.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2c5282;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.detail-link::after {
    content: '›';
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.3s;
}

.card-content:hover .detail-link {
    color: #1e3a5f;
}

.card-content:hover .detail-link::after {
    transform: translateX(3px);
}

.submit-section {
    text-align: center;
    padding: 30px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    bottom: 20px;
    z-index: 50;
    margin-top: 20px;
}

.submit-btn {
    padding: 15px 60px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transition: all 0.3s;
}

.submit-btn.active {
    background-color: #2c5282;
    color: white;
    cursor: pointer;
}

.submit-btn.active:hover {
    background-color: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.submit-hint {
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
}

.footer {
    background-color: #1e3a5f;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

.footer p {
    opacity: 0.8;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.modal-content h2 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-title-row,
.detail-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-title-row h2,
.detail-title-row h2 {
    margin-bottom: 0;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    color: #2c5282;
    margin-bottom: 8px;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #e8eef4;
}

.detail-section p {
    color: #555;
    line-height: 1.8;
    font-size: 0.95rem;
    /* 保留数据中的换行符 \n，正常换行显示 */
    white-space: pre-line;
}

.category-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: #e8eef4;
    color: #2c5282;
    border-radius: 20px;
    font-weight: 600;
}

.toast {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.detail-card {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.back-button {
    margin-top: 30px;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #2c5282;
    color: white;
}

.btn-primary:hover {
    background-color: #1e3a5f;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #1e3a5f;
    font-size: 2rem;
    margin-bottom: 10px;
}

.results-header p {
    color: #666;
}

.results-list {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.result-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s;
}

.result-item:hover {
    background-color: #f8fafc;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.top-ten {
    background-color: #f0f7ff;
}

.result-item.top-ten:nth-child(1) {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
}

.result-item.top-ten:nth-child(2) {
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.result-item.top-ten:nth-child(3) {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e8eef4;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.result-item.top-ten .rank-badge {
    background-color: #2c5282;
    color: white;
}

.result-item.top-ten:nth-child(1) .rank-badge {
    background-color: #f5a623;
}

.result-item.top-ten:nth-child(2) .rank-badge {
    background-color: #9e9e9e;
}

.result-item.top-ten:nth-child(3) .rank-badge {
    background-color: #cd7f32;
}

.result-content {
    flex: 1;
}

.result-content h3 {
    color: #1e3a5f;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* 结果页标题链接：与标题同色，悬停变色并加下划线提示可点击 */
.result-content h3 a {
    color: inherit;
    text-decoration: none;
}

.result-content h3 a:hover {
    color: #3182ce;
    text-decoration: underline;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.result-category {
    padding: 4px 12px;
    background-color: #e8eef4;
    color: #2c5282;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.result-summary {
    color: #666;
    font-size: 0.9rem;
}

.vote-bar-container {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.vote-bar {
    height: 100%;
    background: linear-gradient(90deg, #2c5282 0%, #3182ce 100%);
    border-radius: 4px;
    transition: width 0.5s;
}

.vote-count {
    color: #555;
    font-size: 0.9rem;
}

.vote-count strong {
    color: #2c5282;
    font-size: 1.1rem;
}

/* 详情弹窗关闭后，刚才查看的问题卡片短暂高亮，便于用户定位 */
.question-card.viewed-flash {
    box-shadow: 0 0 0 3px #3182ce, 0 4px 16px rgba(49, 130, 206, 0.35);
    transition: box-shadow 0.3s;
}

/* 选满 20 个后，未选中的问题置灰且不可勾选 */
.question-card.disabled {
    opacity: 0.55;
    filter: grayscale(0.5);
    background-color: #f3f4f6;
}

.question-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.question-card.disabled .checkbox-label {
    cursor: not-allowed;
}

.question-card.disabled .checkbox-custom {
    border-color: #cbd5e1;
    background-color: #e2e8f0;
}

.question-card.disabled .checkbox-text {
    color: #b0b7c3;
}

/* 详情弹窗底部的选择/取消选择按钮 */
.modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8eef4;
    text-align: center;
}

.modal-toggle-btn {
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-toggle-btn.btn-choose {
    background-color: #2c5282;
    color: white;
}

.modal-toggle-btn.btn-choose:hover {
    background-color: #1e3a5f;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.modal-toggle-btn.btn-cancel {
    background-color: #fff3cd;
    color: #b7791f;
    border: 1px solid #f6d365;
}

.modal-toggle-btn.btn-cancel:hover {
    background-color: #ffe8a3;
}

.modal-toggle-btn:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-left a {
        margin-right: 15px;
    }

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

    .question-card {
        flex-direction: row;
        gap: 12px;
        padding: 16px;
    }

    .card-title {
        font-size: 1rem;
    }

    .result-item {
        flex-direction: column;
        gap: 15px;
    }

    .rank-badge {
        align-self: flex-start;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}