/* 大坤在线工具: shared layout, design tokens and component states. */
:root {
    --bg: #f6f9fb; --surface: #fff; --surface-soft: #f8fbfc; --sidebar: #fbfdfe;
    --text: #20303c; --muted: #637581; --border: #dee8ed;
    --info: #0dcaf0; --info-hover: #31d2f2; --on-info: #083344;
    --accent: #087990; --accent-hover: #066277; --accent-soft: #e7f8fc; --accent-glow: #b6edf8;
    --success: #16734e; --success-soft: #eaf5ee;
    --danger: #b33c37; --danger-soft: #fff0ef; --warning: #936414;
    --shadow: 0 4px 20px #20303c04;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
    --text-xs: 12px; --text-sm: 13px; --text-base: 14px; --text-lg: 16px; --text-xl: 20px; --text-2xl: 28px; --text-3xl: 34px;
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --sidebar-width: 220px;
    color-scheme: light;
}
[data-bs-theme="dark"] {
    --bg: #101a22; --surface: #172630; --surface-soft: #14212a; --sidebar: #131f28;
    --text: #e6f1f6; --muted: #a3b8c4; --border: #2c4250;
    --info: #22d3ee; --info-hover: #67e8f9; --on-info: #083344;
    --accent: #67e8f9; --accent-hover: #a5f3fc; --accent-soft: #143742; --accent-glow: #1c5263;
    --success: #8bd9ad; --success-soft: #253c2e;
    --danger: #ffaca6; --danger-soft: #3b2524; --warning: #e3be79;
    --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--text-base)/1.6 var(--font-sans); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-3xl); line-height: 1.4; letter-spacing: -1px; font-weight: 650; }
