:root {
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --sky: #0ea5e9;
    --orange: #f97316;
    --green: #10b981;
    --red: #ef4444;
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --paper: #ffffff;
    --wash: #f6f9fd;
    --panel: rgba(255, 255, 255, 0.88);
    --shadow: 0 18px 45px rgba(37, 99, 235, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    background:
        linear-gradient(135deg, rgba(219, 234, 254, 0.86), rgba(255, 247, 237, 0.82)),
        radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.18), transparent 34%),
        var(--wash);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 28px;
    border-bottom: 1px solid rgba(219, 227, 239, 0.82);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
}

.brand-link,
.ghost-link {
    color: inherit;
    text-decoration: none;
}

.brand-link {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.brand-mark {
    color: var(--blue);
    font-size: 1.25rem;
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

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

.ghost-link,
.ghost-button,
.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-action {
    border: none;
    color: white;
    background: var(--blue);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.primary-action:hover {
    background: #1d4ed8;
}

.ghost-link,
.ghost-button {
    color: var(--blue);
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--line);
}

.primary-action:hover,
.ghost-link:hover,
.ghost-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.full-width {
    width: 100%;
}

.planner-shell {
    display: grid;
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
    gap: 22px;
    width: min(1480px, calc(100% - 40px));
    margin: 24px auto 44px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel-card,
.workspace-section,
.risk-panel {
    border: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.panel-card {
    padding: 20px;
}

.panel-heading h1,
.section-header h2 {
    margin: 4px 0 8px;
    letter-spacing: 0;
}

.panel-heading h1 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.18;
}

.panel-heading p:not(.eyebrow) {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    margin: 0;
    color: var(--orange);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    max-height: 330px;
    overflow: auto;
}

.project-item {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    text-align: left;
    color: var(--ink);
}

.project-item.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.project-item strong {
    display: block;
    margin-bottom: 4px;
}

.project-item span {
    color: var(--muted);
    font-size: 0.86rem;
}

.step-list {
    display: grid;
    gap: 10px;
}

.step-pill {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    font-weight: 800;
}

.step-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 0.78rem;
}

.step-pill.active {
    color: var(--ink);
    border-color: var(--line);
    background: white;
}

.workspace {
    min-width: 0;
}

.usage-guide {
    display: grid;
    grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.45fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid rgba(191, 219, 254, 0.92);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.88)),
        radial-gradient(circle at 92% 10%, rgba(249, 115, 22, 0.12), transparent 28%);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.usage-copy h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.18rem, 2vw, 1.55rem);
}

.usage-copy p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-steps li {
    min-height: 108px;
    padding: 12px;
    border: 1px solid rgba(219, 227, 239, 0.96);
    border-radius: 14px;
    background: white;
}

.guide-steps strong,
.guide-steps span {
    display: block;
}

.guide-steps strong {
    color: var(--blue);
    margin-bottom: 8px;
}

.guide-steps span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.guide-note {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #075985;
    background: #e0f2fe;
    font-size: 0.88rem;
    font-weight: 700;
}

.status-banner {
    margin-bottom: 14px;
    padding: 13px 16px;
    border-radius: 14px;
    color: #064e3b;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    font-weight: 700;
}

.status-banner.error {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #fecaca;
}

.workspace-section {
    display: none;
    padding: 24px;
}

.workspace-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.section-header h2 {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.storage-chip,
.hint-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 8px 11px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.preference-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.switch-card {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.switch-card input {
    width: 18px;
    min-height: 18px;
    margin-right: 10px;
    accent-color: var(--blue);
}

.switch-card span {
    margin: 0;
    color: var(--ink);
}

.numeric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 14px;
}

.route-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(219, 234, 254, 0.42);
}

.compact-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}

.activity-form {
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
}

.data-list {
    display: grid;
    gap: 10px;
}

.assist-box {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.empty-inline {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.62);
}

.data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--blue);
    background: #f8fafc;
}

.icon-button:hover:not(:disabled) {
    border-color: rgba(37, 99, 235, 0.26);
    background: var(--blue-soft);
}

.icon-button:disabled {
    cursor: not-allowed;
    color: #cbd5e1;
    background: #f8fafc;
}

.icon-button.is-active,
.lock-chip {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.lock-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    font-weight: 800;
}

.data-row strong {
    display: block;
    margin-bottom: 5px;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-weight: 700;
}

.source-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 800;
}

.source-link:hover {
    text-decoration: underline;
}

.danger-button {
    border: none;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 10px;
    padding: 9px 11px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.plan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

.timeline {
    display: grid;
    gap: 16px;
}

.day-block {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    overflow: hidden;
}

.day-header {
    padding: 15px 18px;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--sky));
}

.day-header h3 {
    margin: 0 0 4px;
}

.day-header p {
    margin: 0;
    opacity: 0.9;
}

.timeline-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 18px;
    border-top: 1px solid var(--line);
}

.time-range {
    color: var(--blue);
    font-weight: 900;
    font-size: 0.88rem;
}

.timeline-item h4 {
    margin: 0 0 6px;
}

.timeline-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timeline-item p {
    margin: 0 0 8px;
    color: var(--muted);
}

.note-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 12px;
    background: rgba(219, 234, 254, 0.45);
    color: var(--ink);
    font-size: 0.9rem;
}

.route-meta strong {
    color: var(--blue);
}

.route-meta span {
    color: var(--muted);
}

.risk-panel {
    padding: 18px;
    align-self: start;
    position: sticky;
    top: 92px;
}

.risk-panel h3 {
    margin: 0 0 12px;
}

.panel-divider {
    height: 1px;
    margin: 18px 0;
    background: var(--line);
}

.version-list {
    display: grid;
    gap: 10px;
    margin-bottom: 4px;
}

.version-card {
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.version-card.current {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.version-card strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.version-card small {
    color: var(--muted);
    line-height: 1.5;
}

.version-actions {
    display: flex;
    gap: 8px;
}

.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--blue);
    background: #f8fbff;
    font-size: 0.82rem;
    font-weight: 800;
}

.mini-button.restore {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.risk-list {
    display: grid;
    gap: 10px;
}

.risk-item {
    padding: 11px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-size: 0.9rem;
}

.risk-item.tip {
    color: #075985;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 320px;
    padding: 28px;
    border: 1px dashed #b9c7da;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    text-align: center;
}

.empty-state i {
    color: var(--orange);
    font-size: 2.3rem;
}

.empty-state h3 {
    margin: 12px 0 4px;
}

.empty-state p,
.muted {
    color: var(--muted);
}

@media (max-width: 1120px) {
    .planner-shell,
    .plan-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    }

    .risk-panel {
        position: static;
    }

    .compact-form,
    .activity-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .usage-guide,
    .guide-steps {
        grid-template-columns: 1fr;
    }

    .guide-steps li {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    .app-shell-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions > * {
        flex: 1;
    }

    .planner-shell {
        width: calc(100% - 24px);
        margin-top: 14px;
    }

    .side-panel,
    .form-grid,
    .preference-grid,
    .numeric-row,
    .route-settings,
    .compact-form,
    .activity-form {
        grid-template-columns: 1fr;
    }

    .workspace-section {
        padding: 18px;
    }

    .section-header,
    .form-actions,
    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .storage-chip,
    .hint-chip {
        width: fit-content;
    }

    .data-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .usage-guide {
        padding: 16px;
    }
}
