/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 登录页 ========== */
#auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.auth-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    border-bottom: none;
    padding-bottom: 0;
}

.auth-subtitle {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.auth-form {
    text-align: left;
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.auth-actions .btn {
    flex: 1;
    padding: 10px 0;
}

#auth-status {
    display: block;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

/* ========== 头部 ========== */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.85;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ========== 主容器 ========== */
main {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 16px;
}

.entry-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.entry-tab {
    border: none;
    background: transparent;
    padding: 9px 14px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.entry-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* ========== 表单 ========== */
.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.form-row .hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs input {
    width: 80px !important;
}

.range-inputs span {
    color: #999;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

/* ========== ClipProxy代理配置 ========== */
.proxy-toggle-row {
    margin-bottom: 8px;
}

.proxy-toggle-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.proxy-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.proxy-config {
    background: #f8f9ff;
    border: 1px solid #e0e4f5;
    border-radius: 6px;
    padding: 14px 16px;
    margin-top: 4px;
}

.proxy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.proxy-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #d9d9d9;
}

.proxy-preview label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.proxy-preview code {
    display: block;
    background: #1a1a2e;
    color: #a0f0a0;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    word-break: break-all;
    line-height: 1.5;
}

.proxy-preview code.preview-placeholder {
    color: #666;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #5a6fd6;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #49b018;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: #e09b0e;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #e04042;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.status-text {
    font-size: 13px;
    margin-left: 12px;
    color: #999;
}

.status-text.success {
    color: #52c41a;
}

.status-text.error {
    color: #ff4d4f;
}

.status-text.warning {
    color: #faad14;
}

.status-text.loading {
    color: #667eea;
}

/* ========== 题目配置 ========== */
.parse-warning-box {
    border: 1px solid #ffe58f;
    background: #fffbe6;
    color: #8c6d1f;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

.parse-warning-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.parse-warning-box ul {
    margin: 0 0 6px 18px;
    padding: 0;
}

.parse-warning-box li {
    margin: 3px 0;
}

.parse-warning-note {
    color: #ad6800;
}

.question-block {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fafafa;
}

.question-block .q-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.question-block .q-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.question-block .q-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
}

.q-type.single {
    background: #667eea;
}

.q-type.multiple {
    background: #52c41a;
}

.q-type.text {
    background: #faad14;
}

.q-type.matrix {
    background: #ff4d4f;
}

.q-type.slider {
    background: #13c2c2;
}

/* ========== 滑块题配置 ========== */
.q-type.rank {
    background: #722ed1;
}

.rank-config-wrapper {
    padding: 4px 0;
}

.rank-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.rank-config-header p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.rank-config-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.rank-choice-list {
    display: grid;
    gap: 6px;
}

.rank-choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #edf0f5;
    border-radius: 4px;
    background: #fafbfc;
}

.rank-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eef1f7;
    color: #4c566a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 24px;
}

.rank-choice-label {
    color: #1f2933;
    font-size: 13px;
    line-height: 1.35;
    flex: 1;
    min-width: 180px;
}

.rank-weight-slider {
    flex: 0 1 220px;
    min-width: 120px;
    accent-color: #722ed1;
}

.rank-choice-value {
    flex: 0 0 auto;
}

.rank-choice-value .rank-weight-input {
    width: 64px;
    height: 26px;
    padding: 3px 5px;
    border: 1px solid #d8c8f0;
    border-radius: 4px;
    color: #5b21b6;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.rank-choice-value .rank-weight-input:focus {
    outline: none;
    border-color: #722ed1;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.12);
}

.slider-config-wrapper {
    padding: 4px 0;
}

.slider-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.slider-config-header p {
    margin: 0;
    font-size: 12px;
    color: #999;
}

.slider-config-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.slider-range-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f5;
}

.slider-range-row:last-child {
    border-bottom: none;
}

.slider-row-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.slider-row-index {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e9fbfb;
    color: #08979c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 22px;
    margin-top: 1px;
}

.slider-range-row .choice-label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slider-range-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.slider-number-field {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 12px;
}

.slider-number-field input {
    width: 72px;
    height: 28px;
    padding: 4px 7px;
    border: 1px solid #d7dce3;
    border-radius: 4px;
    color: #25313f;
    font-size: 13px;
    text-align: right;
}

