/**
 * 快创通全局样式 - cs.zbj.com 八戒财税风格
 * 版本: 3.0
 */

/* ===== CSS Variables ===== */
:root {
    --brand: #007BFF;
    --brand-light: #e6f2ff;
    --brand-dark: #003d85;
    --accent: #FF6B00;
    --accent-light: #fff2e6;
    --gold: #f59e0b;
    --dark: #1a1a2e;
    --body: #4a5568;
    --muted: #718096;
    --success: #10b981;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes pulse-ring {
    0% { transform: scale(.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}
.animate-fadeInUp { animation: fadeInUp .6s ease-out both; }
.animate-fadeIn { animation: fadeIn .4s ease-out both; }

/* ===== Navbar Scroll ===== */
.main-nav.nav-scrolled { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.06); }

/* ===== Card Hover ===== */
.card-hover {
    transition: transform .3s ease, box-shadow .3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* ===== CTA Button ===== */
.cta-btn {
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}
.cta-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.2) 0%, transparent 60%);
    pointer-events: none;
}
.cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(245,108,29,.35);
}

/* ===== Hero Gradient ===== */
.hero-gradient {
    background: linear-gradient(135deg, #00295c 0%, #007BFF 50%, #3399FF 100%);
}

/* ===== Matcher Steps ===== */
.matcher-steps { display: flex; align-items: center; justify-content: center; gap: 0; }
.matcher-step { display: flex; align-items: center; gap: .5rem; }
.matcher-step .step-num {
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8125rem;
    background: #e2e8f0; color: #64748b;
    transition: all .35s ease;
}
.matcher-step.active .step-num { background: var(--brand); color: white; box-shadow: 0 0 0 4px rgba(26,86,219,.15); }
.matcher-step.completed .step-num { background: var(--success); color: white; }
.matcher-step .step-label { font-size: .8125rem; color: #94a3b8; font-weight: 500; }
.matcher-step.active .step-label { color: #1e293b; font-weight: 600; }
.matcher-step.completed .step-label { color: var(--success); }
.matcher-connector { width: 2.5rem; height: 1.5px; background: #e2e8f0; margin: 0 .5rem; }

/* ===== Service Options (Matcher) ===== */
.service-option {
    transition: all .25s ease;
    cursor: pointer;
}
.service-option:hover { border-color: #93c5fd; background: #f8faff; }
.service-option.selected { border-color: var(--brand) !important; background: #e8f0fe !important; box-shadow: 0 0 0 3px rgba(26,86,219,.12); }

/* ===== Accordion (FAQ / Features) ===== */
details { transition: all .3s ease; }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ""; }
details[open] { border-color: var(--brand); background: #fafcff; }

/* ===== Feature Accordion ===== */
.feature-item {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    margin-bottom: .75rem;
    overflow: hidden;
    transition: all .3s ease;
}
.feature-item summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; font-weight: 600; color: var(--dark);
    transition: color .2s;
}
.feature-item summary .indicator {
    width: 3px; height: 20px; background: var(--accent);
    border-radius: 2px; margin-right: .75rem; transition: height .3s;
}
.feature-item[open] summary { color: var(--brand); }
.feature-item[open] summary .indicator { height: 28px; }
.feature-item .feature-body { padding: 0 1.25rem 1.25rem; color: var(--body); line-height: 1.7; }

/* ===== Timeline (Process) ===== */
.process-timeline { position: relative; }
.process-timeline::before {
    content: ''; position: absolute; left: 2rem; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, var(--brand), #93c5fd);
}
.timeline-step { position: relative; padding-left: 4.5rem; margin-bottom: 2rem; }
.timeline-step:last-child { margin-bottom: 0; }
.timeline-step .step-dot {
    position: absolute; left: 1.25rem; top: 0;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: white; border: 2.5px solid var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .875rem; color: var(--brand);
    z-index: 1; box-shadow: 0 0 0 4px rgba(26,86,219,.1);
    transition: all .3s;
}
.timeline-step:hover .step-dot { background: var(--brand); color: white; }

/* ===== Estimator Forms ===== */
.estimator-field { transition: all .3s ease; }
.estimator-field:focus-within { transform: translateY(-1px); }

/* ===== Admin Table ===== */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: #f8fafc; font-weight: 600; text-align: left;
    padding: .75rem 1rem; border-bottom: 2px solid #e2e8f0;
    font-size: .8125rem; color: #475569; white-space: nowrap;
}
.admin-table td {
    padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9;
    font-size: .8125rem; color: #334155;
}
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover td { background: #f8fafc; }

/* ===== Admin Stats ===== */
.stat-card { transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 1.25rem; right: 1.25rem; z-index: 9999;
    padding: .875rem 1.5rem; border-radius: .5rem; font-weight: 500; font-size: .875rem;
    animation: slideInRight .35s ease-out; box-shadow: var(--shadow-lg);
    pointer-events: none;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: #dc2626; color: white; }
.toast-info { background: var(--brand); color: white; }

/* ===== Search Highlight ===== */
mark.search-highlight { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* ===== Loading Spinner ===== */
.spinner {
    width: 2rem; height: 2rem; border: 3px solid #e2e8f0;
    border-top-color: var(--brand); border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Prose Overrides ===== */
.prose-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--brand); margin: 2rem 0 .75rem; }
.prose-content h3 { font-size: 1.25rem; font-weight: 600; color: var(--dark); margin: 1.5rem 0 .5rem; }
.prose-content p { margin-bottom: 1rem; line-height: 1.8; }
.prose-content ul, .prose-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose-content li { margin-bottom: .5rem; line-height: 1.7; }
.prose-content strong { color: var(--dark); }
.prose-content a { color: var(--brand); text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .process-timeline::before { left: 1.5rem; }
    .timeline-step { padding-left: 3.5rem; }
    .timeline-step .step-dot { left: .75rem; width: 2rem; height: 2rem; font-size: .75rem; }
}

@media (max-width: 639px) {
    .matcher-steps { flex-direction: column; gap: .5rem; align-items: flex-start; }
    .matcher-connector { display: none; }
}

/* ===== Print ===== */
@media print {
    .no-print, nav, footer, .sidebar, .cta-btn { display: none !important; }
    body { color: #000; background: #fff; }
}

/* ===== Alpine x-cloak ===== */
[x-cloak] { display: none !important; }
