/* 移动端优化的设备检测样式 - 增强版 */
:root {
    --primary: #007AFF;
    --primary-dark: #0056CC;
    --secondary: #8E8E93;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --background: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #666666;
    --text-light: #888888;
    --border: #e5e5e7;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --nz-blue: #012169;
    --nz-red: #C8102E;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 16px;
    padding: 0;
    margin: 0;
}

.mobile-container {
    max-width: 100%;
    min-height: 100vh;
    background: var(--background);
}

/* 头部样式 */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.header-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.header-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    padding: 16px;
    padding-bottom: 80px;
}

/* 卡片通用样式 */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 徽章样式 */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.precise {
    background: var(--success);
    color: white;
}

.badge.estimated {
    background: var(--warning);
    color: white;
}

/* 设备信息样式 */
.device-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

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

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.info-value.warning {
    color: var(--warning);
}

/* 凸显的配件卡片 */
.featured-section {
    background: linear-gradient(135deg, var(--warning) 0%, #E68500 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.featured-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.device-display {
    margin-bottom: 16px;
}

.device-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.device-display h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.featured-description {
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.4;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--warning);
    text-decoration: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
    border: none;
    cursor: pointer;
}

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

.feature-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
}

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

/* 新西兰热门设备区域 */
.nz-popular {
    background: linear-gradient(135deg, var(--nz-blue) 0%, #1a3a8f 100%);
    color: white;
}

.popular-devices {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-section h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    opacity: 0.9;
}

.model-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* 操作按钮区域 */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.btn {
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn.secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(142, 142, 147, 0.3);
}

/* 手动选择区域 */
.manual-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.select-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 精确检测区域 */
.loading-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.detection-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

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

.result-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(135deg, var(--success) 0%, #2AA952 100%);
    color: white;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

/* 选择提示 */
.selection-prompt {
    background: #e3f2fd;
    border: 2px solid #2196F3;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.selection-prompt.success {
    background: #e8f5e8;
    border-color: var(--success);
}

.prompt-title {
    color: #1565C0;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.model-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-option {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.model-option:active {
    background: var(--primary);
    color: white;
}

/* 页脚 */
.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.location {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
}

/* 响应式调整 */
@media (max-width: 380px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stats-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .main-content {
        padding: 12px;
        padding-bottom: 80px;
    }
    
    .model-buttons {
        flex-direction: column;
    }
}
/* Smart Recommendation Styles - English Version */
.smart-recommendation {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    border: 2px solid #FF8C00;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.recommendation-header h4 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.recommendation-reason {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
}

.recommendation-action {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.recommendation-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.recommendation-btn.primary {
    background: #007AFF;
    color: white;
}

.recommendation-btn.secondary {
    background: #8E8E93;
    color: white;
}

.recommendation-btn:active {
    transform: scale(0.95);
}

.recommendation-models {
    margin-bottom: 12px;
}

.models-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9rem;
}

.models-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.model-option {
    background: white;
    border: 2px solid #ddd;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.85rem;
}

.model-option.recommended {
    background: #007AFF;
    color: white;
    border-color: #007AFF;
}

.model-option:active {
    transform: scale(0.95);
}

.recommendation-note {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
}

.confidence-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.confidence-badge.high {
    background: #34C759;
    color: white;
}

.confidence-badge.medium {
    background: #FF9500;
    color: white;
}

.confidence-badge.low {
    background: #FF3B30;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .recommendation-action {
        flex-direction: column;
    }
    
    .models-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendation-btn {
        padding: 14px 16px;
    }
}

/* 防止iOS缩放 */
@supports (-webkit-touch-callout: none) {
    select {
        font-size: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1c1c1e;
        --card-bg: #2c2c2e;
        --text-primary: #ffffff;
        --text-secondary: #98989f;
        --border: #38383a;
        --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
}

/* 搜索相关样式 */
.search-container {
    position: relative;
}

.search-result-item:hover {
    background-color: #f5f5f7;
}

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

/* 品牌修正日志样式 */
.brand-correction-log {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #007AFF;
}
