/* Canadian Solar Authenticity Portal Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    background-color: #fbf5eb;
    color: #262626;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Header */
.site-header {
    background-color: #ffffff;
    width: 100%;
    border-bottom: 1px solid #eae5dc;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.header-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 38px;
    object-fit: contain;
}

/* Main Area */
.portal-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px 40px;
    position: relative;
    z-index: 5;
}

/* Solar Panel Decorative Background Tiles */
.bg-panel {
    position: fixed;
    width: 220px;
    height: 300px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
    background-size: 40px 40px;
    background-color: #173252;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 3px solid #cedbe7;
}

.bg-panel-tl {
    top: 50px;
    left: -70px;
    transform: rotate(14deg);
}

.bg-panel-tr {
    top: 70px;
    right: -70px;
    transform: rotate(-16deg);
}

.bg-panel-bl {
    bottom: -60px;
    left: -80px;
    transform: rotate(-12deg);
}

.bg-panel-br {
    bottom: -50px;
    right: -80px;
    transform: rotate(15deg);
}

@media (max-width: 768px) {
    .bg-panel {
        width: 160px;
        height: 220px;
        opacity: 0.7;
    }
    .bg-panel-tl {
        top: 60px;
        left: -80px;
    }
    .bg-panel-tr {
        top: 80px;
        right: -80px;
    }
}

/* Central Card */
.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 24px 20px 28px;
    position: relative;
    z-index: 10;
    margin: 0 auto;
}

/* Card Title */
.card-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    padding-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

/* View Section Control */
.view-section {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.text-input {
    width: 100%;
    height: 44px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 13px;
    color: #222222;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.text-input:focus {
    border-color: #c4261d;
    box-shadow: 0 0 0 2px rgba(196, 38, 29, 0.1);
}

.text-input::placeholder {
    color: #a3a3a3;
    font-size: 12.5px;
    letter-spacing: 0.1px;
}

/* Barcode Guide */
.guide-container {
    margin-top: 14px;
    margin-bottom: 16px;
}

.guide-image {
    width: 100%;
    display: block;
    border-radius: 3px;
    border: 1px solid #eeeeee;
}

.guide-caption {
    font-size: 12px;
    color: #555555;
    line-height: 1.45;
    margin-top: 6px;
    margin-bottom: 2px;
}

/* Captcha Row */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-badge-wrapper {
    width: 125px;
    height: 44px;
    background: #eee8f0;
    border-radius: 4px;
    border: 1px solid #d9d0de;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.1s;
}

.captcha-badge-wrapper:hover {
    opacity: 0.92;
}

.captcha-badge-wrapper:active {
    transform: scale(0.98);
}

#captchaCanvas {
    display: block;
    width: 125px;
    height: 44px;
}

.error-msg {
    color: #c4261d;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-submit {
    background-color: #c4261d;
    color: #ffffff;
    border: none;
    margin-top: 24px;
}

.btn-submit:hover {
    background-color: #b02018;
}

.btn-submit:active {
    background-color: #991912;
}

.btn-back {
    background-color: #ffffff;
    color: #b82e28;
    border: 1px solid #b82e28;
    margin-top: 24px;
}

.btn-back:hover {
    background-color: #fdf5f5;
}

.btn-back:active {
    background-color: #faecec;
}

/* Disclaimer Texts (Bilingual) */
.disclaimer-text {
    font-size: 12px;
    line-height: 1.55;
    color: #444444;
    margin-bottom: 18px;
}

.disclaimer-text p {
    margin-bottom: 6px;
}

.disclaimer-text .zh-text {
    color: #333333;
    margin-bottom: 12px;
}

/* Result Table */
.result-table {
    border-top: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12.5px;
}

.row-label {
    color: #555555;
    flex: 1;
    padding-right: 12px;
}

.row-value {
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.bold-sn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    letter-spacing: 0.2px;
}

.result-genuine {
    color: #238238;
    font-weight: 700;
}

.result-notfound {
    color: #c4261d;
    font-weight: 700;
}

/* Not Match Notice */
.notfound-notice {
    font-size: 12px;
    line-height: 1.55;
    color: #555555;
    margin-top: 18px;
    margin-bottom: 10px;
}

.notfound-notice p {
    margin-bottom: 8px;
}

.notfound-notice .zh-text {
    color: #444444;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .portal-main {
        padding: 16px 12px 30px;
    }
    .auth-card {
        padding: 20px 16px 24px;
    }
    .table-row {
        padding: 10px 0;
        font-size: 12px;
    }
    .card-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
}
