/* ========================================
   Plans Page - GEO 方案生成器
   ======================================== */

.plan-page {
    max-width: 80rem;
}

.plan-page h1,
.plan-page h2,
.plan-page h3,
.plan-page p,
.plan-page label,
.plan-page button,
.plan-page input,
.plan-page textarea,
.plan-page select {
    letter-spacing: 0 !important;
}

.plan-hero h1 {
    line-height: 1.18;
}

.plan-hero-card {
    align-self: stretch;
}

.plan-layout {
    align-items: start;
}

.plan-form {
    overflow: hidden;
}

.plan-section {
    padding: 1.35rem 1.45rem;
    border-bottom: 1px solid #f1f5f9;
}

.plan-section:last-of-type {
    border-bottom: 0;
}

.plan-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.plan-section-header > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 900;
}

.plan-section-header h2 {
    margin: 0;
    color: #0f172a;
    font-family: Manrope, Inter, sans-serif;
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.35;
}

.plan-section-header h2 strong {
    margin-left: 0.4rem;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
}

.plan-section-header p {
    margin: 0.18rem 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.55;
}

.plan-field {
    display: grid;
    gap: 0.45rem;
}

.plan-field > span {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 850;
    line-height: 1.35;
}

.plan-field strong {
    margin-left: 0.35rem;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
}

.plan-field input,
.plan-field textarea,
.plan-field select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.82rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.92rem !important;
    line-height: 1.55;
    padding: 0.78rem 0.95rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.plan-field input,
.plan-field select {
    min-height: 2.85rem;
}

.plan-field textarea {
    min-height: 5.8rem;
    resize: vertical;
}

.plan-field input::placeholder,
.plan-field textarea::placeholder {
    color: #94a3b8;
}

.plan-field input:focus,
.plan-field textarea:focus,
.plan-field select:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.plan-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.plan-checkbox-grid label {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.74rem 0.9rem 0.74rem 2.85rem;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 800;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.plan-checkbox-grid input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.plan-checkbox-grid label::before {
    content: '';
    position: absolute;
    left: 0.9rem;
    top: 50%;
    width: 1.28rem;
    height: 1.28rem;
    transform: translateY(-50%);
    border: 1.5px solid #cbd5e1;
    border-radius: 0.45rem;
    background: #ffffff;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.plan-checkbox-grid label::after {
    content: 'check';
    position: absolute;
    left: 0.9rem;
    top: 50%;
    width: 1.28rem;
    height: 1.28rem;
    transform: translateY(-50%);
    color: #ffffff;
    font-family: 'Material Symbols Outlined';
    font-size: 1rem;
    font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 20;
    line-height: 1.28rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.plan-checkbox-grid label:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.plan-checkbox-grid label:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.45);
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.plan-checkbox-grid label:has(input:checked)::before {
    border-color: #2563eb;
    background: #2563eb;
}

.plan-checkbox-grid label:has(input:checked)::after {
    opacity: 1;
}

.plan-scope-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.72rem 0.82rem;
}

.plan-scope-item span {
    color: #2563eb;
    font-size: 1rem;
}

.plan-scope-item p {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
}

#plan-checklist li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 800;
}

#plan-checklist li.is-done {
    color: #0f766e;
}

#plan-checklist li .material-symbols-outlined {
    font-size: 1rem;
}

#plan-checklist li.is-done .material-symbols-outlined {
    color: #10b981;
}

.plan-side {
    position: sticky;
    top: 5.5rem;
}

.plan-action-row {
    padding: 1rem 1.45rem;
    background: #ffffff;
}

.plan-actions .btn {
    min-height: 2.65rem;
}

#plan-generate-btn {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

#plan-result-panel.is-loading {
    border-color: #dbeafe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.plan-loading-shell {
    display: grid;
    gap: 1rem;
}

.plan-loading-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #eff6ff;
    padding: 1rem;
}

.plan-loading-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
    animation: planPulse 1.6s ease-in-out infinite;
}

.plan-loading-spinner span {
    font-size: 1.25rem;
}

