/* ==========================================
   星途AI智能设备检测维修平台 - 全局样式
   ========================================== */

:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --primary-light: #e6f4ff;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --purple: #722ed1;
    --teal: #13c2c2;
    --orange: #fa8c16;
    --text-primary: #1f1f1f;
    --text-secondary: #595959;
    --text-tertiary: #8c8c8c;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f0f7ff;
    --border: #e8e8e8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================
   导航栏
   ========================================== */
.navbar {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.navbar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.navbar-menu a {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-menu a:hover, .navbar-menu a.active {
    color: var(--primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   按钮
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-large {
    padding: 14px 36px;
    font-size: 17px;
}

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   首页Hero
   ========================================== */
.hero {
    background: linear-gradient(135deg, #1677ff 0%, #722ed1 100%);
    color: white;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary {
    background: white;
    color: var(--primary);
}

.hero-actions .btn-primary:hover {
    background: #f0f0f0;
}

.hero-actions .btn-outline {
    color: white;
    border-color: rgba(255,255,255,0.6);
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 56px;
}

.hero-stat {
    text-align: left;
}

.hero-stat-num {
    font-size: 36px;
    font-weight: 800;
}

.hero-stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* ==========================================
   卡片网格
   ========================================== */
.section {
    padding: 64px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-title p {
    font-size: 16px;
    color: var(--text-tertiary);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.feature-icon.blue { background: var(--primary-light); color: var(--primary); }
.feature-icon.green { background: #f6ffed; color: var(--success); }
.feature-icon.purple { background: #f9f0ff; color: var(--purple); }
.feature-icon.orange { background: #fff7e6; color: var(--orange); }
.feature-icon.teal { background: #e6fffb; color: var(--teal); }
.feature-icon.red { background: #fff1f0; color: var(--danger); }

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==========================================
   设备类别选择
   ========================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.category-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.category-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.category-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.category-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.category-card h4 {
    font-size: 16px;
    font-weight: 600;
}

.category-card span {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==========================================
   表单
   ========================================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--danger);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.2s;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ==========================================
   上传区域
   ========================================== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.upload-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   步骤条
   ========================================== */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 48px;
    gap: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
}

.step.active .step-num {
    background: var(--primary);
    color: white;
}

.step.completed .step-num {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step-line {
    width: 48px;
    height: 2px;
    background: var(--border);
}

.step.completed + .step-line {
    background: var(--success);
}

/* ==========================================
   诊断结果
   ========================================== */
.result-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.result-title {
    font-size: 22px;
    font-weight: 700;
}

.result-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #f6ffed; color: var(--success); }
.tag-orange { background: #fff7e6; color: var(--orange); }
.tag-red { background: #fff1f0; color: var(--danger); }

.result-section {
    margin-bottom: 28px;
}

.result-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-section p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.result-steps {
    list-style: none;
    counter-reset: step;
}

.result-steps li {
    counter-increment: step;
    padding-left: 40px;
    position: relative;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-secondary);
}

.result-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning), var(--success));
    border-radius: 4px;
    transition: width 0.5s;
}

/* ==========================================
   历史列表
   ========================================== */
.history-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.history-item:hover {
    box-shadow: var(--shadow-md);
}

.history-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.history-info p {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ==========================================
   模态框
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ==========================================
   加载动画
   ========================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 3000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ==========================================
   套餐卡片
   ========================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border);
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.pricing-card.featured {
    border-color: var(--primary);
}

.pricing-card.featured::before {
    content: "推荐";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0;
}

.pricing-price .unit {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.pricing-features {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.pricing-features li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: "✓ ";
    color: var(--success);
    font-weight: 700;
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 48px 0 24px;
    margin-top: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand h3 {
    color: white;
    font-size: 20px;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
}

.footer-col h4 {
    color: white;
    font-size: 15px;
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero-subtitle { font-size: 16px; }
    .hero-stats { gap: 24px; }
    .hero-stat-num { font-size: 28px; }
    .navbar-menu { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .steps { flex-wrap: wrap; }
    .step-line { display: none; }
}

/* ==========================================
   工具类
   ========================================== */
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.hidden { display: none !important; }
