:root {
    --brand: #6d5dfc;
    --brand-dark: #5647e8;
    --brand-soft: #efedff;
    --canvas: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --line: #e7e9f1;
    --ink: #171a2b;
    --muted: #71758a;
    --success: #16a36a;
    --danger: #dc4760;
    --sidebar-width: 260px;
    --shadow: 0 12px 36px rgba(31, 34, 61, .07);
}

[data-bs-theme="dark"] {
    --brand: #8b7cff;
    --brand-dark: #a092ff;
    --brand-soft: #282342;
    --canvas: #101116;
    --surface: #17191f;
    --surface-2: #1d2028;
    --line: #2a2d37;
    --ink: #f3f4f8;
    --muted: #979bab;
    --success: #48c78e;
    --danger: #f16b7f;
    --shadow: 0 14px 38px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 24px 16px 18px; background: var(--surface); border-right: 1px solid var(--line); transition: transform .25s ease; }
.brand-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 26px; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7968ff, #5141df); border-radius: 13px; box-shadow: 0 8px 20px rgba(109, 93, 252, .3); font: 700 14px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 1.6px; margin-top: 2px; }
.tool-nav { overflow-y: auto; flex: 1; }
.nav-caption { margin: 0 12px 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.tool-link { display: flex; align-items: center; gap: 11px; min-height: 45px; padding: 7px 10px; margin: 3px 0; color: var(--muted); text-decoration: none; border-radius: 11px; font-size: 14px; font-weight: 600; transition: .16s ease; }
.tool-link:hover { color: var(--ink); background: var(--surface-2); }
.tool-link.active { color: var(--brand-dark); background: var(--brand-soft); }
.tool-icon { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-link.active .tool-icon { border-color: rgba(109, 93, 252, .2); color: #fff; background: var(--brand); }
.tool-link kbd { margin-left: auto; min-width: 20px; padding: 3px 5px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 5px; font-size: 9px; text-align: center; box-shadow: none; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 14px 12px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.privacy-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22, 163, 106, .1); }
.sidebar-scrim { display: none; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 1020; height: 74px; display: flex; align-items: center; gap: 15px; padding: 0 clamp(18px, 4vw, 54px); background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title strong, .topbar-title small { display: block; }
.topbar-title strong { font-size: 15px; }
.topbar-title small { max-width: 56vw; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-mark { width: 33px; height: 33px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); border-radius: 9px; font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.topbar-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.shortcut-tip { padding: 9px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; font-size: 10px; font-weight: 700; }

.content-wrap { max-width: 1280px; margin: 0 auto; padding: clamp(28px, 5vw, 58px) clamp(18px, 4vw, 54px) 20px; }
.tool-panel { display: none; animation: panel-in .22s ease; }
.tool-panel.active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.panel-heading h1 { margin: 6px 0 8px; font-size: clamp(25px, 3vw, 36px); font-weight: 760; letter-spacing: -1.1px; }
.panel-heading p { max-width: 640px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.eyebrow { color: var(--brand-dark); font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 2px; }
.status-pill { flex: 0 0 auto; padding: 7px 11px; color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); border-radius: 20px; font-size: 10px; font-weight: 700; }

.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.editor-card, .form-card, .regex-output { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.editor-toolbar { height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .4px; }
.text-button { padding: 4px 6px; color: var(--brand-dark); background: transparent; border: 0; border-radius: 5px; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { background: var(--brand-soft); }
textarea { width: 100%; min-height: 330px; display: block; resize: vertical; padding: 18px; color: var(--ink); background: var(--surface); border: 0; outline: 0; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
textarea::placeholder, input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.btn { border-radius: 9px; font-size: 12px; font-weight: 700; padding: 10px 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 7px 16px rgba(109, 93, 252, .2); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-soft { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.btn-soft:hover { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand-soft); }
.result-hint { color: var(--muted); font-size: 11px; }
.result-hint.is-error { color: var(--danger); }
.result-hint.is-success { color: var(--success); }

.segmented { width: fit-content; display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button { padding: 6px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--brand-dark); background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.generator-grid { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: stretch; }
.form-card { padding: 22px; }
.form-card h2 { margin: 0 0 20px; font-size: 15px; }
.form-label { margin: 14px 0 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.form-control, .form-select { min-height: 42px; color: var(--ink); background-color: var(--surface-2); border-color: var(--line); border-radius: 9px; font-size: 12px; }
.form-control:focus, .form-select:focus { color: var(--ink); background-color: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.option-list { display: grid; gap: 9px; margin: 20px 0; }
.option-list label { display: flex; gap: 10px; align-items: flex-start; padding: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.option-list strong, .option-list small { display: block; }
.option-list strong { font-size: 11px; }
.option-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.code-tall textarea { min-height: 580px; }

.diff-result { max-height: 420px; overflow: auto; margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.diff-line { display: grid; grid-template-columns: 42px 42px 24px minmax(0, 1fr); min-height: 27px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.diff-line span { padding: 4px 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-line .line-no { color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--line); text-align: right; user-select: none; }
.diff-line.add { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.diff-line.remove { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.diff-line.add .sign { color: var(--success); }
.diff-line.remove .sign { color: var(--danger); }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; font: 12px/1.5 Inter, sans-serif; }

.live-time { min-width: 196px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.live-time small, .live-time strong { display: block; }
.live-time small { color: var(--muted); font-size: 9px; }
.live-time strong { margin: 4px 0; font: 700 20px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.convert-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-box { min-height: 68px; display: flex; flex-direction: column; justify-content: center; margin-top: 16px; padding: 12px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 9px; font: 11px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-box strong { color: var(--ink); font-size: 13px; }

.regex-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); font: 700 17px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.regex-bar .form-control { background: transparent; border: 0; box-shadow: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.regex-bar .regex-flags { flex: 0 0 62px; }
.regex-output { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr); min-height: 190px; }
.regex-preview { padding: 18px; border-right: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; }
.regex-preview mark { padding: 1px 2px; color: inherit; background: color-mix(in srgb, #f5bb3b 50%, transparent); border-radius: 3px; }
.match-list { max-height: 310px; overflow: auto; padding: 10px; }
.match-item { padding: 9px; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.match-item strong { color: var(--brand-dark); }
.match-item small { display: block; color: var(--muted); }

.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.qr-card { min-width: 0; }
.qr-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.qr-card-title h2 { margin: 0 0 3px; font-size: 15px; }
.qr-card-title p { margin: 0; color: var(--muted); font-size: 10px; }
.qr-step { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); border-radius: 9px; font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.qr-content-input { min-height: 122px; padding: 12px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.qr-color-row { display: flex; gap: 20px; margin-top: 15px; }
.qr-color-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.qr-color-row input[type="color"] { width: 28px; height: 28px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.qr-preview { position: relative; min-height: 280px; display: grid; place-items: center; margin-top: 18px; padding: 18px; background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--surface-2) 75%), linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.qr-preview canvas { display: none; width: min(100%, 384px); height: auto; background: #fff; border-radius: 7px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); image-rendering: pixelated; }
.qr-preview canvas.is-ready { display: block; }
.qr-placeholder { color: var(--muted); text-align: center; }
.qr-placeholder span { display: block; color: var(--brand); font-size: 42px; line-height: 1; }
.qr-placeholder p { margin: 9px 0 0; font-size: 11px; }
.qr-dropzone { min-height: 245px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 14px; padding: 20px; color: var(--muted); background: var(--surface-2); border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; transition: .18s ease; overflow: hidden; }
.qr-dropzone:hover, .qr-dropzone:focus, .qr-dropzone.is-dragging { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand); outline: 0; }
.qr-upload-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 12px; color: #fff; background: var(--brand); border-radius: 12px; font-size: 22px; box-shadow: 0 8px 18px rgba(109, 93, 252, .23); }
.qr-dropzone strong { color: var(--ink); font-size: 13px; }
.qr-dropzone small { margin-top: 6px; font-size: 9px; }
.qr-dropzone img { display: none; max-width: 100%; max-height: 205px; object-fit: contain; border-radius: 8px; }
.qr-dropzone img.is-visible { display: block; }
.qr-dropzone.has-preview > :not(img) { display: none; }
.qr-result-card { overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; }
.qr-result-card textarea { min-height: 104px; padding: 13px; background: var(--surface-2); font-size: 11px; }
.qr-result-actions { padding: 0 12px 12px; background: var(--surface-2); }
.qr-result-actions:empty { display: none; }
.subtool-heading { margin: 52px 0 20px; padding-top: 32px; border-top: 1px solid var(--line); }
.subtool-heading h2 { margin: 7px 0 6px; font-size: 23px; letter-spacing: -.5px; }
.subtool-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.image-base64-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.image-base64-card { min-width: 0; }
.image-dropzone { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 15px; padding: 20px; color: var(--muted); background: var(--surface-2); border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; overflow: hidden; transition: .18s ease; }
.image-dropzone:hover, .image-dropzone:focus, .image-dropzone.is-dragging { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand); outline: 0; }
.image-dropzone strong { color: var(--ink); font-size: 13px; }
.image-dropzone small { margin-top: 6px; font-size: 9px; }
.image-dropzone img { display: none; max-width: 100%; max-height: 195px; object-fit: contain; border-radius: 8px; }
.image-dropzone img.is-visible { display: block; }
.image-dropzone.has-preview > :not(img) { display: none; }
.image-base64-output { margin-top: 15px; box-shadow: none; }
.image-base64-output textarea { min-height: 145px; padding: 13px; background: var(--surface-2); font-size: 10px; word-break: break-all; }
.image-base64-input { min-height: 190px; padding: 12px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; word-break: break-all; }
.decoded-image-preview { min-height: 238px; display: grid; place-items: center; margin-top: 17px; padding: 18px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; font-size: 11px; overflow: hidden; }
.decoded-image-preview img { display: none; max-width: 100%; max-height: 330px; object-fit: contain; border-radius: 8px; }
.decoded-image-preview img.is-visible { display: block; }
.decoded-image-preview.has-image > span { display: none; }

.page-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 54px; padding-top: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.toast { color: #fff; background: #232532; box-shadow: var(--shadow); font-size: 12px; }
.friend-links { display: flex; align-items: flex-start; gap: 22px; margin-top: 38px; padding: 20px 0; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
.friend-links > strong { flex: 0 0 auto; color: var(--ink); font-size: 11px; }
.friend-links div { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.friend-links a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.friend-links a:hover { color: var(--brand-dark); }

.seo-content { margin-top: 54px; padding: clamp(22px, 4vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.seo-content h2 { margin: 7px 0 10px; font-size: 24px; letter-spacing: -.5px; }
.seo-content h3 { margin: 0 0 13px; font-size: 14px; }
.seo-content p, .seo-content li { color: var(--muted); font-size: 13px; line-height: 1.8; }
.seo-intro { max-width: 820px; }
.seo-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.seo-columns ol, .seo-columns ul { margin: 0; padding-left: 20px; }
.faq-section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.faq-section details { border-bottom: 1px solid var(--line); }
.faq-section summary { padding: 14px 0; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.faq-section details p { margin: -2px 0 14px; }
.related-tools { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-tools strong { display: block; margin-bottom: 12px; font-size: 12px; }
.related-tools div { display: flex; flex-wrap: wrap; gap: 8px; }
.related-tools a { padding: 7px 10px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 8px; text-decoration: none; font-size: 11px; font-weight: 700; }

.home-page { min-height: 100vh; background: radial-gradient(circle at 75% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 30%), var(--canvas); }
.home-header { max-width: 1180px; height: 84px; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; padding: 0 24px; }
.home-main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.home-hero { padding: clamp(70px, 11vw, 130px) 0 clamp(70px, 10vw, 115px); text-align: center; }
.home-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 10px; font-weight: 700; }
.home-badge i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.home-hero h1 { margin: 22px 0 18px; font-size: clamp(38px, 7vw, 72px); font-weight: 800; line-height: 1.08; letter-spacing: -3px; }
.home-hero h1 em { color: var(--brand); font-style: normal; }
.home-hero p { max-width: 610px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.8; }
.home-cta { margin-top: 28px; padding: 12px 20px; }
.home-cta span { margin-left: 12px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.section-title h2 { margin: 7px 0 0; font-size: 26px; letter-spacing: -.7px; }
.section-title > span { color: var(--muted); font-size: 11px; }
.tool-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-card { display: flex; align-items: center; gap: 15px; min-height: 104px; padding: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.tool-card:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-3px); }
.tool-card-icon { flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7968ff, #5141df); border-radius: 12px; font: 800 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-card-copy { min-width: 0; }
.tool-card-copy strong, .tool-card-copy small { display: block; }
.tool-card-copy strong { margin-bottom: 5px; font-size: 14px; }
.tool-card-copy small { color: var(--muted); font-size: 10px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-arrow { margin-left: auto; color: var(--brand-dark); font-size: 18px; }
.home-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 80px 0; }
.home-features article { padding: 25px; border-top: 1px solid var(--line); }
.home-features article > span { color: var(--brand-dark); font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.home-features h2 { margin: 14px 0 9px; font-size: 16px; }
.home-features p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.home-footer { max-width: 1180px; display: flex; justify-content: space-between; margin: 0 auto; padding: 22px 24px 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.home-friend-links { margin-top: 20px; }

.error-page { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; background: radial-gradient(circle at 78% 26%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 28%), var(--canvas); }
.error-header { flex: 0 0 auto; width: 100%; }
.error-main { width: 100%; max-width: 1180px; flex: 1; display: flex; flex-direction: column; justify-content: center; margin: 0 auto; padding: 54px 24px 70px; }
.error-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .85fr); align-items: center; gap: clamp(52px, 8vw, 105px); }
.error-copy h1 { margin: 16px 0 20px; font-size: clamp(48px, 7vw, 82px); font-weight: 800; line-height: 1.04; letter-spacing: -4px; }
.error-copy h1 em { color: var(--brand); font-style: normal; }
.error-copy > p:not(.error-path) { max-width: 560px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.9; }
.error-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }
.error-actions .btn { min-width: 126px; padding: 12px 19px; }
.error-actions .btn-primary span { margin-left: 9px; }
.error-path { max-width: 570px; margin: 24px 0 0; padding: 10px 13px; color: var(--muted); background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid var(--line); border-radius: 9px; font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-path > span:first-child { margin-right: 7px; color: var(--brand-dark); font-weight: 800; }
.error-visual { position: relative; }
.error-visual::before, .error-visual::after { content: ''; position: absolute; border-radius: 50%; filter: blur(.2px); }
.error-visual::before { width: 74px; height: 74px; top: -32px; right: -20px; background: color-mix(in srgb, var(--brand) 18%, transparent); }
.error-visual::after { width: 34px; height: 34px; bottom: -15px; left: -18px; background: color-mix(in srgb, var(--success) 23%, transparent); }
.error-window { position: relative; z-index: 1; overflow: hidden; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 28px 80px rgba(44, 37, 116, .14); transform: rotate(1.5deg); }
.error-window-bar { height: 52px; display: flex; align-items: center; gap: 7px; padding: 0 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.error-window-bar i { width: 8px; height: 8px; background: var(--line); border-radius: 50%; }
.error-window-bar i:first-child { background: #f16b7f; }
.error-window-bar i:nth-child(2) { background: #f5bb3b; }
.error-window-bar i:nth-child(3) { background: #48c78e; }
.error-window-bar span { margin-left: auto; color: var(--muted); font: 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .8px; }
.error-window-body { position: relative; min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; }
.error-window-body strong { position: relative; color: var(--ink); font: 800 clamp(78px, 10vw, 126px)/.85 Inter, sans-serif; letter-spacing: -8px; }
.error-code-shadow { position: absolute; top: 46px; left: 50%; color: transparent; font: 800 150px/1 Inter, sans-serif; letter-spacing: -10px; -webkit-text-stroke: 1px color-mix(in srgb, var(--brand) 13%, transparent); transform: translateX(-50%); }
.error-window-body > p { position: relative; margin: 19px 0 30px; color: var(--brand-dark); font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 2px; text-transform: uppercase; }
.error-signal { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; font-size: 9px; }
.error-signal i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent); }
.error-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: clamp(64px, 9vw, 100px); }
.error-shortcuts a { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 16px; color: var(--ink); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 13px; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.error-shortcuts a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-2px); }
.error-shortcuts a > span { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7968ff, #5141df); border-radius: 10px; font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.error-shortcuts strong { align-self: end; font-size: 12px; }
.error-shortcuts small { align-self: start; margin-top: 3px; color: var(--muted); font-size: 9px; }
.error-footer { width: calc(100% - 48px); flex: 0 0 auto; }
.error-footer a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(0, 0, 0, .18); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-scrim { position: fixed; inset: 0; z-index: 1025; display: block; background: rgba(8, 9, 15, .45); backdrop-filter: blur(2px); }
    .main-area { margin-left: 0; }
}

@media (max-width: 767.98px) {
    .topbar { height: 66px; }
    .shortcut-tip { display: none; }
    .content-wrap { padding-top: 28px; }
    .panel-heading { display: block; }
    .status-pill { display: inline-block; margin-top: 14px; }
    .editor-grid, .generator-grid, .convert-cards, .regex-output { grid-template-columns: 1fr; }
    textarea { min-height: 240px; }
    .code-tall textarea { min-height: 430px; }
    .regex-preview { min-height: 150px; border-right: 0; border-bottom: 1px solid var(--line); }
    .live-time { margin-top: 16px; }
    .regex-bar { flex-wrap: wrap; }
    .regex-bar .btn { width: 100%; }
    .seo-columns, .tool-card-grid, .home-features, .qr-grid, .image-base64-grid { grid-template-columns: 1fr; }
    .home-hero h1 { letter-spacing: -1.8px; }
    .home-features { gap: 0; margin: 55px 0; }
    .friend-links { display: block; }
    .friend-links > strong { display: block; margin-bottom: 12px; }
    .error-main { justify-content: flex-start; padding-top: 36px; }
    .error-hero { grid-template-columns: 1fr; gap: 52px; }
    .error-copy h1 { font-size: clamp(45px, 15vw, 64px); letter-spacing: -2.5px; }
    .error-visual { max-width: 520px; width: 100%; margin: 0 auto; }
    .error-shortcuts { grid-template-columns: 1fr; margin-top: 60px; }
}

@media (max-width: 480px) {
    .topbar-title small { display: none; }
    .panel-heading h1 { font-size: 25px; }
    .action-row .btn { flex: 1 1 auto; }
    .diff-line { grid-template-columns: 32px 32px 20px minmax(0, 1fr); }
    .diff-line span { padding: 4px; }
}
