/* ==========================================================================
   CSharpWasmDemo · 样式表
   纯手写 CSS，无第三方框架依赖。
   ========================================================================== */

:root {
    --bg: #f6f8fc;
    --bg-grid: rgba(15, 23, 42, 0.035);
    --surface: #ffffff;
    --surface-soft: #f8fafd;
    --ink: #0d1526;
    --ink-2: #3f4c63;
    --muted: #7b8798;
    --line: #e3e9f2;
    --line-strong: #cfd8e6;
    --accent: #4f46e5;
    --accent-soft: #eef0ff;
    --accent-2: #0e9bb5;
    --ok: #0f7a5a;
    --bad: #b42318;
    --warn: #b45309;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(13, 21, 38, 0.04), 0 18px 40px -28px rgba(13, 21, 38, 0.45);
    --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--ink);
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

p {
    margin: 0;
}

code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 0.12em 0.42em;
    border-radius: 6px;
    background: #eef2f9;
    color: #2b3a55;
    white-space: nowrap;
}

.mono {
    font-family: var(--mono);
    font-variant-ligatures: none;
}

.good {
    color: var(--ok);
}

.bad {
    color: var(--bad);
}

/* ------------------------------ 布局骨架 ------------------------------ */

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px clamp(16px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(140deg, #4f46e5, #0e9bb5);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.03em;
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.8);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand-text b {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

.topnav {
    display: flex;
    gap: 2px;
    margin-left: auto;
    flex-wrap: wrap;
}

.navlink {
    border: 0;
    background: none;
    color: var(--ink-2);
    font: inherit;
    font-size: 14px;
    padding: 7px 11px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.navlink:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.topbar-tag {
    flex: none;
    font-size: 11.5px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--surface-soft);
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 32px) 72px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px clamp(16px, 4vw, 40px) 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* ------------------------------ Hero ------------------------------ */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid #dfe6f5;
    border-radius: 26px;
    background:
        radial-gradient(760px 320px at 12% -10%, #e5e9ff 0%, rgba(229, 233, 255, 0) 62%),
        radial-gradient(620px 300px at 96% 4%, #dff5fb 0%, rgba(223, 245, 251, 0) 58%),
        linear-gradient(180deg, #ffffff, #fbfcff);
    box-shadow: var(--shadow);
}

.pill {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: rgba(79, 70, 229, 0.09);
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 999px;
    padding: 5px 13px;
}

.hero h1 {
    margin: 18px 0 0;
    font-size: clamp(34px, 5.4vw, 54px);
    font-weight: 700;
}

.grad {
    background: linear-gradient(120deg, #4f46e5 10%, #0e9bb5 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    margin-top: 16px;
    max-width: 62ch;
    color: var(--ink-2);
    font-size: clamp(15px, 1.6vw, 17px);
}

.hero-lead b {
    color: var(--ink);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.hero-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 30px 0 0;
    padding-top: 22px;
    border-top: 1px dashed var(--line-strong);
}

.hero-facts div {
    min-width: 0;
}

.hero-facts dt {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-facts dd {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 650;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------ 通用控件 ------------------------------ */

.btn {
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 18px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: progress;
}

.btn-primary {
    background: linear-gradient(140deg, #5347ea, #3f36d6);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.95);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 14px 26px -14px rgba(79, 70, 229, 0.95);
}

.btn-ghost {
    background: #fff;
    color: var(--ink-2);
    border-color: var(--line-strong);
}

.btn-ghost:hover:not(:disabled) {
    border-color: #b9c6db;
    color: var(--ink);
}

.input {
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    padding: 10px 13px;
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.input-sm {
    width: 110px;
}

select.input {
    cursor: pointer;
}

input[type="range"] {
    accent-color: var(--accent);
    width: 190px;
}

.field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-2);
    font-size: 14px;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.chip {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--ink-2);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip:hover {
    color: var(--accent);
    border-color: #c7c9f7;
    background: var(--accent-soft);
}

/* ------------------------------ 章节 / 卡片 ------------------------------ */

.section {
    margin-top: clamp(44px, 6vw, 72px);
    scroll-margin-top: 90px;
}

.section-head {
    margin-bottom: 18px;
}

.section-head h2 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: clamp(21px, 2.6vw, 27px);
    font-weight: 700;
}

.section-head .num {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 7px;
    padding: 3px 8px;
    letter-spacing: 0.04em;
}

.section-head p {
    margin-top: 8px;
    max-width: 78ch;
    color: var(--ink-2);
    font-size: 14.5px;
}

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

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

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

.grid-2 + .grid-2 {
    margin-top: 16px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.card-value {
    font-size: clamp(17px, 2vw, 21px);
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -0.01em;
    word-break: break-word;
}

.kv {
    list-style: none;
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 7px;
    font-size: 13.5px;
}

.kv li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: baseline;
}

.kv span {
    color: var(--muted);
    flex: none;
}

.kv b {
    font-weight: 550;
    color: var(--ink);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-card {
    margin-top: 4px;
}

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

.row.wrap {
    flex-wrap: wrap;
}

.row.between {
    justify-content: space-between;
    margin-top: 12px;
}

.row > .input {
    flex: 1;
}

.hint {
    font-size: 13px;
    color: var(--muted);
}

.badge-num {
    font-size: 13px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 10px;
}

/* ------------------------------ 流程图 ------------------------------ */

.flow {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fbfdff, #f4f8ff);
    overflow-x: auto;
}

.flow-step {
    flex: 1 1 0;
    min-width: 148px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.flow-step b {
    font-size: 13.5px;
}

.flow-step span {
    font-size: 11.5px;
    color: var(--muted);
    font-family: var(--mono);
}

.flow-arrow {
    align-self: center;
    color: #b4c1d6;
    font-size: 18px;
    flex: none;
}

/* ------------------------------ 计算器 ------------------------------ */

.result {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #f7f9ff, #f2f6fd);
    border: 1px solid #e2e9f6;
}

.result-value {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #1b2a4a;
    word-break: break-all;
}

.result-meta {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--muted);
}

.token {
    display: inline-block;
    margin: 4px 4px 0 0;
    padding: 2px 8px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 12px;
}

.result-error {
    background: #fff7f6;
    border-color: #f6d5d1;
}

.result-error .result-value {
    font-size: 15px;
    font-weight: 550;
    color: var(--bad);
}

/* ------------------------------ 性能基准 ------------------------------ */

.bars {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 88px;
    align-items: center;
    gap: 12px;
}

.bar-name {
    font-size: 13px;
    color: var(--ink-2);
    font-weight: 600;
}

.bar-track {
    height: 12px;
    border-radius: 999px;
    background: #eef2f9;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 2px;
}

.bar-cs {
    background: linear-gradient(90deg, #5b52ea, #0e9bb5);
}

.bar-js {
    background: #b3bfd2;
}

.bar-ms {
    text-align: right;
    font-size: 13px;
    color: var(--ink);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mini span {
    font-size: 11.5px;
    color: var(--muted);
}

.mini b {
    font-size: 15px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------ 大整数 ------------------------------ */

.result-block {
    margin: 16px 0 0;
    padding: 16px 18px;
    max-height: 200px;
    overflow: auto;
    background: #f8fafd;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.7;
    color: #23324b;
    white-space: pre-wrap;
    word-break: break-all;
}

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

.compare-item {
    border: 1px solid #d9ecdf;
    background: #f6fdf9;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    min-width: 0;
}

.compare-item.bad-side {
    border-color: #f3dcd8;
    background: #fffaf9;
}

.compare-head {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ok);
    margin-bottom: 4px;
}

.bad-side .compare-head {
    color: var(--bad);
}

.compare-body {
    font-size: 13px;
    color: var(--ink);
    word-break: break-all;
}

/* ------------------------------ 待办 ------------------------------ */

.todo-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

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

.todo.done {
    background: #f4fbf7;
    border-color: #dcefe3;
}

.todo-check {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid var(--line-strong);
    background: #fff;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
}

.todo.done .todo-check {
    background: var(--ok);
    border-color: var(--ok);
}

.todo-text {
    flex: 1;
    font-size: 14.5px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.todo.done .todo-text {
    color: var(--muted);
    text-decoration: line-through;
}

.todo-del {
    flex: none;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.todo-del:hover {
    background: #fdecea;
    color: var(--bad);
}

/* ------------------------------ 代码 / 结构 ------------------------------ */

.tree,
.code {
    margin: 0;
    padding: 14px 16px;
    background: #fafbfe;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 12.4px;
    line-height: 1.75;
    color: #22304a;
    overflow-x: auto;
    white-space: pre;
}

.code {
    white-space: pre;
    max-height: 340px;
    overflow-y: auto;
}

.code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    white-space: pre;
}

pre.mono:not(.tree):not(.code):not(.result-block) {
    margin: 0;
}

.note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--ink-2);
}

.note code {
    white-space: normal;
}

/* ------------------------------ 加载 / 错误 ------------------------------ */

.loading-progress {
    position: absolute;
    display: block;
    width: 7rem;
    height: 7rem;
    inset: 26vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e4eaf5;
    stroke-width: 0.55rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #4f46e5;
    stroke-linecap: round;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.06s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: calc(26vh + 2.9rem) 0 auto 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-2);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "加载中");
}

.loading-note {
    position: absolute;
    inset: calc(26vh + 5.2rem) 16px auto 16px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff6f5;
    border-top: 1px solid #f5d4d0;
    color: var(--bad);
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(13, 21, 38, 0.08);
    display: none;
    left: 0;
    padding: 0.7rem 1.2rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

#blazor-error-ui .reload {
    color: var(--accent);
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.9rem;
    top: 0.5rem;
    font-size: 18px;
}

.blazor-error-boundary {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    background: #b42318;
    color: #fff;
}

.blazor-error-boundary::after {
    content: "发生错误。";
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--bad);
}

.validation-message {
    color: var(--bad);
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 980px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .topbar-tag {
        display: none;
    }
}

@media (max-width: 760px) {
    .grid-2,
    .compare {
        grid-template-columns: 1fr;
    }

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

    .topnav {
        display: none;
    }

    .bar-row {
        grid-template-columns: 76px minmax(0, 1fr) 74px;
        gap: 8px;
    }

    .flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
        align-self: flex-start;
        margin-left: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .bar {
        transition: none;
    }
}

/* ------------------------------ 交互绘图页 ------------------------------ */

.navlink-draw {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--accent);
}

.navlink-draw::after {
    content: "↗";
    font-size: 12px;
    opacity: 0.7;
}

.navlink.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.back-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

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

kbd {
    font-family: var(--mono);
    font-size: 0.85em;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    background: #fff;
    color: var(--ink-2);
    white-space: nowrap;
}

.draw-card {
    padding: 0;
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sep {
    width: 1px;
    height: 22px;
    background: var(--line);
    flex: none;
}

.tool {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tool:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.tool.active {
    background: var(--accent-soft);
    border-color: #c8c6f8;
    color: var(--accent);
}

.tool-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line-strong);
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.swatch:hover {
    transform: scale(1.1);
}

.swatch.active {
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--accent);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
}

.check input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: 7px 13px;
    font-size: 13.5px;
    border-radius: 9px;
}

.draw-canvas {
    position: relative;
    background: #fff;
    outline: none;
    user-select: none;
}

.draw-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.35);
}

.draw-svg {
    display: block;
    width: 100%;
    aspect-ratio: 1000 / 640;
    cursor: crosshair;
    touch-action: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
    background-size: 25px 25px;
}

.draw-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 4px;
    text-align: center;
    pointer-events: none;
    color: var(--muted);
}

.draw-empty b {
    font-size: 15px;
    color: var(--ink-2);
}

.draw-empty span {
    font-size: 12.5px;
}

.draw-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 12.5px;
    color: var(--muted);
}

.draw-status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 720px) {
    .toolbar {
        gap: 8px;
        padding: 10px;
    }

    .tool span {
        display: none;
    }

    .sep {
        display: none;
    }

    .draw-status {
        font-size: 11.5px;
    }
}

.teaser {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, #ffffff 40%, #f4f6ff 100%);
}

.teaser .note {
    max-width: 62ch;
    margin-top: 6px;
}

@media (max-width: 640px) {
    .teaser {
        align-items: flex-start;
    }
}
