/* iOS 16 液态玻璃效果样式 */
:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #30D158;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --text-primary: rgba(55, 65, 81, 0.95);
    --text-secondary: rgba(75, 85, 99, 0.8);
    --backdrop-blur: blur(20px);
    --border-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* 简洁背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 容器布局 */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 主要玻璃卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
}

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

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, #374151 0%, #6B7280 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.input-group {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

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

#qiid-input {
    width: 100%;
    padding: 20px 24px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

#qiid-input::placeholder {
    color: rgba(75, 85, 99, 0.6);
}

#qiid-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 4px rgba(0, 122, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.input-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#qiid-input:focus + .input-highlight {
    opacity: 1;
}

/* 搜索按钮 */
.search-button {
    position: relative;
    padding: 20px 32px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
}

.button-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.search-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

.search-button:hover .button-bg {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4);
}

.search-button:active {
    transform: scale(0.98);
}

.search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 加载状态 */
.loading-container {
    margin: 2rem 0;
    justify-content: center;
    display: none;
}

.loading-container.show {
    display: flex !important;
}

.loading-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
}

.spinner-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 45px;
    height: 45px;
    top: 7.5px;
    left: 7.5px;
    border-top-color: var(--secondary-color);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 30px;
    height: 30px;
    top: 15px;
    left: 15px;
    border-top-color: var(--success-color);
    animation-duration: 2s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 错误提示 */
.error-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.error-glass {
    background: rgba(255, 59, 48, 0.1);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    animation: shakeIn 0.6s ease-out;
}

@keyframes shakeIn {
    0% { transform: translateX(-10px); opacity: 0; }
    25% { transform: translateX(10px); }
    50% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); opacity: 1; }
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-text {
    color: var(--error-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.retry-button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: var(--error-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #e6342a;
    transform: translateY(-2px);
}

/* 结果展示区域 */
.results-container {
    animation: fadeInUp 0.6s ease-out;
}

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

.result-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.certification-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(48, 209, 88, 0.2);
    border: 1px solid rgba(48, 209, 88, 0.3);
    border-radius: 20px;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-icon {
    font-size: 1.2rem;
}

/* 产品信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.info-card:hover::before {
    left: 100%;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.info-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.info-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-value a:hover {
    color: #0051d5;
}

/* 产品图片轮播 */
.product-images {
    margin-bottom: 2rem;
}

.images-header {
    margin-bottom: 1rem;
}

.images-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.image-carousel {
    position: relative;
}

.carousel-container {
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.image-gallery {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-image {
    flex: 0 0 100%;
    aspect-ratio: 16/9;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.product-image .image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 500;
}

.carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0 1rem;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* 额外详细信息 */
.additional-details {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.additional-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.details-grid {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* 图片模态窗口 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(40px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-caption {
    padding: 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    color: white;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .glass-card {
        padding: 24px;
        margin: 0;
    }
    
    .header {
        margin-bottom: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-card {
        padding: 16px;
    }
    
    .product-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-value {
        max-width: 100%;
        text-align: left;
    }
    
    .carousel-controls {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 20px;
    }
    
    .loading-glass,
    .error-glass,
    .result-glass {
        padding: 1.5rem;
    }
    
    .info-card {
        padding: 12px;
    }
    
    .info-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    .glass-card {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #000;
        color: #000;
    }
    
    .info-card {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #000;
    }
}