.slider-number-field input:focus {
    outline: none;
    border-color: #13c2c2;
    box-shadow: 0 0 0 2px rgba(19, 194, 194, 0.12);
}

.slider-copy-prev-btn {
    height: 28px;
    padding: 3px 10px;
}

.slider-copy-prev-btn:disabled {
    color: #b8b8b8;
    border-color: #e7e7e7;
    background: #f7f7f7;
    cursor: not-allowed;
}

.slider-copy-prev-btn:disabled:hover {
    color: #b8b8b8;
    border-color: #e7e7e7;
    background: #f7f7f7;
}

.question-block .q-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed #e8e8e8;
}

/* ========== 快捷操作按钮 ========== */
.quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px 0;
}

.qbtn {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.qbtn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f0f2ff;
}

.qbtn-icon {
    color: #666;
}

.qbtn-accent {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.qbtn-accent:hover {
    background: #5a6fd6;
    border-color: #5a6fd6;
    color: #fff;
}

.qbtn-danger {
    color: #ff4d4f;
    border-color: #ffccc7;
}

.qbtn-danger:hover {
    background: #fff1f0;
    border-color: #ff4d4f;
}

/* ========== 填空题答案列表 ========== */
.text-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.text-toolbar-label {
    font-size: 12px;
    color: #999;
}

.answer-badge {
    font-size: 11px;
    background: #52c41a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.answer-badge.warning {
    background: #faad14;
}

.text-mode-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    font-size: 12px;
    color: #555;
}

.text-mode-row label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.text-mode-hint {
    color: #999;
}

.text-toolbar-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.text-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.text-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-item-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.text-item-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.form-field-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.form-field-row label span {
    color: #999;
    font-weight: 400;
    margin-left: 4px;
}

.form-field-values {
    width: 100%;
    min-height: 72px;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 13px;
    resize: vertical;
}

.form-field-values:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.text-item-del {
    border: none;
    background: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.text-item-del:hover {
    color: #ff4d4f;
    background: #fff1f0;
}

/* ========== AI导入弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.modal-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ai-import-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.ai-import-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 单选/多选选项行 */
.choice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 4px 0;
}

.choice-row .choice-label {
    flex: 1;
    font-size: 13px;
    color: #555;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.choice-row input[type="range"] {
    width: 120px;
    accent-color: #667eea;
}

.choice-row .choice-value {
    width: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
}

.choice-row .choice-value-input {
    width: 54px;
    height: 26px;
    padding: 3px 5px;
    border: 1px solid #cfd5f4;
    border-radius: 4px;
    color: #4f63d8;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.choice-row .choice-value-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.14);
}

.choice-row .choice-percent-suffix {
    flex: 0 0 auto;
    color: #667eea;
}

/* 填空题 */
.text-values-area {
    width: 100%;
    min-height: 80px;
    font-size: 13px;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    resize: vertical;
}

/* 矩阵题 */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 6px;
}

.matrix-table th,
.matrix-table td {
    border: 1px solid #e8e8e8;
    padding: 6px 8px;
    text-align: center;
}

.matrix-table th {
    background: #f5f5f5;
    font-weight: 500;
    color: #555;
}

.matrix-table td input {
    width: 50px;
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
}

/* ========== 任务卡片 ========== */
.task-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
    background: #fff;
}

