:root {
    color-scheme: light;
    --bg: #f3f6f4;
    --surface: #e9eeeb;
    --surface-strong: #dfe7e2;
    --text: #17201c;
    --muted: #66736c;
    --line: #ccd6d0;
    --accent: #087f5b;
    --accent-strong: #056647;
    --accent-soft: #cbe9dc;
    --danger: #a53d42;
    --shadow: 0 24px 70px rgba(34, 64, 51, .12);
    --radius: 8px;
    --max: 1240px;
    --header: 72px;
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111713;
    --surface: #18221d;
    --surface-strong: #213029;
    --text: #edf3ef;
    --muted: #9aaba2;
    --line: #304039;
    --accent: #58c59c;
    --accent-strong: #77d5b1;
    --accent-soft: #183e30;
    --danger: #ed858a;
    --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.65; letter-spacing: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
::selection { background: var(--accent); color: #f8fffb; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--text); color: var(--bg); border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
.site-header { width: min(calc(100% - 40px), var(--max)); height: var(--header); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: relative; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; font-weight: 760; font-size: 17px; }
.brand-mark { width: 13px; height: 13px; border: 3px solid var(--accent); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--bg); background: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid color-mix(in srgb, var(--line), transparent 20%); background: color-mix(in srgb, var(--bg), transparent 12%); backdrop-filter: blur(16px); border-radius: var(--radius); }
.site-nav a { padding: 7px 12px; color: var(--muted); font-size: 13px; white-space: nowrap; border-radius: 5px; transition: color .2s ease, background .2s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.icon-button:hover { background: var(--surface); }
.icon-button:active, .button:active, .tool-chip:active { transform: translateY(1px); }
.theme-toggle { justify-self: end; font-size: 20px; }
.nav-toggle { display: none; justify-self: end; }
.nav-toggle span { display: block; width: 18px; height: 1px; background: currentColor; margin: 3px; }

main { min-height: calc(100dvh - var(--header)); }
.hero, .page-section, .workspace, .tool-hero, .site-footer, .statement-band { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.home-hero { min-height: calc(100dvh - var(--header)); display: grid; grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr); gap: clamp(40px, 7vw, 108px); align-items: center; padding: 28px 0 70px; }
.hero-copy { align-self: center; }
.eyebrow { margin: 0 0 22px; color: var(--accent); font-size: 12px; font-weight: 720; text-transform: uppercase; letter-spacing: .12em; }
.hero h1 { margin: 0; max-width: 720px; font-size: clamp(58px, 6vw, 92px); line-height: .92; font-weight: 760; letter-spacing: 0; }
.hero h1 em { color: var(--accent); font-style: italic; line-height: 1.1; padding-bottom: 4px; display: inline-block; }
.hero-lead { max-width: 560px; margin: 30px 0 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.7; }
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 690; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer; transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease; }
.button-primary { color: #f7fffb; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button-quiet { color: var(--text); background: var(--surface); border-color: var(--line); }
.button-quiet:hover { background: var(--surface-strong); }
.button-danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger), transparent 55%); }
.button-danger:hover { background: color-mix(in srgb, var(--danger), transparent 90%); }
.button:disabled { opacity: .42; cursor: not-allowed; }

.hero-visual { aspect-ratio: 1 / 1.08; min-height: 560px; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-strong); box-shadow: var(--shadow); }
.hero-visual::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line), transparent 10%); pointer-events: none; border-radius: inherit; }
.hero-visual canvas { width: 100%; height: 100%; display: block; }
.visual-caption { position: absolute; inset: auto 24px 22px; display: flex; justify-content: space-between; align-items: end; gap: 20px; color: color-mix(in srgb, var(--text), transparent 10%); }
.visual-caption span { max-width: 140px; font-size: 12px; line-height: 1.4; }
.visual-caption strong { max-width: 210px; text-align: right; font-size: 13px; }