h2 { font-size: var(--text-xl); font-weight: 650; line-height: 1.4; }
h3 { font-size: var(--text-lg); font-weight: 600; }
[hidden], .d-none { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: #a5eafa; color: #083344; }
.mono, pre, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden, .compact-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 100; top: 8px; left: 8px; background: var(--surface); padding: 12px; }
.sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; padding: 30px 18px 18px; border-right: 1px solid var(--border); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 42px; font-size: 18px; font-weight: 750; letter-spacing: -.6px; white-space: nowrap; }
.brand-symbol { display: flex; width: 32px; height: 32px; flex-shrink: 0; }
.brand-symbol img { display: block; width: 100%; height: 100%; }
.brand-light { font-weight: 450; }
.brand small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 2px; margin-top: 2px; }
.nav-caption { margin: 0 12px 10px; font-size: 11px; font-weight: 550; color: var(--muted); letter-spacing: 1px; }
.side-nav { display: grid; gap: 5px; margin-bottom: 30px; }
.side-nav a, .sidebar-bottom > a { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.side-nav a:hover, .sidebar-bottom > a:hover { color: var(--text); background: var(--surface-soft); }
.side-nav a[aria-current="page"], .sidebar-bottom > a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.side-nav a.is-current { color: var(--accent); }
.nav-tag { margin-left: auto; font: 9px var(--font-mono); border: 1px solid var(--border); padding: 2px 4px; border-radius: 4px; }
.nav-arrow { margin-left: auto; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { margin: 22px 10px 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.sidebar-note small { display: block; margin-top: 8px; font: 8px var(--font-mono); letter-spacing: 1.2px; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-right: 7px; }
.topbar { height: 72px; margin-left: var(--sidebar-width); padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-location, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-location { font-size: 12px; }
.topbar-location strong { font-weight: 500; }
.breadcrumb-root, .breadcrumb-divider { color: var(--muted); }
.breadcrumb-divider { opacity: .5; }
.local-note { color: var(--muted); font-size: 11px; margin-right: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
.mobile-menu, .nav-backdrop { display: none; }
.main { margin-left: var(--sidebar-width); padding: 36px; }
.main-inner { max-width: 1250px; margin: 0 auto; }
.eyebrow { color: var(--accent); font: 10px/1.5 var(--font-mono); letter-spacing: 2px; margin-bottom: 10px; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 25px; }
.page-heading p { color: var(--muted); margin-top: 8px; font-size: 13px; }
.page-heading h1 { font-size: 28px; }
.hero { display: grid; grid-template-columns: 1fr 1.08fr; gap: 32px; align-items: center; margin-bottom: 32px; }
.hero-copy p { color: var(--muted); max-width: 380px; margin-top: 13px; font-size: 13px; line-height: 1.9; }
.hero-meta { display: flex; gap: 20px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.hero-meta svg { width: 13px; height: 13px; color: var(--accent); margin-right: 4px; }
.featured-tool { border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid var(--border); display: flex; overflow: hidden; min-height: 192px; position: relative; padding: 26px; align-items: center; }
[data-bs-theme="dark"] .featured-tool { background: var(--accent-soft); border-color: var(--border); }
.featured-copy { z-index: 1; width: 58%; }
.featured-copy > span { font: 9px var(--font-mono); letter-spacing: 2px; color: var(--accent); }
.featured-copy h2 { font-size: 22px; margin: 8px 0 5px; }
.featured-copy p { font-size: 11px; color: var(--muted); max-width: 210px; line-height: 1.8; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; margin-top: 15px; font-size: 12px; }
.text-link svg { width: 15px; height: 15px; }
.code-art { position: absolute; right: -14px; top: 34px; width: 215px; height: 154px; border: 1px solid #285567; background: #102e3b; color: #cce5ef; border-radius: 9px; transform: rotate(-6deg); box-shadow: 0 12px 20px #102e3b1c; padding: 10px 15px; font: 11px/1.7 var(--font-mono); }
.code-art .dots { font-size: 16px; letter-spacing: 3px; color: #a0bcc9; margin-bottom: 8px; }
.code-art b { color: #67e8f9; font-weight: 400; }
.section-title { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 13px; }
.section-title h2 { font-size: 15px; }
.section-title small { font-size: 11px; color: var(--muted); font-weight: 400; }
.tool-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.tool-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; display: flex; text-align: left; gap: 13px; align-items: center; padding: 17px 18px; position: relative; }
.tool-tab > .tool-icon { display: grid; place-items: center; border-radius: 8px; width: 38px; height: 38px; background: var(--surface-soft); color: var(--muted); }
.tool-tab strong { display: block; font-size: 13px; font-weight: 600; }
.tool-tab small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.tool-tab.active { background: var(--accent-soft); border-color: var(--accent); }
.tool-tab.active .tool-icon { background: var(--surface); color: var(--accent); }
.tool-tab.active::after { content: ''; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; position: absolute; top: 14px; right: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.panel-head { padding: 22px 24px; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 17px; }
.panel-head p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pill, .badge, .tool-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 5px; padding: 3px 8px; }
.pill-info, .text-bg-info, .text-bg-primary { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-green, .text-bg-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.text-bg-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; }
.input-side, .result-side { padding: 24px; min-width: 0; }
.result-side { background: var(--surface-soft); border-left: 1px solid var(--border); }
.small-label { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-soft); gap: 3px; margin-bottom: 20px; }
.segmented button { border: 0; border-radius: 4px; background: transparent; padding: 7px 15px; color: var(--muted); font-size: 12px; }
.segmented button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px #20303c10; font-weight: 600; }
.field { margin-bottom: 17px; min-width: 0; }
.field label, .form-label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input:not([type="checkbox"]):not([type="file"]), select, textarea { width: 100%; min-width: 0; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { resize: vertical; min-height: 112px; line-height: 1.7; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: middle; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.input-combo { display: flex; gap: 8px; }
.input-combo select { width: 110px; flex: none; }
.help { display: block; color: var(--muted); font-size: 11px; margin-top: 7px; line-height: 1.7; }
.btn, .btn-primary, .btn-secondary { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.btn:hover, .btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-primary { background: var(--info); color: var(--on-info); border-color: var(--info); }
.btn-primary:hover { background: var(--info-hover); border-color: var(--info-hover); color: var(--on-info); }
button:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.inline-feedback { font-size: 12px; padding: 10px 12px; border-radius: 6px; margin-top: 14px; background: var(--accent-soft); color: var(--accent); }
.inline-feedback:empty { display: none; }
.inline-feedback.error { background: var(--danger-soft); color: var(--danger); }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 8px; }
.result-head .small-label { margin: 0; }
.empty-state { min-height: 165px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 9px; color: var(--muted); font-size: 12px; padding: 20px; }
.empty-state svg { width: 31px; height: 31px; opacity: .6; margin-bottom: 4px; }
.empty-state p { font-size: 11px; max-width: 240px; }
.result-list { margin: 0; }
.result-row { border-bottom: 1px solid var(--border); padding: 10px 0 11px; display: grid; grid-template-columns: 1fr 26px; align-items: center; gap: 5px; }
.result-row:last-child { border-bottom: 0; }
.result-row dt { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.result-row dd { margin: 0; font: 13px/1.8 var(--font-mono); word-break: break-all; }
.result-row button { border: 0; background: none; color: var(--muted); padding: 4px; }
.result-row button svg { width: 14px; height: 14px; }
.result-text { min-height: 173px; font: 13px/1.8 var(--font-mono); background: var(--surface) !important; }
.workspace-foot { border-top: 1px solid var(--border); padding: 11px 24px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.live-clock { font-variant-numeric: tabular-nums; }
.workspace-foot code { color: var(--text); font-size: 10px; }
.preset-row { display: flex; gap: 6px; margin-top: 8px; }
.preset-row button { padding: 3px 9px; min-height: 24px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 12px 0; font-size: 12px; }
.check-grid label { display: inline-flex; align-items: center; gap: 5px; }
.charset-field { padding: 0; margin: 0 0 15px; border: 0; }
.charset-field legend { padding: 0; font-size: 12px; }
.disclosure { font-size: 11px; color: var(--muted); margin-top: 16px; }
.disclosure p { margin-top: 8px; }
.page-footer { position: relative; display: flex; flex-direction: column; gap: 22px; margin-top: 42px; padding-top: 28px; color: var(--muted); font-size: 12px; }
.page-footer::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-glow) 25%, var(--accent) 50%, var(--accent-glow) 75%, transparent); opacity: .65; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-wordmark { display: inline-flex; align-items: baseline; gap: 0; color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.5px; }
.footer-wordmark > span:first-child { font-weight: 400; }
.footer-brand-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--info); margin-left: 3px; }
.footer-tagline { font-size: 11px; letter-spacing: .3px; }
.footer-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 18px; font-size: 11px; }
.footer-nav a { padding: 6px 0; transition: color .18s ease; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { display: flex; justify-content: center; padding-top: 16px; border-top: 1px solid var(--border); }
.icp-link { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; max-width: 100%; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; letter-spacing: .25px; transition: color .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.icp-link:hover, .icp-link:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 3px 14px color-mix(in srgb, var(--info) 12%, transparent); }
.icp-icon { width: 15px; height: 15px; color: var(--accent); }
.icp-arrow { width: 12px; height: 12px; opacity: .65; }
.studio-toast { position: fixed; bottom: 26px; left: calc(50% + 100px); transform: translateX(-50%); z-index: 100; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 8px; color: #fff; background: #123c4c; box-shadow: 0 5px 20px #0002; font-size: 12px; }
.studio-toast.is-error { background: #833c36; }
.copy-buffer { position: fixed; left: -9999px; top: 0; }
.noscript-note { margin: 20px 20px 20px 240px; padding: 15px; background: var(--danger-soft); }
.d-flex { display: flex; } .align-items-center { align-items: center; } .gap-2 { gap: 8px; } .flex-wrap { flex-wrap: wrap; }
.mb-2 { margin-bottom: 8px; } .mt-2 { margin-top: 8px; } .btn-group { display: inline-flex; gap: 5px; }
@media (min-width: 1500px) { .main { padding: 42px 52px; } }
@media (max-width: 1180px) {
    :root { --sidebar-width: 194px; }
    .sidebar { padding-left: 12px; padding-right: 12px; }
    .brand { font-size: 17px; }
    .main { padding: 28px; }
    .hero { gap: 22px; } .hero h1 { font-size: 28px; }
    .code-art { right: -70px; opacity: .9; } .featured-copy { width: 76%; }
    .tool-tab { padding: 14px 12px; gap: 9px; } .tool-tab small { font-size: 9px; }
    .tool-tab > .tool-icon { width: 32px; height: 32px; }
}
@media (max-width: 940px) {
    .hero { grid-template-columns: 1fr; } .hero-copy p { max-width: none; } .hero-meta { margin-top: 12px; }
    .featured-tool { min-height: 158px; padding: 20px 24px; } .code-art { right: 20px; top: 20px; }
    .tool-layout { grid-template-columns: 1fr; } .result-side { border-left: 0; border-top: 1px solid var(--border); }
    .tool-tab small { display: none; } .tool-tab { padding: 12px; }
    .tool-tab strong { font-size: 12px; }
}
@media (max-width: 700px) {
    :root { --sidebar-width: 0px; }
    .sidebar { width: 230px; transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
    .nav-open .sidebar { transform: translateX(0); visibility: visible; }
    .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: #101a2266; border: 0; }
    .nav-open { overflow: hidden; }
    .mobile-menu { display: inline-grid; }
    .topbar { height: 62px; padding: 0 18px; } .topbar-location { gap: 10px; } .local-note { display: none; }
    .main { padding: 25px 18px; } .hero { margin-bottom: 24px; gap: 22px; }
    .hero h1 { font-size: 27px; } .hero-copy p { margin-top: 9px; }
    .featured-tool { min-height: 170px; } .code-art { right: -76px; }
    .featured-copy { width: 74%; }
    .tool-tabs { gap: 7px; margin-bottom: 17px; } .tool-tab { padding: 12px 5px; gap: 7px; justify-content: center; }
    .tool-tab > .tool-icon { width: 22px; height: 25px; background: transparent; } .tool-tab > .tool-icon svg { width: 17px; height: 17px; }
    .tool-tab.active::after { display: none; } .tool-tab.active .tool-icon { background: transparent; }
    .panel-head { padding: 18px; } .panel-head h2 { font-size: 16px; } .panel-head p { max-width: 235px; }
    .input-side, .result-side { padding: 20px 18px; }
    .workspace-foot { padding: 12px 18px; flex-wrap: wrap; font-size: 10px; }
    .studio-toast { left: 50%; width: max-content; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; } .page-heading > div { width: 100%; } .page-heading h1 { font-size: 25px; }
    .page-footer { margin-top: 32px; padding-top: 24px; gap: 18px; } .footer-top { flex-direction: column; gap: 14px; text-align: center; } .footer-brand { align-items: center; } .footer-nav { gap: 20px; } .noscript-note { margin: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
