* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans TC", sans-serif;
    background: #0f1722;
    color: #e5edf5;
}

.page {
    min-height: 100vh;
    padding: 28px 20px 40px;
}

.topbar {
    max-width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: #f8fbff;
    letter-spacing: 0.5px;
}

.tag {
    font-size: 14px;
    color: #c9d7e6;
    background: #1b2838;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #2b3b4f;
}

.main-layout {
    max-width: 1380px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.7fr 1.1fr;
    gap: 28px;
    align-items: start;
}

.main-card,
.side-panel > div {
    background: #16202c;
    border: 1px solid #243244;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.main-card {
    padding: 28px;
}

.warning-banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff4e5;
    color: #9a6700;
    border: 1px solid #f3d19c;
    font-size: 14px;
    font-weight: 600;
}

.hero {
    margin-bottom: 26px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 36px;
    color: #f8fbff;
    font-weight: 800;
}

.hero-desc {
    margin: 0 0 16px;
    color: #b8c7d6;
    line-height: 1.8;
    font-size: 16px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-points span {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #edf7f6;
    color: #0f766e;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #c7ece8;
}

.input-card {
    border-top: 1px solid #e6edf5;
    padding-top: 24px;
}

.field {
    margin-bottom: 24px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.field-header label {
    font-size: 16px;
    font-weight: 700;
    color: #243b53;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: #163a5f;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid #33475b;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    color: #edf4fb;
    background: #101925;
    transition: all 0.2s ease;
    outline: none;
}

textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.7;
}

textarea:focus,
input[type="text"]:focus {
    border-color: #2a7f9e;
    box-shadow: 0 0 0 4px rgba(42, 127, 158, 0.12);
}

textarea::placeholder,
input[type="text"]::placeholder {
    color: #7f93a8;
}

.upload-zone {
    border: 2px dashed #3a5268;
    border-radius: 16px;
    background: #101925;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: #5ea6c6;
    background: #132131;
}

.upload-icon {
    font-size: 28px;
}

.upload-text {
    font-size: 18px;
    font-weight: 700;
    color: #edf4fb;
}

.upload-hint {
    font-size: 14px;
    color: #8fa4b8;
}

#image-preview {
    display: none;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid #d9e2ec;
    background: #fff;
    padding: 10px;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

#scan-btn {
    flex: 1;
    background: #1f5d8f;
    color: #ffffff;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 800;
}

#scan-btn {
    flex: 1;
    background: #163a5f;
    color: #ffffff;
    padding: 15px 18px;
    font-size: 16px;
    font-weight: 700;
}

#scan-btn:hover {
    background: #2a74ae;
}

#reset-all-btn {
    min-width: 120px;
    background: #1a2430;
    color: #d6e2ee;
    padding: 15px 18px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid #314154;
}

#reset-all-btn:hover {
    background: #223040;
}

.clear-single-btn {
    background: transparent;
    color: #2a7f9e;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
}

.clear-single-btn:hover {
    background: #eef7fb;
}

.note-box {
    margin-top: 26px;
    padding: 18px 20px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.note-box h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: #163a5f;
}

.note-box ul {
    margin: 0;
    padding-left: 20px;
    color: #52606d;
    line-height: 1.8;
    font-size: 14px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card,
.info-card {
    padding: 28px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.result-header h3,
.info-card h3 {
    margin: 0;
    font-size: 28px;
    color: #f4f8fc;
}

.timestamp {
    font-size: 15px;
    color: #9fb0c3;
}

.score-badge {
    display: inline-block;
    margin-bottom: 20px;
    padding: 14px 22px;
    border-radius: 999px;
    background: #1d2b3a;
    font-size: 24px;
    font-weight: 800;
    border: 1px solid #2f4358;
    line-height: 1.4;
}

.advice-content {
    line-height: 1.9;
    color: #d7e2ee;
    font-size: 18px;
}

.advice-content b {
    color: #163a5f;
}

.ocr-box {
    margin-top: 22px;
    padding: 20px;
    background: #111a24;
    border: 1px solid #29384a;
    border-radius: 14px;
}

.ocr-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f6fb;
    margin-bottom: 12px;
}

#ocr-text {
    margin: 0;
    color: #c9d7e6;
    line-height: 1.8;
    font-size: 16px;
    word-break: break-word;
}

.info-item {
    padding: 14px 0;
    border-bottom: 1px solid #edf2f7;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-title {
    font-size: 16px;
    font-weight: 700;
    color: #eef4fa;
    margin-bottom: 6px;
}

.info-item p {
    margin: 0;
    color: #9eb1c4;
    font-size: 15px;
    line-height: 1.8;
}

@media (max-width: 960px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 18px 14px 28px;
    }

    .main-card,
    .result-card,
    .info-card {
        padding: 18px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .btn-group {
        flex-direction: column;
    }

    #reset-all-btn {
        width: 100%;
    }

    .field-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
}