/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    padding: 20px;
    line-height: 1.6;
}
.container {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 40px 48px;
    position: relative;
}
@media (max-width: 640px) { .container { padding: 20px 16px; } }
.header {
    text-align: center;
    padding-bottom: 28px;
    border-bottom: 2px solid #e8edf3;
    margin-bottom: 32px;
}
.header h1 { font-size: 35px; font-weight: 700; color: #1a2332; }
.header .sub { color: #8895aa; font-size: 14px; margin-top: 6px; }
.header .required-hint { color: #e74c3c; font-size: 13px; margin-top: 4px; }
.form-section {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid #eef2f7;
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.section-title .badge {
    font-size: 12px;
    background: #e8edf3;
    color: #4a5a72;
    padding: 1px 10px;
    border-radius: 12px;
    font-weight: 400;
}
.section-title .btn-add {
    font-size: 13px;
    padding: 2px 12px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
}
.section-title .btn-add:hover { background: #3a7bc8; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 4px;
}
.form-group label .required { color: #e74c3c; margin-left: 2px; }
.form-group label .red-text { color: #e74c3c; font-weight: 600; }
.form-group .help-text { font-size: 12px; color: #8895aa; margin-top: 2px; }
.form-group .help-text.red { color: #e74c3c; font-weight: 500; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #dce1e8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}
.form-control:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
    background: #fff;
}
.form-control-sm { padding: 8px 12px; font-size: 13px; }
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .row { grid-template-columns: 1fr; gap: 12px; } }
.record-item {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid #eef2f7;
    display: grid;
    grid-template-columns: 1fr 1fr 30px;
    gap: 12px;
    align-items: center;
}
.record-item.charge-item {
    grid-template-columns: 1fr 1.5fr 1fr 30px;
}
@media (max-width: 500px) {
    .record-item { grid-template-columns: 1fr; gap: 8px; }
    .record-item.charge-item { grid-template-columns: 1fr; }
}
.record-item .label { font-size: 12px; color: #8895aa; font-weight: 500; margin-bottom: 2px; }
.record-item .btn-remove {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-item .btn-remove:hover { background: #d63a2a; }
.file-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) { .file-upload-grid { grid-template-columns: 1fr; } }
.file-upload-item {
    border: 1.5px dashed #dce1e8;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fafbfc;
    transition: border-color 0.2s;
}
.file-upload-item:hover { border-color: #4a90d9; }
.file-upload-item .file-label {
    font-weight: 500;
    font-size: 13px;
    color: #2d3748;
    display: block;
    margin-bottom: 6px;
}
.file-upload-item .file-label .badge { font-weight: 400; font-size: 11px; color: #8895aa; }
.file-upload-item input[type="file"] { width: 100%; padding: 4px 0; font-size: 13px; cursor: pointer; }
.file-upload-item .file-name { font-size: 12px; color: #4a90d9; margin-top: 4px; word-break: break-all; }
.radio-group {
    display: flex;
    gap: 24px;
    padding-top: 4px;
    flex-wrap: wrap;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
    color: #2d3748;
}
.radio-group input[type="radio"] { width: 16px; height: 16px; accent-color: #4a90d9; cursor: pointer; }
.conditional-block { display: none; animation: fadeIn 0.3s ease; }
.conditional-block.visible { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e8edf3;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.btn {
    padding: 12px 36px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #4a90d9; color: #fff; }
.btn-primary:hover { background: #3a7bc8; }
.btn-secondary { background: #e8edf3; color: #4a5a72; }
.btn-secondary:hover { background: #d5dde6; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #d63a2a; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #eafaf1; color: #1a7a42; border: 1px solid #b8e6c8; }
.alert-error { background: #fdedec; color: #a93226; border: 1px solid #f5c8c5; }
.alert-info { background: #eaf2fa; color: #2c6b9e; border: 1px solid #c5d9ed; }
.footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
    font-size: 13px;
    color: #8895aa;
}
.footer a { color: #4a90d9; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.tag {
    display: inline-block;
    padding: 1px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.tag-yes { background: #eafaf1; color: #1a7a42; }
.tag-no { background: #fdedec; color: #a93226; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.text-muted { color: #8895aa; font-size: 13px; }
.text-center { text-align: center; }
.detail-row { margin-bottom: 8px; }
.detail-row strong { display: inline-block; min-width: 140px; }
.file-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.file-item {
    background: #f7f9fc;
    border: 1px solid #e8edf3;
    border-radius: 6px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.file-item a { color: #4a90d9; text-decoration: none; }
.file-item a:hover { text-decoration: underline; }
.file-item .file-type { color: #8895aa; font-size: 11px; }
.preview-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid #e8edf3;
    margin-top: 4px;
}
/* 加载遮罩 + 进度条 */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 18px;
    color: #1a2332;
}
#loading-overlay .spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #4a90d9;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#progress-container {
    width: 80%;
    max-width: 400px;
    background: #e8edf3;
    border-radius: 20px;
    overflow: hidden;
    margin: 10px 0;
    height: 20px;
}
#progress-bar {
    height: 100%;
    width: 0%;
    background: #4a90d9;
    transition: width 0.3s;
    border-radius: 20px;
}
#progress-text {
    font-size: 14px;
    color: #4a5a72;
}
.red-warning {
    color: #e74c3c;
    font-weight: 600;
}

/* ============================================================
   手机端适配（≤640px）
   ============================================================ */
@media (max-width: 640px) {
    body {
        padding: 8px;
        font-size: 15px;
    }
    .container {
        padding: 16px 14px;
        border-radius: 8px;
    }
    .header {
        padding-bottom: 18px;
        margin-bottom: 20px;
    }
    .header h1 {
        font-size: 22px;
    }
    .header .sub {
        font-size: 13px;
    }
    .form-section {
        margin-bottom: 22px;
        padding-bottom: 18px;
    }
    .section-title {
        font-size: 16px;
        margin-bottom: 14px;
    }
    .form-group {
        margin-bottom: 14px;
    }
    .form-group label {
        font-size: 14px;
    }
    .form-control {
        padding: 10px 12px;
        font-size: 15px;
    }
    .form-actions {
        margin-top: 24px;
        padding-top: 18px;
        flex-direction: column;
        gap: 10px;
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 15px;
    }
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    /* 查看详情页：标签和值上下排列 */
    .detail-row {
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f2f5;
    }
    .detail-row strong {
        display: block;
        min-width: auto;
        font-size: 13px;
        color: #8895aa;
        margin-bottom: 2px;
    }
    .detail-row .detail-content {
        display: block;
        font-size: 15px;
        color: #1a2332;
        word-break: break-all;
    }
    /* 文件预览在手机上更紧凑 */
    .preview-img {
        max-width: 100%;
        max-height: 200px;
    }
    .file-upload-item {
        padding: 12px 14px;
    }
    .radio-group {
        gap: 16px;
    }
    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
    .footer {
        font-size: 12px;
        margin-top: 20px;
        padding-top: 14px;
    }
}

/* 超小屏幕（≤380px） */
@media (max-width: 380px) {
    .header h1 {
        font-size: 19px;
    }
    .btn {
        padding: 9px 16px;
        font-size: 13px;
    }
    .form-control {
        font-size: 14px;
    }
}

/* ============================================================
   上传文件预览样式
   ============================================================ */
.upload-preview {
    margin-top: 8px;
}
.upload-preview-img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s;
}
.upload-preview-img:hover {
    transform: scale(1.02);
}
.upload-preview-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f7f9fc;
    border-radius: 6px;
    border: 1px solid #eef2f7;
}
.upload-preview-file .preview-icon {
    font-size: 28px;
}
.upload-preview-file .preview-type {
    font-size: 13px;
    color: #4a5a72;
    font-weight: 500;
}
.file-upload-item .file-name {
    font-size: 12px;
    color: #4a90d9;
    margin-top: 6px;
    word-break: break-all;
    font-weight: 500;
}