.statement-band { min-height: 72vh; display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 80px; padding: 100px 4vw; border-top: 1px solid var(--line); }
.statement-band > p { margin: 0; font-size: clamp(38px, 5.6vw, 82px); line-height: 1.15; font-weight: 650; }
.statement-meta { align-self: end; padding-bottom: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.statement-meta a:hover { color: var(--accent); }
.page-section { padding-block: clamp(90px, 12vw, 170px); }
.about-grid { display: grid; grid-template-columns: 1.35fr .7fr .9fr; gap: clamp(32px, 6vw, 100px); align-items: start; }
.about-intro h2, .section-heading h2 { max-width: 740px; margin: 0; font-size: clamp(38px, 4.7vw, 70px); line-height: 1.08; font-weight: 670; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 52px; }
.skill-cloud span, .tool-chip { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: transparent; font-size: 13px; }
.about-note { padding-top: 52px; color: var(--muted); font-size: 18px; }
.about-note p { margin: 0; }

.tools-section { border-top: 1px solid var(--line); }
.section-heading { max-width: 780px; margin-bottom: 60px; }
.section-heading > p:last-child { max-width: 520px; margin: 24px 0 0; color: var(--muted); font-size: 18px; }
.tool-grid { display: grid; grid-template-columns: 1.15fr .85fr; grid-template-rows: repeat(2, minmax(240px, auto)); gap: 14px; }
.tool-card { position: relative; min-height: 240px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .35s cubic-bezier(.16, 1, .3, 1), background .25s ease; }
.tool-card:hover { transform: translateY(-5px); background: var(--surface-strong); }
.tool-card-featured { grid-row: 1 / 3; min-height: 494px; color: #effcf5; background: var(--accent); border-color: var(--accent); }
.tool-card-featured:hover { background: var(--accent-strong); }
.tool-card-wide { grid-column: 1 / 3; min-height: 220px; }
.tool-symbol { width: max-content; font-size: clamp(34px, 4vw, 58px); font-weight: 720; line-height: 1; }
.qr-symbol { font-size: 64px; }
.tool-card h3 { margin: 0 0 6px; font-size: 28px; }
.tool-card p { max-width: 420px; margin: 0; color: var(--muted); }
.tool-card-featured p { color: rgba(239, 252, 245, .74); }
.card-arrow { position: absolute; right: 25px; top: 24px; font-size: 25px; transition: transform .3s ease; }
.tool-card:hover .card-arrow { transform: translate(3px, -3px); }
.closing-line { display: flex; align-items: end; justify-content: space-between; gap: 40px; border-top: 1px solid var(--line); }
.closing-line p { margin: 0; font-size: clamp(40px, 6vw, 86px); line-height: 1.08; font-weight: 650; }
.round-link { flex: 0 0 auto; width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; color: #f7fffb; background: var(--accent); font-size: 34px; transition: transform .25s ease, background .25s ease; }
.round-link:hover { transform: rotate(8deg); background: var(--accent-strong); }

.tool-hero { min-height: 390px; padding: 82px 0 58px; display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: end; border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; margin-bottom: 36px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--accent); }
.tool-hero h1 { margin: 0; font-size: clamp(54px, 7.5vw, 104px); line-height: .92; letter-spacing: 0; }
.tool-hero > div > p:last-child { max-width: 600px; margin: 24px 0 0; color: var(--muted); font-size: 18px; }
.privacy-note { width: 270px; padding: 18px; display: grid; gap: 2px; border-left: 2px solid var(--accent); background: var(--surface); }
.privacy-note strong { font-size: 14px; }
.privacy-note span { color: var(--muted); font-size: 12px; }

.workspace { padding-block: 70px 120px; }
.clip-workspace { max-width: 960px; }
.clip-form, .editor-panel, .preview-panel, .password-workspace { padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface), transparent 25%); }
.field { display: grid; gap: 9px; }
.field + .field { margin-top: 28px; }
.field label, fieldset legend { font-size: 13px; font-weight: 720; }
.field-help { margin: 0; color: var(--muted); font-size: 12px; }
.input-action-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
input:not([type="checkbox"]):not([type="range"]), textarea, select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); outline: 0; color: var(--text); background: var(--bg); transition: border-color .2s ease, box-shadow .2s ease; }
input:not([type="checkbox"]):not([type="range"]), select { min-height: 46px; padding: 9px 12px; }
textarea { padding: 15px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 82%); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted), transparent 25%); }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.label-row > span { color: var(--muted); font-size: 12px; }
.form-options { margin-top: 24px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.compact-field { min-width: 180px; }
.expiry { margin: 0; color: var(--muted); font-size: 12px; }
.notice { margin-bottom: 16px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.notice-success { color: var(--accent-strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent), transparent 58%); }
.notice-error { color: var(--danger); background: color-mix(in srgb, var(--danger), transparent 91%); border-color: color-mix(in srgb, var(--danger), transparent 62%); }
.share-panel { margin-top: 16px; padding: 28px; display: grid; grid-template-columns: 220px 1fr; gap: 34px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-strong); }
.qr-output canvas, .qr-output img { display: block; max-width: 100%; height: auto; padding: 10px; background: #f8fbf9; border-radius: 4px; }
.share-panel h2 { margin: 2px 0 10px; font-size: 40px; letter-spacing: .06em; overflow-wrap: anywhere; }
.share-panel p:not(.eyebrow) { color: var(--muted); }

.split-workspace { display: grid; grid-template-columns: 1fr .78fr; gap: 14px; align-items: stretch; }
.option-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.option-grid .field { margin: 0; }
.preview-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; align-items: center; }
.qr-stage { width: 100%; min-height: 360px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 12px; border-radius: var(--radius); background: var(--surface-strong); color: var(--muted); text-align: center; }
.qr-stage canvas { width: min(100%, 360px); height: auto; padding: 12px; background: #f8fbf9; border-radius: 4px; }
.empty-visual { font-size: 74px; line-height: 1; opacity: .5; }

.text-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.tool-chip { cursor: pointer; color: var(--text); background: var(--surface); transition: background .2s ease, border-color .2s ease; }
.tool-chip:hover { background: var(--surface-strong); border-color: var(--accent); }
.text-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.text-panels .field { margin: 0; }
.text-panels textarea { min-height: 430px; }
.text-button { padding: 2px 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 12px; }
.text-stats { margin-top: 14px; padding: 18px 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; border-radius: var(--radius); background: var(--surface); }
.text-stats span { display: grid; color: var(--muted); font-size: 12px; }
.text-stats strong { color: var(--text); font-size: 24px; }

.password-workspace { max-width: 760px; }
.password-display { min-height: 130px; padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: var(--text); color: var(--bg); border-radius: var(--radius); }
.password-display output { font-family: "Cascadia Code", Consolas, monospace; font-size: clamp(20px, 3.5vw, 34px); font-weight: 660; overflow-wrap: anywhere; letter-spacing: .04em; }
.copy-password { background: transparent; border-color: color-mix(in srgb, var(--bg), transparent 65%); color: var(--bg); }
.strength-row { margin: 18px 0 36px; display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.strength-marks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength-marks i { height: 3px; background: var(--line); }
.strength-marks[data-level="1"] i:nth-child(-n+1), .strength-marks[data-level="2"] i:nth-child(-n+2), .strength-marks[data-level="3"] i:nth-child(-n+3), .strength-marks[data-level="4"] i { background: var(--accent); }
.password-controls { display: grid; gap: 28px; }
.range-field { display: grid; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.check-grid { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.check-grid legend { margin-bottom: 10px; }
.check-grid label, .toggle-row { padding: 13px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.check-grid input, .toggle-row input { accent-color: var(--accent); }
.toggle-row { justify-content: space-between; }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); }
.button-full { width: 100%; }

.site-footer { min-height: 210px; padding: 52px 0; display: flex; justify-content: space-between; align-items: start; gap: 40px; border-top: 1px solid var(--line); }
.site-footer strong { font-size: 22px; }
.site-footer p { margin: 4px 0 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 20px; color: var(--muted); font-size: 13px; }
.footer-links a:hover { color: var(--accent); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 11px 16px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; border-radius: var(--radius); color: #f7fffb; background: #1a2a22; box-shadow: var(--shadow); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1); }
.reveal[data-delay="1"] { transition-delay: .09s; }
.reveal[data-delay="2"] { transition-delay: .18s; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
    .site-header { grid-template-columns: 1fr auto auto; gap: 8px; }
    .nav-toggle { display: inline-grid; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 66px; padding: 8px; grid-template-columns: repeat(2, 1fr); box-shadow: var(--shadow); background: var(--bg); }
    .site-nav.is-open { display: grid; }
    .site-nav a { padding: 12px; }
    .home-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 60px; }
    .hero-copy { max-width: 750px; }
    .hero-visual { min-height: 500px; aspect-ratio: 16 / 10; }
    .statement-band { grid-template-columns: 1fr; min-height: 62vh; gap: 40px; }
    .statement-meta { align-self: start; }
    .about-grid { grid-template-columns: 1.4fr .8fr; }
    .about-note { grid-column: 2; }
    .tool-hero { padding-top: 60px; }
    .split-workspace { grid-template-columns: 1fr; }
    .qr-stage { min-height: 320px; }
}

@media (max-width: 700px) {
    :root { --header: 64px; }
    .site-header, .hero, .page-section, .workspace, .tool-hero, .site-footer, .statement-band { width: min(calc(100% - 28px), var(--max)); }
    .home-hero { gap: 38px; padding: 46px 0 52px; }
    .hero h1 { font-size: clamp(54px, 15vw, 72px); }
    .hero-lead { margin-top: 24px; }
    .hero-actions { align-items: stretch; }
    .hero-actions .button { flex: 1; }
    .hero-visual { min-height: 430px; aspect-ratio: .82 / 1; }
    .visual-caption { inset: auto 18px 16px; }
    .statement-band { min-height: 70vh; padding: 72px 0; }
    .statement-band > p { font-size: clamp(37px, 12vw, 55px); }
    .page-section { padding-block: 86px; }
    .about-grid { grid-template-columns: 1fr; gap: 20px; }
    .skill-cloud, .about-note { grid-column: auto; padding-top: 12px; }
    .about-intro h2, .section-heading h2 { font-size: clamp(37px, 11vw, 52px); }
    .tool-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .tool-card, .tool-card-featured, .tool-card-wide { min-height: 260px; grid-column: auto; grid-row: auto; }
    .tool-card-featured { min-height: 390px; }
    .closing-line { align-items: start; flex-direction: column; }
    .closing-line p { font-size: clamp(37px, 12vw, 58px); }
    .round-link { width: 68px; height: 68px; }
    .tool-hero { min-height: 360px; padding: 50px 0 44px; grid-template-columns: 1fr; gap: 30px; }
    .tool-hero h1 { font-size: clamp(52px, 16vw, 76px); }
    .privacy-note { width: 100%; }
    .workspace { padding-block: 36px 80px; }
    .clip-form, .editor-panel, .preview-panel, .password-workspace { padding: 18px; }
    .input-action-row { grid-template-columns: 1fr; }
    .form-options { align-items: stretch; flex-direction: column; }
    .compact-field { width: 100%; }
    .form-actions .button { flex: 1 1 42%; }
    .share-panel { grid-template-columns: 1fr; }
    .share-panel .qr-output { max-width: 220px; }
    .option-grid, .text-panels, .check-grid { grid-template-columns: 1fr; }
    .text-panels textarea { min-height: 280px; }
    .text-stats { grid-template-columns: repeat(2, 1fr); }
    .site-footer { min-height: 240px; flex-direction: column; }
    .footer-links { justify-content: start; }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #111713; --surface: #18221d; --surface-strong: #213029; --text: #edf3ef; --muted: #9aaba2; --line: #304039; --accent: #58c59c; --accent-strong: #77d5b1; --accent-soft: #183e30; --danger: #ed858a; --shadow: 0 24px 70px rgba(0,0,0,.3);
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
    .site-nav { backdrop-filter: none; background: var(--bg); }
}
