/* 许可证查询系统样式 */

#license-lookup-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.license-lookup-form {
    text-align: center;
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.license-lookup-form h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 28px;
}

.license-lookup-form p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

#license-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    box-sizing: border-box;
}

#license-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-hint {
    font-size: 14px;
    color: #95a5a6;
    margin-top: 8px;
}

/* 验证码样式 */
.captcha-group {
    text-align: left;
}

.captcha-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.captcha-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-image-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

#captcha-image {
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    height: 56px;
    width: 120px;
    object-fit: contain;
    max-width: 100%;
}

#captcha-image:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#captcha-image:active {
    transform: scale(0.95);
}

#refresh-captcha {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 10;
    border: 2px solid #e0e0e0;
}

#refresh-captcha:hover {
    background: #3498db;
    transform: scale(1.1);
}

#refresh-link {
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

#refresh-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

#captcha-input {
    flex: 1;
    padding: 18px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    box-sizing: border-box;
    text-align: center;
    letter-spacing: 3px;
    font-weight: 600;
}

#captcha-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#captcha-image {
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    height: 56px;
    width: 120px;
    object-fit: contain;
}

#captcha-image:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#captcha-image:active {
    transform: scale(0.95);
}

.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.lookup-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
}

.lookup-button:hover {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.lookup-button:active {
    transform: translateY(0);
}

.lookup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lookup-button .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

.example-license {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.example-license p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.example-license ul {
    list-style: none;
    padding-left: 0;
}

.example-license li {
    margin-bottom: 8px;
    color: #7f8c8d;
}

.example-license code {
    background: #e8f4fc;
    color: #2980b9;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* 结果样式 */
#result-container {
    margin-top: 30px;
    padding: 30px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border-left: 5px solid #3498db;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.result-title .license-code {
    color: #2980b9;
    font-family: monospace;
    background: #e8f4fc;
    padding: 5px 10px;
    border-radius: 4px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.status-blocked {
    background: #fff3cd;
    color: #856404;
}

.status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
}

.days-remaining {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #e8f4fc, #d1ecf1);
}

.days-remaining.positive {
    color: #27ae60;
}

.days-remaining.negative {
    color: #e74c3c;
}

.days-remaining.neutral {
    color: #f39c12;
}

/* 错误信息 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 5px solid #e74c3c;
    text-align: center;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    font-size: 18px;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #license-lookup-container {
        padding: 20px;
        margin: 20px;
        border-radius: 8px;
    }

    .license-lookup-form {
        padding: 20px;
    }

    .license-lookup-form h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .license-lookup-form > p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    #license-input,
    #captcha-input {
        padding: 14px 16px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .captcha-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .captcha-image-container {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #captcha-image {
        width: 100%;
        max-width: 200px;
        height: auto;
    }

    #captcha-input {
        width: 100%;
        flex: none;
    }

    #refresh-captcha {
        position: static;
        width: 32px;
        height: 32px;
        font-size: 18px;
        margin-left: 10px;
    }

    .input-hint {
        font-size: 13px;
        text-align: center;
    }

    .lookup-button {
        padding: 14px 30px;
        font-size: 16px;
    }

    .example-license {
        padding: 15px;
        margin-top: 20px;
    }

    .example-license p {
        font-size: 14px;
    }

    .example-license code {
        font-size: 11px;
        word-break: break-all;
        display: inline-block;
        padding: 5px 8px;
    }

    .example-license ul {
        padding-left: 20px;
    }

    .result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .result-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-item {
        padding: 12px;
    }

    .detail-label {
        font-size: 12px;
    }

    .detail-value {
        font-size: 14px;
    }

    .days-remaining {
        font-size: 24px;
        padding: 15px;
    }

    .days-remaining div {
        font-size: 13px;
    }

    .error-message {
        font-size: 14px;
        padding: 15px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    #license-lookup-container {
        padding: 15px;
        margin: 10px;
    }

    .license-lookup-form {
        padding: 15px;
    }

    .license-lookup-form h2 {
        font-size: 20px;
    }

    .form-group label {
        font-size: 13px;
    }

    #license-input,
    #captcha-input {
        padding: 12px 14px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .lookup-button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .example-license code {
        font-size: 10px;
        padding: 4px 6px;
    }

    .detail-item {
        padding: 10px;
    }
}

/* 管理页面样式补充 */
.status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-blocked {
    background: #fff3cd;
    color: #856404;
}

.button-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.button-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}