.task-card .task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.task-card .task-id {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.task-status {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.task-status.pending {
    background: #f0f0f0;
    color: #999;
}

.task-status.running {
    background: #e6f7ff;
    color: #1890ff;
}

.task-status.paused {
    background: #fff7e6;
    color: #faad14;
}

.task-status.stopped {
    background: #fff1f0;
    color: #ff4d4f;
}

.task-status.completed {
    background: #f6ffed;
    color: #52c41a;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 0;
}

.progress-bar .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

/* 统计行 */
.task-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.task-stats .stat-success {
    color: #52c41a;
    font-weight: 500;
}

.task-stats .stat-fail {
    color: #ff4d4f;
    font-weight: 500;
}

/* 操作按钮组 */
.task-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

/* 日志面板 */
.log-panel {
    background: #1a1a2e;
    color: #a0aec0;
    border-radius: 4px;
    padding: 10px 12px;
    max-height: 250px;
    overflow-y: auto;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    line-height: 1.5;
}

.log-panel .log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.log-panel .log-time {
    color: #667eea;
    margin-right: 6px;
}

.log-panel .log-level-info {
    color: #a0aec0;
}

.log-panel .log-level-warning {
    color: #faad14;
}

.log-panel .log-level-error {
    color: #ff4d4f;
}

/* ========== 历史任务区域 ========== */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.history-header h2 {
    margin-bottom: 0 !important;
}

.empty-hint {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px 0;
}

/* 历史任务卡片（紧凑版） */
.history-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-card-info {
    flex: 1;
    min-width: 0;
}

.history-card-url {
    font-size: 13px;
    color: #1a1a2e;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* 模式标签：区分Excel/解析模式 */
.mode-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    color: #fff;
    font-weight: 500;
    margin-right: 6px;
    vertical-align: middle;
}

.mode-tag.mode-excel {
    background: #52c41a;
}

.mode-tag.mode-parse {
    background: #667eea;
}

.mode-tag.mode-ai {
    background: #1677ff;
}

.history-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.history-card-meta .stat-success {
    color: #52c41a;
    font-weight: 500;
}

.history-card-meta .stat-fail {
    color: #ff4d4f;
    font-weight: 500;
}

.history-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-copy {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #5a6fd6;
}

.btn-open-link {
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-open-link:hover {
    background: #0958d9;
}

.btn-rerun {
    background: #52c41a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-rerun:hover {
    background: #49b018;
}

/* ========== 积分系统 ========== */
.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.points-badge strong {
    color: #ffd700;
    font-size: 14px;
}

.btn-admin {
    background: rgba(255, 215, 0, 0.25);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.5);
    text-decoration: none;
    font-size: 12px;
}

.btn-admin:hover {
    background: rgba(255, 215, 0, 0.4);
    color: #fff;
}

.points-estimate {
    font-size: 13px;
    color: #667eea;
    margin-left: 12px;
}

.points-estimate.insufficient {
    color: #ff4d4f;
    font-weight: 600;
}

.points-estimate.insufficient::after {
    content: ' (积分不足!)';
}

/* 积分记录按钮 */
.btn-points-log {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.btn-points-log:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* 积分记录面板 */
.points-log-section {
    border-left: 3px solid #667eea;
}

.points-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}

.points-log-table th,
.points-log-table td {
    border: 1px solid #e8e8e8;
    padding: 8px 12px;
    text-align: left;
}

.points-log-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.points-log-table td {
    color: #333;
}

.points-log-table tr:hover td {
    background: #fafafa;
}

.pl-amount-positive {
    color: #52c41a;
    font-weight: 600;
}

.pl-amount-negative {
    color: #ff4d4f;
    font-weight: 600;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 20px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .history-card {
        flex-direction: column;
        align-items: stretch;
    }

    .history-card-actions {
        justify-content: flex-end;
    }

    .rank-choice-row {
        flex-wrap: wrap;
    }

    .rank-choice-label {
        min-width: calc(100% - 40px);
    }

    .rank-weight-slider {
        flex-basis: calc(100% - 80px);
        margin-left: 32px;
    }

    .rank-config-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .rank-config-actions {
        justify-content: flex-start;
    }

    .slider-range-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .slider-config-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .slider-range-controls {
        justify-content: flex-start;
        padding-left: 30px;
    }
}

/* ========== 信效度控制面板 ========== */
/* @author ygw */

.rv-panel {
    background: #f0f7ff;
    border: 1px solid #d0e3ff;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.rv-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rv-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.rv-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    overflow: hidden;
}

.rv-btn {
    padding: 4px 16px;
    border: none;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.rv-btn:hover {
    background: #f0f0f0;
}

.rv-btn.active {
    background: #1890ff;
    color: #fff;
}

.rv-params {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    align-items: flex-end;
}

.rv-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rv-param label {
    font-size: 12px;
    color: #52c41a;
    font-weight: 500;
}

.rv-param input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
}

.rv-hint {
    font-size: 12px;
    color: #999;
    margin: 0;
    flex-basis: 100%;
}

/* 矩阵题信效度标记 */
.rv-tag {
    font-size: 12px;
    color: red;
    font-weight: 500;
    margin-left: 8px;
}

.rv-toggle-btn {
    margin-left: 6px;
    padding: 2px 8px;
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    background: #fff;
    color: #ff4d4f;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.rv-toggle-btn:hover {
    background: #fff1f0;
}
