/* Scan Page Styles - 从内联样式拆分 */

/* CSP 兼容 */
.d-none { display: none !important; }
.img-hidden { display: none !important; }

body {
    font-family: Arial, sans-serif;
    background-color: #04947b;
    color: #333;
    padding: 10px;
    margin: 0;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 5px;
}

.header h2 {
    color: #fff;
    font-size: 16px;
    margin-top: 0;
}

.module {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.module-center {
    text-align: center;
}

.module-error {
    color: #dc3545;
}

.product-verification {
    text-align: center;
    padding: 25px 15px;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
}

.badge-icon {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 15px;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.product-image-container {
    margin: 20px auto;
    text-align: center;
}

.product-image {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #eee;
    border-radius: 5px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.scan-gallery,
.scan-gallery * {
    box-sizing: border-box;
}

.scan-gallery {
    width: 100%;
}

.scan-gallery__viewport {
    width: 100%;
}

.scan-gallery__scroller {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scan-gallery__scroller::-webkit-scrollbar {
    display: none;
}

.scan-gallery__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-gallery__img {
    width: auto;
    max-width: 100%;
}

.scan-gallery__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
}

.scan-gallery__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c8c8c8;
    cursor: pointer;
}

.scan-gallery__dot--active {
    background: #2e8b57;
}

.product-name {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0 10px;
}

.official-tag {
    display: inline-block;
    background-color: #000000;
    color: white;
    padding: 6px 50px;
    border-radius: 20px;
    font-size: 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.scan-copyright {
    margin: 8px 16px 24px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #8b95a1;
}

.security-badge {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #2e8b57;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.verification-container {
    display: flex;
    align-items: flex-start;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.verification-icon {
    width: 30px;
    height: 30px;
    margin-right: 15px;
    flex-shrink: 0;
}

.verification-text {
    flex: 1;
    line-height: 1.6;
    font-size: 15px;
    color: #28a745;
    font-weight: bold;
}

.verification-text.frozen {
    color: #dc3545;
}

.module-title {
    border-left: 3px solid #2e8b57;
    padding-left: 10px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    color: #2e8b57;
    height: 15px;
    line-height: 20px;
}

.module-title span {
    color: #2e8b57;
    font-weight: normal;
    margin-left: 5px;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
    justify-content: space-between;
}

.info-label {
    flex-shrink: 0;
    color: #000000;
}

.info-content {
    text-align: right;
    flex: 1;
    margin-left: 20px;
    color: #000000;
}

.verification-status {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.product-description {
    line-height: 1.6;
    color: #00000;
}

.risk-alert {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-left: 8px;
}

.risk-alert-danger {
    background-color: #dc3545;
}

.risk-alert-secondary {
    background-color: #6c757d;
}

.certifications-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: space-between;
    width: 100%;
}

.certification-item {
    width: 100%;
    height: auto;
    min-height: 300px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    margin-bottom: 0px;
}

.certification-item img {
    width: 100%;
    height: auto; 
    max-height: none; 
    object-fit: scale-down; 
    display: block;
}

.code-input-form {
    margin: 20px 0;
    text-align: center;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.code-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 110px);
}

.submit-btn {
    padding: 10px 20px;
    background-color: #2e8b57;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    width: auto;
}

.scan-btn {
    padding: 10px 20px;
    background-color: #07C160;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    width: auto;
}

.query-count {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.first-query-time {
    font-size: 12px;
    color: #666;
}

.rate-limit-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.rate-limit-message.visible {
    display: block !important;
}

.logo {
    max-width: 100px;
    margin: 0 auto 20px;
    display: block;
}

body.scan2-page .logo {
    display: block;
    margin: 0 auto 16px;
    width: 96px;
    height: 96px;
    max-width: 96px;
    padding: 6px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

@media (max-width: 480px) {
    .certification-item {
        width: 100% !important;
        min-height: 250px;
    }
    
    .product-image {
        max-height: 250px;
    }
    
    .code-input-form {
        flex-direction: row;
        gap: 8px;
    }
    
    .code-input {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .submit-btn, .scan-btn {
        padding: 10px 15px;
        font-size: 15px;
    }
}

.intro-photos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.intro-photos img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #eeeae3;
}

.scan-file-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.scan-file-links a {
    color: #245c38;
    text-decoration: none;
}

.ws-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.ws-pdf-name,
.ws-pdf-status,
.ws-pdf-open {
    margin: 0;
    font-size: 14px;
}

.ws-pdf-name {
    margin-bottom: 6px;
}

.ws-pdf-pages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-pdf-pages canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 6px;
}

.ws-pdf-status[hidden] {
    display: none;
}

.ws-pdf-open {
    margin: 8px 0 0;
    text-align: right;
}

.ws-pdf-open a {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 2px;
    color: inherit;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
}

