:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --text: #31344f;
    --muted: #7b84a8;
    --line: #e8ecf5;
    --accent: #648ff7;
    --accent-strong: #4f78df;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 18px;
    --shadow: 0 14px 36px rgba(74, 88, 131, 0.12);
    --font: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, #f8faff 0%, #f4f7fd 100%);
    font-family: var(--font);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

code {
    padding: 3px 8px;
    border-radius: 10px;
    background: #eef4ff;
    color: #2d5fd2;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.92em;
}

.shell {
    width: min(1440px, calc(100% - 56px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar-inner,
.section-head,
.dashboard-head,
.page-head,
.panel-head,
.footer-inner,
.two-col {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-inner {
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #83a7ff);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(100, 143, 247, 0.28);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand strong {
    font-size: 1rem;
}

.brand small,
.muted,
.page-intro,
.hero-copy,
.plan-desc,
.section-head p,
.footer-inner {
    color: var(--muted);
}

.nav-links {
    display: inline-flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-strong);
}

.flash-stack {
    padding-top: 16px;
}

.flash {
    margin-bottom: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.flash.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.flash.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.flash.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.hero,
.section {
    padding: 48px 0;
}

.hero {
    padding-top: 56px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 28px;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    margin: 0;
    line-height: 1.7;
}

.hero-copy {
    max-width: 640px;
    font-size: 1.02rem;
}

.hero-actions,
.action-stack,
.table-actions,
.checkbox-row,
.form-actions,
.filter-actions,
.status-stack,
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 26px;
}

.panel,
.hero-panel,
.plan-card,
.metric,
.stat-card,
.quick-link-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel,
.hero-panel {
    padding: 24px;
}

.hero-panel {
    background:
        linear-gradient(180deg, rgba(100, 143, 247, 0.08), rgba(100, 143, 247, 0.02)),
        var(--surface);
}

.hero-preview {
    display: grid;
    gap: 16px;
}

.preview-card {
    padding: 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.preview-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.button {
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(100, 143, 247, 0.24);
}

.button.ghost {
    background: #ffffff;
    color: var(--accent-strong);
    border: 1px solid #cdd9f6;
}

.button.warn {
    background: #fff1f2;
    color: var(--danger);
    border: 1px solid #fecdd3;
}

.button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.section-head,
.page-head,
.panel-head,
.dashboard-head {
    align-items: flex-start;
    margin-bottom: 22px;
}

.narrow {
    max-width: 860px;
}

.plan-grid,
.stats-grid,
.admin-grid,
.dashboard-grid,
.field-grid,
.filter-grid {
    display: grid;
    gap: 18px;
}

.plan-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan-card {
    padding: 24px;
    background:
        radial-gradient(circle at right bottom, rgba(121, 233, 196, 0.18), transparent 26%),
        #ffffff;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    margin: 14px 0 18px;
}

.plan-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.plan-meta dt {
    color: var(--muted);
    font-size: 0.86rem;
}

.plan-meta dd {
    margin: 6px 0 0;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf3ff;
    color: var(--accent-strong);
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.referral-banner,
.callout {
    padding: 18px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #dbe7ff;
}

.order-form,
.lookup-form,
.auth-form,
.stack-form {
    display: grid;
    gap: 16px;
}

.order-form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.lookup-form {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.auth-card,
.order-card {
    display: grid;
    gap: 18px;
}

.field-grid {
    grid-template-columns: 1fr;
}

.two-col-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d8e1f3;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(100, 143, 247, 0.12);
}

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

.inline-check input {
    width: auto;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card,
.metric {
    padding: 22px 24px;
}

.stat-card span,
.metric span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong,
.metric strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.admin-page {
    padding-top: 40px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.admin-nav a {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
}

.admin-nav a.active,
.admin-nav a:hover {
    color: var(--accent-strong);
    background: #edf3ff;
}

.admin-grid-wide {
    grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
    align-items: start;
}

.admin-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.admin-grid-three > .table-panel:last-child {
    grid-column: 1 / -1;
}

.dashboard-stack {
    display: grid;
    gap: 24px;
}

.dashboard-stack .panel {
    padding: 28px;
}

.dashboard-stack .compact-stats {
    margin-bottom: 24px;
}

.dashboard-stack .quick-links {
    gap: 16px;
}

.dashboard-page-head {
    margin-bottom: 34px;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-summary-card {
    padding: 32px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: var(--shadow);
}

.dashboard-summary-card h2 {
    margin: 6px 0 10px;
    font-size: clamp(2.2rem, 3vw, 3rem);
}

.dashboard-summary-card p {
    color: var(--muted);
}

.summary-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    color: var(--muted);
    font-weight: 600;
}

.dashboard-section {
    padding: 34px;
}

.dashboard-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.dashboard-plan-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-plan-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fbfcff;
}

.dashboard-plan-card-wide {
    padding: 28px 30px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.dashboard-plan-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-plan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--muted);
}

.dashboard-plan-meta span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f7ff;
}

.dashboard-plan-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-plan-headline strong {
    font-size: 2.2rem;
    line-height: 1;
}

.dashboard-plan-headline span {
    color: var(--muted);
    font-weight: 600;
}

.dashboard-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-mini-stats-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-mini-stats div {
    padding: 14px 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.dashboard-mini-stats span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.dashboard-mini-stats strong {
    display: block;
    font-size: 1.4rem;
}

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

.card-tools-panel {
    margin-bottom: 24px;
}

.compact-head {
    margin-bottom: 16px;
}

.export-textarea {
    min-height: 150px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.export-details {
    margin-top: 16px;
}

.export-details summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 600;
    margin-bottom: 12px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table thead th {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    background: #f8fbff;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf3ff;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill-muted {
    background: #f1f5f9;
    color: #64748b;
}

.quick-link-card {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
}

.quick-link-card strong {
    font-size: 1rem;
}

.quick-link-card span {
    color: var(--muted);
}

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

.code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

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

.footer {
    margin-top: 32px;
    padding: 24px 0 42px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    flex-wrap: wrap;
}

body.admin-shell {
    background: linear-gradient(180deg, #f9fbff 0%, #f4f7fd 100%);
}

@media (max-width: 1080px) {
    .hero-grid,
    .admin-grid-wide,
    .admin-grid-three,
    .two-col-fields {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-plan-grid-wide,
    .dashboard-mini-stats-wide,
    .dashboard-shortcuts {
        grid-template-columns: 1fr;
    }

    .admin-grid-three > .table-panel:last-child {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 20px, 1200px);
    }

    .topbar-inner,
    .section-head,
    .page-head,
    .panel-head,
    .footer-inner,
    .two-col {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions,
    .form-actions,
    .filter-actions,
    .table-actions,
    .action-stack {
        flex-direction: column;
        align-items: stretch;
    }

    .lookup-form,
    .order-form,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-shortcuts,
    .dashboard-mini-stats {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 14px;
        justify-content: flex-start;
    }
}
