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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: #333;
    line-height: 1.5;
    padding: 0;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
}

.container {
    padding: 15px;
}

.banner {
    width: 100%;
    height: auto;
    margin-bottom: -35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    background: #2c3e50;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-logo {
    position: absolute;
    width: 20%;
    max-width: 100px;
    min-width: 50px;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 3;
    top: 27.5%;
    right: 49.8%;
    transform: translate(50%, -50%);
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
}

.banner-content {
    position: absolute;
    text-align: center;
    color: white;
    z-index: 2;
    padding: 10px 20px;
    border-radius: 8px;
    max-width: 80%;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.banner-content h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-content p {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.query-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 18px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
    position: relative;
    z-index: 10;
}

.query-section h2 {
    font-size: 15px;
    margin-bottom: 14px;
    color: #262626;
    text-align: left;
    font-weight: 600;
    padding-left: 0;
}

.input-group {
    display: flex;
    margin-bottom: 5px;
    position: relative;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 10px 50px 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 15px;
    background: #fafafa;
    height: 40px;
    -webkit-appearance: none;
    appearance: none;
    color: #262626;
    transition: border-color 0.2s, background-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #1890ff;
    background: #fff;
}

@supports (-webkit-touch-callout: none) {
    .input-group input {
        font-size: 16px !important;
    }
}

.input-group button[type="submit"] {
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 40px;
    margin-left: 8px;
    min-width: 64px;
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.input-group button[type="submit"]:active {
    background-color: #096dd9;
    box-shadow: 0 1px 2px rgba(24, 144, 255, 0.3);
}

.scan-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.scan-icon {
    width: 28px;
    height: 28px;
    position: relative;
    background: transparent;
}

.scan-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: #999;
    border-style: solid;
    border-width: 0;
}

.corner-tl {
    top: 0;
    left: 0;
    border-right-width: 0;
    border-bottom-width: 0;
    border-top-width: 1px;
    border-left-width: 1px;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left-width: 0;
    border-bottom-width: 0;
    border-top-width: 1px;
    border-right-width: 1px;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right-width: 0;
    border-top-width: 0;
    border-bottom-width: 1px;
    border-left-width: 1px;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left-width: 0;
    border-top-width: 0;
    border-bottom-width: 1px;
    border-right-width: 1px;
}

.middle-line {
    position: absolute;
    top: 0;
    left: 4px;
    right: 4px;
    height: 1px;
    background: #999;
    transform: translateY(0);
    animation: scanAnimation 2s infinite linear;
}

/* 扫一扫动画 */
@keyframes scanAnimation {
    0% {
        top: 0;
        opacity: 1;
    }
    50% {
        top: 100%;
        opacity: 0.7;
    }
    100% {
        top: 0;
        opacity: 1;
    }
}

.scan-btn:hover .scan-corner {
    border-color: #777;
}

.scan-btn:hover .middle-line {
    background: #777;
}

.reminder-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 18px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.reminder-section h2 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #262626;
    font-weight: 600;
    text-align: left;
}

.reminder-section > p {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 14px;
    line-height: 1.5;
}

.result-item {
    margin-bottom: 14px;
    padding-left: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.result-icon {
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #f0f0f0;
}

.result-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 22px;
    height: 36px;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 3px,
        #f0f0f0 3px,
        #f0f0f0 6px
    );
    z-index: 1;
}

.correct-icon {
    background-color: #52c41a;
    color: white;
}

.correct-icon svg {
    width: 10px;
    height: 10px;
}

.repeat-icon {
    background-color: #fa8c16;
    color: white;
}

.repeat-icon .exclamation-icon {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.error-icon {
    background-color: #ff4d4f;
    color: white;
}

.error-icon svg {
    width: 10px;
    height: 10px;
}

.result-item label {
    font-size: 13px;
    font-weight: 500;
    color: #262626;
}

.result-item .desc {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 3px;
    padding-left: 0;
    line-height: 1.4;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: #8c8c8c;
    font-size: 12px;
    padding: 16px 0;
}

.error-message {
    color: #ff4d4f;
    font-size: 13px;
    margin-top: 8px;
    display: none;
    padding-left: 2px;
}

.exclamation-icon {
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 480px) {
    .banner-content h1 {
        font-size: 18px;
    }
    
    .banner-content p {
        font-size: 11px;
    }
    
    .banner-logo {
        width: 18%;
        max-width: 60px;
        min-width: 40px;
    }
    
    .query-section, .reminder-section {
        padding: 18px 12px;
    }
    
    .result-item:not(:last-child)::after {
        left: 10px;
    }
}

@media (max-width: 350px) {
    .banner-logo {
        width: 16%;
        max-width: 50px;
        min-width: 35px;
    }
}

/* 验证结果显示区域 */
.result-section {
    background: #fff;
    border-radius: 10px;
    padding: 24px 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.result-content {
    text-align: center;
}

.result-icon-large {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-icon-large.correct-icon {
    background: #52c41a;
    color: white;
}

.result-icon-large.correct-icon::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.result-icon-large.repeat-icon {
    background: #fa8c16;
    color: white;
}

.result-icon-large.repeat-icon::before {
    content: '!';
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.result-icon-large.error-icon {
    background: #ff4d4f;
    color: white;
}

.result-icon-large.error-icon::before {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.result-icon-large.frozen-icon {
    background: #8c8c8c;
    color: white;
}

.result-icon-large.frozen-icon::before {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.result-icon-large.loading {
    background: #1890ff;
    animation: spin 1s linear infinite;
}

.result-icon-large.loading::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.result-title.correct {
    color: #52c41a;
}

.result-title.repeat {
    color: #fa8c16;
}

.result-title.error {
    color: #ff4d4f;
}

.result-title.frozen {
    color: #595959;
}

.result-message {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    color: #595959;
    padding: 0 8px;
}

.result-message.correct {
    color: #52c41a;
}

.result-message.repeat {
    color: #fa8c16;
}

.result-message.error {
    color: #ff4d4f;
}

.result-message.frozen {
    color: #595959;
}

.result-details {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid #fafafa;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #8c8c8c;
    font-weight: 400;
}

.detail-value {
    color: #262626;
    font-weight: 500;
}
