:root {
    --paper: #f7f9f8;
    --surface: #fff;
    --ink: #122924;
    --muted: #50665e;
    --line: #d8e3df;
    --accent: #06525c;
    --accent-hover: #043e46;
    --accent-soft: #e1efeb;
    --dark: #152c28;
    --radius: 14px;
    --gutter: clamp(16px, 4vw, 56px);
    --bs-body-font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--ink);
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-link-color-rgb: 6, 82, 92;
    --bs-link-hover-color-rgb: 4, 62, 70;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
.wrap { width: min(calc(100% - 2 * var(--gutter)), 1240px); margin-inline: auto; }
a { text-underline-offset: .22em; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex="0"]:focus-visible {
    outline: 3px solid #14798b;
    outline-offset: 3px;
}
.skip-link { position: absolute; z-index: 5; inset: 8px auto auto 8px; translate: 0 -180%; padding: 10px 16px; background: var(--surface); }
.skip-link:focus { translate: 0; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .navbar { min-height: 72px; padding-block: 8px; gap: 12px clamp(24px, 5vw, 72px); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 1.65rem; font-weight: 750; letter-spacing: -.065em; text-decoration: none; }
.brand-mark { display: inline-block; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); position: relative; }
.brand-mark::before { content: ""; position: absolute; inset: 7px; background: #eefaf1; clip-path: polygon(0 0, 100% 0, 100% 25%, 42% 75%, 100% 75%, 100% 100%, 0 100%, 0 75%, 60% 25%, 0 25%); }
.site-header .nav-link { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; color: var(--muted); border-radius: 8px; }
.site-header .nav-link:hover, .site-header .nav-link[aria-current] { color: var(--accent); background: var(--accent-soft); }
.site-header .nav-link:focus-visible { outline: 3px solid #14798b; outline-offset: 2px; }
.site-header .navbar-toggler { min-width: 44px; min-height: 44px; }
.account-links { margin-inline-start: auto; gap: 8px; }
.site-footer { border-top: 1px solid var(--line); margin-top: auto; color: var(--muted); font-size: .875rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; }

.btn { --bs-btn-border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding-inline: 16px; font-weight: 600; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: .75rem; min-height: 50px; padding-inline: 20px; }
.btn-sm { padding-inline: 12px; }
.btn-primary, .btn-success {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
}
.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: #a8bfba;
    --bs-btn-hover-color: var(--accent-hover);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-border-color: var(--accent);
}

.hero { min-height: calc(100svh - 72px); display: grid; align-items: center; padding-block: clamp(44px, 7vw, 112px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: clamp(24px, 4vw, 64px); }
.hero-copy { padding-top: clamp(30px, 5vw, 72px); }
.m-enter [data-enter] .hero-copy, .m-enter [data-enter] .hero-art { animation: enter .5s ease-out both; }
.m-enter [data-enter] .hero-art { animation-delay: .08s; }
.hero-art { background: radial-gradient(ellipse at 85% 15%, #3e6151, transparent 70%), #1b322c; padding: clamp(16px, 3.4vw, 52px) clamp(14px, 2vw, 34px); border-radius: var(--radius); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.platforms { color: var(--accent); font-family: ui-monospace, Consolas, monospace; font-size: .875rem; letter-spacing: .05em; margin-bottom: 18px; }
.hero h1, .page-head h1 { font-weight: 650; line-height: 1.12; letter-spacing: -.045em; margin: 0; }
.hero h1 { font-size: clamp(2.55rem, 4.8vw, 4.5rem); max-width: 10em; }
.hero-lead { color: var(--muted); font-size: clamp(1rem, 1.55vw, 1.22rem); line-height: 1.8; margin: 22px 0 30px; max-width: 24em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.switcher { overflow: hidden; border-radius: 10px; border: 1px solid #4c645b; background: #101b18; color: #ebf2ee; box-shadow: 0 18px 32px #07171180; }
.switcher-title { display: flex; align-items: center; justify-content: space-between; padding: 12px; font-size: .875rem; border-bottom: 1px solid #31413b; }
.switcher-title span { color: #b0c3b8; font-family: ui-monospace, Consolas, monospace; }
.monitor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.monitor { background: #172320; min-width: 0; border-radius: 5px; overflow: hidden; }
.monitor-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 12px; padding: 6px 8px; font-size: .8125rem; border-top: 2px solid #80be9b; }
.monitor-label small { color: #bdccc4; font-size: .75rem; }
.monitor-program .monitor-label { border-top-color: #ffa761; }
.monitor-picture { position: relative; aspect-ratio: 16 / 10; background-color: #090c0b; }
.outgoing-picture { position: absolute; inset: 0; pointer-events: none; }
.is-stage { background: #291408 url("../images/stage.webp") center / cover; }
.is-bars { background:
    linear-gradient(90deg, #bcbcbc 0 14.28%, #b6ad45 14.28% 28.56%, #4e9c9e 28.56% 42.84%, #4e945f 42.84% 57.12%, #964b88 57.12% 71.4%, #9c4239 71.4% 85.68%, #39498d 85.68%) top / 100% 74% no-repeat,
    linear-gradient(90deg, #202638 0 14.28%, #1e2026 14.28% 28.56%, #4f2f49 28.56% 42.84%, #1e2026 42.84% 57.12%, #354a4a 57.12% 71.4%, #1e2026 71.4% 85.68%, #bcbcbc 85.68%) center 84% / 100% 14% no-repeat,
    linear-gradient(90deg, #202730 0 23%, #ddd 23% 42%, #121619 42% 62%, #242b2b 62% 80%, #000 80%); }
.switcher-controls { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; }
.switcher-status { color: #b8c9c0; margin-right: auto; font-size: .75rem; }
.switcher-controls button { background: #253830; color: #f2fbf5; border: 1px solid #516a5f; border-radius: 6px; padding: 0 10px; min-height: 44px; font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.switcher-controls button:hover { background: #3c574a; }
.switcher-controls button:focus-visible, .admin-sidebar a:focus-visible { outline-color: #bceabe; }

.workflow { display: grid; align-items: center; min-height: 100svh; padding-block: clamp(54px, 8vw, 116px); background: #e8f0ed; border-top: 1px solid var(--line); }
.workflow h2 { margin: 0 0 30px; font-size: clamp(1.65rem, 3vw, 2.55rem); letter-spacing: -.035em; }
.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.workflow article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 28px); }
.signal { height: clamp(98px, 15vw, 215px); border-radius: 8px; margin-bottom: 22px; background: #e1efeb; color: #6ba898; display: flex; align-items: center; justify-content: center; gap: 6px; }
.signal i { display: block; border-radius: 3px; background: currentColor; }
.signal-input i { width: 15%; height: 32%; }
.signal-input i:first-child { opacity: .5; }
.signal-input i:last-child { color: var(--accent); }
.signal-preview i { width: 24%; height: 45%; background: none; border: 2px solid currentColor; }
.signal-preview i:last-child { background: var(--accent); border-color: var(--accent); }
.signal-output { gap: 5px; }
.signal-output i { width: 7%; height: 32%; }
.signal-output i:nth-child(2) { height: 62%; color: var(--accent); }
.signal-output i:nth-child(3) { height: 48%; }
.signal-output i:nth-child(4) { height: 22%; }
.workflow h3, .feature-panel h2, .plan h2 { font-size: 1.2rem; margin: 0 0 12px; font-weight: 650; }
.workflow p, .feature-panel p, .page-head p { color: var(--muted); line-height: 1.75; margin-bottom: 0; }

.page-section { padding-block: clamp(42px, 6vw, 86px); }
.page-head { margin-bottom: clamp(26px, 4vw, 50px); }
.page-head h1 { font-size: clamp(2.25rem, 4.6vw, 4rem); }
.page-head p { margin-top: 14px; font-size: 1.075rem; }
.feature-grid, .pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature-panel, .plan { padding: clamp(20px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feature-panel:first-child { background: var(--accent-soft); }
.protocols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.protocols span { border: 1px solid #a8bfba; padding: 3px 8px; border-radius: 5px; font: .8rem ui-monospace, Consolas, monospace; }
.pricing-grid { max-width: 860px; }
.plan { display: flex; flex-direction: column; align-items: flex-start; }
.plan-vip { background: #e8f1ed; border-color: #a1bfb3; }
.plan-price { margin: 8px 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.2; font-weight: 700; letter-spacing: -.045em; }
.plan-validity { color: var(--muted); margin: 0; }
.plan-list { list-style: none; padding: 0; display: grid; gap: 9px; margin: 22px 0 28px; }
.plan-list li { display: flex; gap: 10px; }
.plan-list li::before { content: ""; flex: 0 0 6px; align-self: center; aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.plan > .btn, .plan > form, .plan > .badge { margin-top: auto; }

.auth-panel { width: min(calc(100% - 2 * var(--gutter)), 480px); margin: clamp(30px, 6vw, 82px) auto; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.auth-panel h1 { font-size: 1.85rem; font-weight: 650; margin-bottom: 24px; }
.form-label { color: var(--ink); font-weight: 600; }
.form-control { min-height: 46px; border-radius: 8px; }
.form-control:focus, .form-check-input:focus { border-color: #14798b; box-shadow: none; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.field-validation-error { display: block; font-size: .875rem; color: #992c37; padding-top: 5px; }
.input-validation-error { border-color: #b1434f; }
.auth-footer { margin: 14px 0 0; color: var(--muted); }

.admin-body { background: #f1f5f3; }
.admin-shell { display: grid; grid-template-columns: 206px minmax(0, 1fr); align-content: start; gap: clamp(18px, 3vw, 38px); flex: 1; padding-block: 28px 44px; }
.admin-sidebar { align-self: start; position: sticky; top: 18px; background: var(--dark); color: #f0f7f3; border-radius: var(--radius); padding: 18px 12px; }
.admin-label { padding: 4px 12px 14px; color: #bdd3c9; font-size: .85rem; font-weight: 600; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar a { color: #e6f2eb; text-decoration: none; border-radius: 7px; padding: 11px 12px; min-height: 44px; }
.admin-sidebar a:hover, .admin-sidebar a[aria-current="page"] { background: #315347; color: #fff; }
.admin-sidebar a[aria-current="page"] { font-weight: 700; box-shadow: inset 3px 0 #a5d8b4; }
.admin-main { padding-top: 4px; }
.admin-head { margin: 0 0 24px; }
.admin-head h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -.04em; font-weight: 650; margin: 0; }
.admin-head p { color: var(--muted); margin: 8px 0 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(12px, 2vw, 22px); }
.metric dt { color: var(--muted); font-size: .875rem; font-weight: 600; }
.metric dd { margin: 10px 0 0; font-size: clamp(1.35rem, 2.8vw, 2.1rem); font-variant-numeric: tabular-nums; letter-spacing: -.05em; overflow-wrap: anywhere; font-weight: 700; }
.admin-section-title { font-size: 1.1rem; font-weight: 650; margin-bottom: 12px; }
.admin-actions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-actions a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 16px; text-decoration: none; padding: 16px 20px; color: var(--ink); }
.admin-actions a:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.admin-actions a:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.admin-actions a + a { border-top: 1px solid var(--line); }
.admin-actions a:hover { background: var(--accent-soft); }
.admin-actions span { grid-column: 1; color: var(--muted); font-size: .875rem; }
.admin-actions b { grid-area: 1 / 2 / span 2; align-self: center; color: var(--accent); }
.data-panel { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.data-panel .table { --bs-table-bg: var(--surface); --bs-table-color: var(--ink); --bs-table-hover-bg: #f2f8f5; margin-bottom: 0; }
.data-panel th, .data-panel td { padding: 12px 16px; vertical-align: middle; }
.data-panel thead th { --bs-table-bg: #e8f0ed; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.data-panel tbody tr:last-child td { border-bottom: 0; }
.cell-code, .cell-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-wrap { overflow-wrap: anywhere; min-width: 100px; max-width: 320px; }
.empty { margin: 0; color: var(--muted); padding: 24px 16px; text-align: center; }
.badge { border-radius: 6px; font-size: .8rem; font-weight: 600; }
.badge.bg-success { background: #dceee0 !important; color: #245637; }
.badge.bg-secondary, .badge.bg-light { background: #e7efeb !important; color: #3e554b !important; }
.badge.bg-warning { background: #f6ead3 !important; color: #6d470f; }
.badge.bg-danger { background: #f8e3e3 !important; color: #872b37; }
.card { --bs-card-border-radius: var(--radius); --bs-card-bg: var(--surface); overflow: hidden; }

@media (max-width: 991.98px) {
    .site-header .navbar-collapse { padding-bottom: 8px; }
    .account-links { margin: 6px 0 0; }
    .account-links .btn { align-self: start; }
    .account-links form button { width: 100%; }
    .admin-shell { grid-template-columns: 156px minmax(0, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .site-header .navbar { min-height: 64px; }
    .hero { min-height: calc(100svh - 64px); }
    .hero-grid, .workflow-grid, .feature-grid, .pricing-grid, .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .hero-copy { padding-top: 0; }
    .hero-art { padding: 18px 12px; }
    .hero-lead { margin: 14px 0 22px; }
    .workflow h2 { margin-bottom: 20px; }
    .workflow-grid { gap: 16px; }
    .admin-shell { padding-block: 16px 34px; }
    .admin-sidebar { position: static; padding: 8px; }
    .admin-label { display: none; }
    .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-sidebar a { text-align: center; padding-inline: 6px; }
    .admin-main .data-panel { overflow: visible; background: transparent; border: 0; }
    .admin-main .table, .admin-main tbody { display: block; }
    .admin-main thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .admin-main tbody { display: grid; gap: 12px; }
    .admin-main tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
    .admin-main .data-panel td { display: block; padding: 0; border: 0; max-width: none; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
    .admin-main .data-panel td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
    .admin-main .data-panel td:first-child, .admin-main .data-panel td[data-label="操作"] { grid-column: 1 / -1; }
    .admin-main .data-panel td[data-label="操作"]:not(:has(form)) { display: none; }
}

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