.plan-loading-eyebrow {
    margin: 0;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.plan-loading-header h3 {
    margin: 0.2rem 0 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.35;
}

.plan-loading-header p:last-child {
    margin: 0.22rem 0 0;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.65;
}

.plan-loading-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.plan-loading-step {
    min-height: 4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 0.7rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.plan-loading-step span {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 900;
}

.plan-loading-step p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

.plan-loading-step.is-active {
    border-color: rgba(37, 99, 235, 0.35);
    background: #eff6ff;
    transform: translateY(-1px);
}

.plan-loading-step.is-active span,
.plan-loading-step.is-active p {
    color: #1d4ed8;
}

.plan-loading-step.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.plan-loading-step.is-done span,
.plan-loading-step.is-done p {
    color: #047857;
}

.plan-loading-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.plan-loading-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.plan-loading-card.is-active {
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: 0 16px 42px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.plan-loading-card.is-done {
    border-color: #bbf7d0;
}

.plan-loading-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.plan-loading-card-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.05rem;
}

.plan-loading-card h4 {
    margin: 0;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.35;
}

.plan-loading-card p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.55;
}

.plan-loading-lines {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.95rem;
}

.plan-shimmer {
    display: block;
    height: 0.58rem;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0 0%, #f8fafc 45%, #dbeafe 70%, #e2e8f0 100%);
    background-size: 220% 100%;
    animation: planShimmer 1.35s ease-in-out infinite;
}

@keyframes planShimmer {
    0% {
        background-position: 120% 0;
    }
    100% {
        background-position: -120% 0;
    }
}

@keyframes planPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 0 0 0 rgba(37, 99, 235, 0.18);
    }
    50% {
        transform: scale(1.03);
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18), 0 0 0 8px rgba(37, 99, 235, 0.06);
    }
}

.plan-markdown {
    color: #334155;
    font-size: 15px;
    line-height: 1.9;
}

.plan-markdown > *:first-child {
    margin-top: 0;
}

.plan-markdown h1,
.plan-markdown h2,
.plan-markdown h3,
.plan-markdown h4 {
    color: #0f172a;
    font-family: Manrope, Inter, sans-serif;
    font-weight: 850;
    line-height: 1.3;
    margin: 1.5em 0 0.65em;
}

.plan-markdown h1 {
    font-size: 1.75rem;
}

.plan-markdown h2 {
    font-size: 1.35rem;
}

.plan-markdown h3 {
    font-size: 1.08rem;
}

.plan-markdown p,
.plan-markdown ul,
.plan-markdown ol,
.plan-markdown blockquote,
.plan-markdown pre,
.plan-markdown table {
    margin: 0.85em 0;
}

.plan-markdown ul,
.plan-markdown ol {
    padding-left: 1.3rem;
}

.plan-markdown li {
    margin: 0.35em 0;
}

.plan-markdown strong {
    color: #0f172a;
}

.plan-markdown blockquote {
    border-left: 3px solid #2563eb;
    border-radius: 0 1rem 1rem 0;
    background: #eff6ff;
    color: #1e3a8a;
    padding: 0.9rem 1rem;
}

.plan-markdown table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.plan-markdown th,
.plan-markdown td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0.85rem;
    text-align: left;
    vertical-align: top;
}

.plan-markdown thead {
    background: #f8fafc;
}

.plan-markdown code {
    border-radius: 0.35rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em;
    padding: 0.14rem 0.3rem;
}

.plan-markdown pre {
    overflow-x: auto;
    border-radius: 1rem;
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
}

.plan-markdown pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.plan-company-card {
    display: block;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #ffffff;
    padding: 0.9rem 1rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.plan-company-card:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
}

@media (max-width: 1023px) {
    .plan-side {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-loading-progress {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .plan-section {
        padding: 1.1rem;
    }

    .plan-section-header {
        gap: 0.65rem;
    }

    .plan-checkbox-grid,
    .plan-side {
        grid-template-columns: 1fr;
    }

    .plan-actions {
        width: 100%;
    }

    .plan-actions .btn {
        flex: 1;
    }

    .plan-loading-header,
    .plan-loading-card-head {
        flex-direction: column;
    }

    .plan-loading-grid,
    .plan-loading-progress {
        grid-template-columns: 1fr;
    }
}

@media print {
    #header-container,
    #footer-container,
    #geo-plan-form,
    main > section:first-child,
    main > section:nth-child(2) > aside,
    #plan-copy-btn,
    #plan-export-btn,
    #plan-open-chat {
        display: none !important;
    }

    body {
        opacity: 1 !important;
        background: #ffffff !important;
    }

    #plan-result-panel {
        display: block !important;
        border: 0 !important;
        box-shadow: none !important;
    }
}
