/* ==========================================
   AI定制智能体平台
   Design: impeccable rules + Micro SaaS palette
   ========================================== */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #DBEAFE;
    --accent: #059669;
    --destructive: #DC2626;
    --warning: #D97706;

    --background: #F8FAFC;
    --foreground: #0F172A;
    --card: #FFFFFF;
    --muted: #F1F5F9;
    --muted-fg: #475569;
    --border: #E2E8F0;
    --input: #F1F5F9;

    --radius: 10px;
    --radius-sm: 6px;

    /* impeccable: ease-out-quart */
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    --dur: 200ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
    background: var(--background); color: var(--foreground);
    line-height: 1.6; font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
/* impeccable: text-wrap balance on headings */
h1, h2, h3 { text-wrap: balance; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* impeccable: reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* === Layout === */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* === Navbar === */
.navbar {
    background: var(--card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.logo { font-size: 0.9375rem; font-weight: 700; color: var(--foreground); letter-spacing: -0.01em; }
.logo:hover { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
    color: var(--muted-fg); font-size: 0.8125rem; padding: 5px 12px;
    border-radius: var(--radius-sm); transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--foreground); background: var(--muted); }
.nav-toggle { display: none; background: none; border: none; color: var(--foreground); font-size: 1.125rem; cursor: pointer; padding: 8px; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.8125rem;
    font-weight: 500; cursor: pointer; border: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform 100ms ease;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-outline { background: transparent; color: var(--muted-fg); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--foreground); border-color: #94A3B8; background: var(--card); }
.btn-success { background: var(--accent); color: white; }
.btn-success:hover { background: #047857; color: white; }
.btn-danger { background: var(--destructive); color: white; }
.btn-danger:hover { background: #B91C1C; color: white; }
.btn-lg { padding: 11px 24px; font-size: 0.875rem; }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* === Hero === */
/* impeccable: no hero-metric template, no gradient text */
.hero { padding: 64px 0 48px; text-align: center; background: var(--primary-light); }
.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700;
    letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 10px;
    color: var(--foreground);
}
.hero-subtitle {
    font-size: 1rem; color: var(--muted-fg); margin-bottom: 24px;
    max-width: 480px; margin-left: auto; margin-right: auto; line-height: 1.5;
}
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 40px; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; font-weight: 700; color: var(--foreground); }
.hero-stat span { font-size: 0.75rem; color: var(--muted-fg); }

/* === Sections === */
.section { padding: 48px 0; }
.section-alt { background: var(--card); }
.section-title { font-size: 1.375rem; font-weight: 700; text-align: center; margin-bottom: 4px; letter-spacing: -0.02em; }
.section-subtitle { text-align: center; color: var(--muted-fg); margin-bottom: 32px; font-size: 0.875rem; }

/* === Feature Cards === */
/* impeccable: no identical card grids - vary the layout */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feature-card { background: var(--card); padding: 24px; transition: background var(--dur) var(--ease); }
.feature-card:hover { background: var(--muted); }
.feature-card h3 { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
.feature-card p { font-size: 0.8125rem; color: var(--muted-fg); line-height: 1.5; }

/* === Steps === */
.steps { display: flex; align-items: flex-start; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--card); padding: 24px 16px; text-align: center; flex: 1; }
.step-num {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 600; margin: 0 auto 10px; font-size: 0.8125rem;
}
.step h3 { font-size: 0.875rem; margin-bottom: 3px; }
.step p { font-size: 0.75rem; color: var(--muted-fg); }

/* === Cards === */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.card-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 0.875rem; font-weight: 600; }
.card-body { padding: 16px; }

/* === Forms === */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 500; margin-bottom: 4px; color: var(--muted-fg); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 8px 10px; background: var(--input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--foreground); font-size: 0.8125rem;
    transition: border-color var(--dur) var(--ease);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #94A3B8; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }

/* === Auth === */
.auth-page { min-height: calc(100vh - 84px); display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 380px; }
.auth-card h2 { text-align: center; font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-desc { text-align: center; color: var(--muted-fg); font-size: 0.8125rem; margin-bottom: 22px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 0.75rem; color: var(--muted-fg); }
.auth-footer a { font-weight: 500; }
.auth-card .btn-block { margin-top: 4px; padding: 9px; }

/* === Alert === */
.alert { padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 0.8125rem; display: flex; align-items: center; justify-content: space-between; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-close { background: none; border: none; color: inherit; font-size: 1rem; cursor: pointer; opacity: 0.5; padding: 2px 6px; }
.alert-close:hover { opacity: 1; }

/* === Status Badge === */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.6875rem; font-weight: 500; }
.status-pending_consult, .status-pending_consulting { background: #FEF3C7; color: #92400E; }
.status-consulting { background: #EDE9FE; color: #6D28D9; }
.status-pending_quote { background: #CFFAFE; color: #0E7490; }
.status-quoted { background: #F3E8FF; color: #7C3AED; }
.status-confirmed { background: #D1FAE5; color: #065F46; }
.status-in_progress { background: #DBEAFE; color: #1D4ED8; }
.status-pending_review { background: #FEF3C7; color: #92400E; }
.status-completed { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }

/* === Table === */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
th { color: var(--muted-fg); font-weight: 500; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr { transition: background var(--dur) var(--ease); }
tr:hover { background: var(--muted); }

/* === Page Header === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }

/* === Detail Grid === */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.detail-sidebar .card { position: sticky; top: 68px; }

/* === Info Grid === */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.info-grid div { font-size: 0.75rem; color: var(--muted-fg); }

/* === Stats === */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-card .stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.6875rem; color: var(--muted-fg); margin-top: 2px; }

/* === Messages === */
.message-list { max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.message-item { padding: 9px 11px; border-radius: var(--radius-sm); margin-bottom: 5px; font-size: 0.8125rem; }
.message-admin { background: #EFF6FF; }
.message-client { background: #ECFEFF; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 2px; font-size: 0.6875rem; }
.message-header strong { color: var(--foreground); }
.message-header span { color: var(--muted-fg); }
.message-item p { color: var(--muted-fg); white-space: pre-wrap; line-height: 1.5; }
.message-form textarea { resize: vertical; min-height: 64px; }

/* === Files === */
.file-list { display: flex; flex-direction: column; gap: 5px; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--muted); border-radius: var(--radius-sm); }
.file-item span { font-size: 0.75rem; }

/* === Status Flow === */
.status-flow { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.flow-item { padding: 4px 8px; border-radius: 3px; font-size: 0.625rem; background: var(--muted); color: var(--muted-fg); }
.flow-item.active { background: var(--primary); color: white; }
.flow-arrow { color: var(--muted-fg); font-size: 0.6875rem; }

/* === Template Grid === */
.steps-bar { display: flex; align-items: center; justify-content: center; margin: 18px 0 24px; }
.step-item { display: flex; align-items: center; gap: 5px; padding: 5px 12px; color: var(--muted-fg); font-size: 0.8125rem; }
.step-item.active { color: var(--primary); font-weight: 600; }
.step-item.done { color: var(--accent); }
.step-item span { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--muted); font-size: 0.6875rem; border: 1px solid var(--border); }
.step-item.active span { background: var(--primary); color: white; border-color: var(--primary); }
.step-item.done span { background: var(--accent); color: white; border-color: var(--accent); }
.step-line { width: 28px; height: 1px; background: var(--border); }
.category-section { margin-bottom: 18px; }
.category-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.template-card { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); background: var(--card); }
.template-card:hover { border-color: #94A3B8; }
.template-card.selected { border-color: var(--primary); background: var(--primary-light); }
.template-card h4 { margin-bottom: 2px; font-size: 0.8125rem; font-weight: 600; }
.template-card p { font-size: 0.6875rem; color: var(--muted-fg); margin-bottom: 5px; line-height: 1.4; }
.template-platforms { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 5px; }
.platform-tag { font-size: 0.625rem; background: var(--muted); color: var(--muted-fg); padding: 1px 5px; border-radius: 3px; }
.template-meta { display: flex; gap: 5px; align-items: center; }
.template-budget { font-size: 0.625rem; color: var(--primary); background: var(--primary-light); padding: 1px 5px; border-radius: 3px; }
.template-days { font-size: 0.625rem; color: var(--accent); background: #ECFDF5; padding: 1px 5px; border-radius: 3px; }

/* === Review === */
.review-box { background: var(--muted); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }

/* === Tabs === */
.tabs { display: flex; gap: 1px; margin-bottom: 16px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tab { padding: 7px 14px; color: var(--muted-fg); font-size: 0.8125rem; cursor: pointer; border: none; background: var(--card); transition: background var(--dur) var(--ease); }
.tab:hover { background: var(--muted); }
.tab.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

/* === Pagination === */
.pagination { display: flex; gap: 2px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span { padding: 5px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; }
.pagination a { background: var(--card); border: 1px solid var(--border); color: var(--muted-fg); }
.pagination a:hover { background: var(--muted); color: var(--foreground); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* === Chat === */
.chat-container { max-width: 680px; margin: 0 auto; }
.chat-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.chat-header-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.75rem; font-weight: 600; }
.chat-header-info h3 { font-size: 0.875rem; }
.chat-header-info p { font-size: 0.6875rem; color: var(--muted-fg); }
.chat-messages { background: var(--background); border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 16px; min-height: 320px; max-height: 400px; overflow-y: auto; }
.chat-msg { display: flex; gap: 7px; margin-bottom: 12px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; flex-shrink: 0; font-weight: 600; color: white; }
.chat-msg.bot .chat-msg-avatar { background: var(--primary); }
.chat-msg.user .chat-msg-avatar { background: #0891B2; }
.chat-msg-bubble { max-width: 70%; padding: 9px 12px; border-radius: var(--radius); font-size: 0.8125rem; line-height: 1.5; }
.chat-msg.bot .chat-msg-bubble { background: var(--card); border: 1px solid var(--border); }
.chat-msg.user .chat-msg-bubble { background: var(--primary); color: white; }
.chat-input { display: flex; gap: 6px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.chat-input input { flex: 1; padding: 8px 12px; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--foreground); font-size: 0.8125rem; }
.chat-input input:focus { outline: none; border-color: var(--primary); }

/* === Main === */
.main-content { min-height: calc(100vh - 84px); }

/* === Footer === */
.footer { padding: 18px 0; text-align: center; color: var(--muted-fg); font-size: 0.6875rem; border-top: 1px solid var(--border); }

/* === Utilities === */
pre { background: var(--muted); padding: 8px; border-radius: var(--radius-sm); font-size: 0.75rem; overflow-x: auto; border: 1px solid var(--border); }



/* === Scenario Box === */
.scenario-box { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.scenario-box h4 { font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: #92400E; }
.scenario-box ul { list-style: none; padding: 0; }
.scenario-box li { font-size: 0.75rem; color: #78350F; padding: 3px 0; padding-left: 14px; position: relative; line-height: 1.5; }
.scenario-box li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #F59E0B; }
.case-desc { font-size: 0.8125rem; color: var(--muted-fg); margin-bottom: 10px; line-height: 1.5; }


/* === Case Cards === */
.case-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.case-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color var(--dur) var(--ease); }
.case-card:hover { border-color: var(--primary); }
.case-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.case-tag { padding: 2px 8px; background: var(--muted); border-radius: 3px; font-size: 0.6875rem; color: var(--muted-fg); }
.case-result { padding: 2px 8px; background: #ECFDF5; color: #065F46; border-radius: 3px; font-size: 0.6875rem; font-weight: 500; }
.case-card h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 6px; }
.case-problem { font-size: 0.8125rem; color: var(--muted-fg); margin-bottom: 8px; line-height: 1.5; }
.case-solution { font-size: 0.8125rem; background: var(--primary-light); padding: 10px 12px; border-radius: 6px; margin-bottom: 10px; line-height: 1.5; }
.case-solution strong { color: var(--primary); }
.case-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.case-stats span { padding: 3px 8px; background: var(--muted); border-radius: 3px; font-size: 0.6875rem; color: var(--foreground); }




/* === About === */
.about-text { max-width: 720px; margin: 0 auto; text-align: center; }
.about-text p { font-size: 0.9375rem; color: var(--muted-fg); line-height: 1.7; margin-bottom: 8px; }


/* === Pain Points === */
.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pain-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color var(--dur) var(--ease); }
.pain-card:hover { border-color: #F87171; }
.pain-icon { width: 28px; height: 28px; border-radius: 50%; background: #FEE2E2; color: #DC2626; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; margin-bottom: 8px; }
.pain-card h3 { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; }
.pain-card p { font-size: 0.75rem; color: var(--muted-fg); line-height: 1.5; }

/* === Case Cards === */
.case-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.case-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color var(--dur) var(--ease); }
.case-card:hover { border-color: var(--primary); }
.case-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.case-tag { padding: 2px 8px; background: var(--muted); border-radius: 3px; font-size: 0.6875rem; color: var(--muted-fg); }
.case-result { padding: 2px 8px; background: #ECFDF5; color: #065F46; border-radius: 3px; font-size: 0.6875rem; font-weight: 500; }
.case-card h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 8px; }
.case-scenario { font-size: 0.8125rem; background: #FFF7ED; padding: 10px 12px; border-radius: 6px; margin-bottom: 8px; line-height: 1.5; border-left: 3px solid #F59E0B; }
.case-solution { font-size: 0.8125rem; background: var(--primary-light); padding: 10px 12px; border-radius: 6px; margin-bottom: 10px; line-height: 1.5; }
.case-solution strong { color: var(--primary); }
.case-before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.before, .after { padding: 8px 10px; border-radius: 6px; font-size: 0.6875rem; line-height: 1.4; }
.before { background: #FEF2F2; color: #991B1B; }
.after { background: #ECFDF5; color: #065F46; }
.case-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.case-stats span { padding: 3px 8px; background: var(--muted); border-radius: 3px; font-size: 0.6875rem; color: var(--foreground); }


/* === Responsive === */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 52px; left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .hero h1 { font-size: 1.5rem; }
    .features-grid { grid-template-columns: 1fr; }
    .steps { flex-direction: column; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar .card { position: static; }
    .form-row { flex-direction: column; gap: 0; }
    .info-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .template-grid { grid-template-columns: 1fr; }
    .steps-bar { flex-wrap: wrap; }
    .step-line { display: none; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .hero { padding: 40px 0 32px; }
    .hero h1 { font-size: 1.25rem; }
    .hero-stats { flex-direction: column; gap: 10px; }
    .stats-row { grid-template-columns: 1fr; }
}
