:root {
    --primary-color: #0B3D91;
    --secondary-color: #6c757d;
    --bg-color: #F5F7FB;
    --card-bg: #ffffff;
    --text-color: #1F2937;
    --muted-text: #6B7280;
    --warning-color: #B42318;
    --brand-red: #C00000;
    --border-radius: 12px;
    --border-color: rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 2px 10px rgba(2, 6, 23, 0.06);
    --shadow-md: 0 10px 30px rgba(2, 6, 23, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #F8FAFF 0%, var(--bg-color) 55%, #F8FAFF 100%);
    color: var(--text-color);
    margin: 0;
    padding: 18px;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    text-align: center; /* 全局文字居中（前台页面） */
}

header {
    text-align: center;
    margin: 10px 0 18px;
    padding: 16px 14px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #0B3D91 0%, #082C66 100%);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
}

header::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.65), rgba(255,255,255,0.10));
}

.logo {
    width: 132px;
    height: 132px;
    object-fit: contain;
    padding: 6px; /* 减少白边厚度 */
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 10px;
}

h1 {
    font-size: 1.7rem;
    color: #ffffff;
    margin: 6px 0 6px;
    letter-spacing: 0.02em;
    font-weight: 900;
}

@media (max-width: 420px) {
    .logo {
        width: 112px;
        height: 112px;
        padding: 5px;
    }

    h1 {
        font-size: 1.55rem;
    }
}

h2 {
    font-size: 1.1rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin-top: 0;
}

.card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.heavy-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border-left: none;
    background: linear-gradient(135deg, #B10000 0%, var(--brand-red) 100%);
    box-shadow: 0 10px 18px rgba(177, 0, 0, 0.16);
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.heavy-label {
    font-size: 0.98rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
    display: block;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.preview-container {
    margin-top: 10px;
    display: none;
}

.preview-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.92);
    text-align: center; /* 输入内容居中 */
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(11, 91, 211, 0.45);
    box-shadow: 0 0 0 4px rgba(11, 91, 211, 0.12);
}

textarea {
    height: 80px;
}

.warning {
    background-color: #FFF4F4;
    border: 1px solid rgba(192, 0, 0, 0.25);
    color: #7A0000;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.btn-primary {
    width: 100%;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0847A6 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 10px 22px rgba(11, 91, 211, 0.18);
}

.btn-primary:hover {
    filter: brightness(0.98);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    border: 1px solid rgba(11, 91, 211, 0.35);
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background-color: rgba(11, 91, 211, 0.06);
    border-color: rgba(11, 91, 211, 0.45);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 5px;
}

.fraud-project {
    border-bottom: 1px dashed #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.fraud-project:last-child {
    border-bottom: none;
}

.sub-section {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.input-row {
    margin-bottom: 5px;
}

.query-result {
    margin-top: 20px;
    padding: 10px 0 0;
    text-align: center;
    font-weight: 900;
    color: var(--primary-color); /* 改为页面统一蓝色 */
    font-size: 1.5rem; /* 保持大字号 */
    border: none; /* 取消蓝色虚线框 */
    border-radius: 8px;
    background-color: transparent; /* 取消背景色，保持简洁 */
}

.query-section {
    border: 1px solid var(--border-color);
}

.page-footer {
    padding: 12px 6px 6px;
    text-align: center;
}

.page-footer__note {
    font-size: 0.82rem;
    color: var(--muted-text);
    line-height: 1.5;
}

/* Customer Service UI */
.cs-fab {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 1800;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(11, 61, 145, 0.28);
    background: rgba(255, 255, 255, 0.92);
    color: #0B3D91;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.cs-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    z-index: 1900;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.cs-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.cs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #ffffff;
    color: #0F172A;
    border-bottom: 1px solid var(--border-color);
}

.cs-title {
    font-weight: 900;
    letter-spacing: 0.02em;
}

.cs-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(2, 6, 23, 0.04);
    color: #111827;
    font-size: 22px;
    cursor: pointer;
}

.cs-auth {
    padding: 14px;
}

.cs-auth-title {
    font-weight: 900;
    margin-bottom: 10px;
    color: #0F172A;
}

.cs-chat {
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 640px;
}

.cs-msgs {
    flex: 1;
    padding: 12px;
    overflow: auto;
    background: #F8FAFF;
    text-align: left;
}

.cs-bubble {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 14px;
    margin: 8px 0;
    line-height: 1.45;
    word-break: break-word;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.cs-bubble.user {
    margin-left: auto;
    background: rgba(11, 61, 145, 0.10);
    color: #0B3D91;
}

.cs-bubble.admin {
    margin-right: auto;
    background: #fff;
    color: #111827;
}

.cs-bubble img,
.cs-bubble video {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

.cs-input {
    display: grid;
    grid-template-columns: 70px 1fr 70px;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.cs-attach,
.cs-send {
    border: 1px solid rgba(11, 61, 145, 0.22);
    border-radius: 12px;
    background: rgba(11, 61, 145, 0.05);
    color: #0B3D91;
    font-weight: 900;
    cursor: pointer;
}

.cs-send {
    background: var(--primary-color);
    color: #fff;
    border: none;
}

.cs-input input[type="text"] {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    padding: 10px 10px;
    text-align: left;
}

@media (min-width: 700px) {
    .cs-modal {
        align-items: center;
    }
}

/* Camera Styles */
.upload-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.upload-options > span {
    color: var(--muted-text);
    font-weight: 700;
    user-select: none;
}

/* Mobile responsive tweaks (avoid text misalignment / overflow) */
@media (max-width: 520px) {
    body {
        padding: 12px;
    }

    .container {
        max-width: 100%;
    }

    header {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    /* Section subtitles like (必填) / (至少填写一个项目) should not float on mobile */
    .heavy-title small {
        float: none !important;
        display: block;
        margin-top: 6px;
        font-size: 0.85em !important;
        opacity: 0.92;
    }

    /* Camera upload row: stack vertically to avoid wrapping/collisions */
    .upload-options {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .upload-options > span {
        text-align: center;
        margin: 0 !important;
    }

    /* Slightly reduce big query text on very small screens */
    .query-result {
        font-size: 1.25rem;
    }
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
}

.camera-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-header h3 {
    margin: 0;
    color: white;
}

.close-camera {
    font-size: 30px;
    cursor: pointer;
    color: white;
}

.camera-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#cameraVideo {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    background: #f0f0f0;
}

.camera-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.camera-preview {
    width: 100%;
    text-align: center;
}

#photoPreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

