:root {
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --quiet: #86868b;
    --line: #d9d9df;
    --soft-line: #e7e7ec;
    --page: #fbfbfd;
    --card: #ffffff;
    --blue: #0071e3;
    --blue-dark: #0062c4;
    --blue-soft: #eef7ff;
    --amber: #8a5a00;
    --amber-soft: #fff7e6;
    --red: #c9342d;
    --red-soft: #fff1f0;
    --radius: 18px;
    --shadow: 0 14px 42px rgba(25, 28, 36, 0.07);
    --text-meta: 13px;
    --text-control: 14px;
    --text-body: 16px;
    --text-section: 20px;
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.28);
    outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, fieldset { margin: 0; }
fieldset { min-width: 0; padding: 0; border: 0; }
[hidden] { display: none !important; }

.tool-header {
    height: 64px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(210, 210, 215, 0.78);
}

.tool-header-inner,
.tool-shell {
    width: min(1180px, calc(100% - 64px));
    margin-inline: auto;
}

.tool-header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ink);
    border-radius: 9px;
    font-size: 15px;
    font-weight: 760;
}

.home-link { color: var(--muted); font-size: var(--text-control); }
.home-link::before { content: "←"; margin-right: 7px; }
.tool-shell { padding: 50px 0 74px; }

.status-panel {
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.status-panel h1 { margin-top: 20px; font-size: 28px; line-height: 1.25; }
.status-panel p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.status-panel .button { margin-top: 24px; }
#toolUnavailable h1 { margin-top: 0; }

.status-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dfe8f1;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tool-title-row { max-width: 790px; }
.tool-title-row h1 { font-size: 36px; line-height: 1.18; letter-spacing: -0.035em; }
.tool-title-row p { margin-top: 11px; color: var(--muted); font-size: var(--text-body); line-height: 1.6; }

.workspace-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(340px, 0.78fr);
    align-items: start;
    gap: 24px;
}

.control-column { min-width: 0; display: grid; gap: 16px; }

.control-card,
.preview-card {
    background: var(--card);
    border: 1px solid var(--soft-line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(25, 28, 36, 0.045);
}

.control-card { padding: 22px 24px 24px; }

.section-heading,
.range-label-row,
.preview-heading,
.download-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading { margin-bottom: 18px; }
.section-heading.is-collapsed { margin-bottom: 0; }
.section-heading h2, .preview-heading h2 { font-size: var(--text-section); letter-spacing: -0.02em; }
.section-heading > span, .range-label-row > span, .range-label-row output { color: var(--quiet); font-size: var(--text-meta); }
.section-heading p, .preview-heading p { margin-top: 3px; color: var(--quiet); font-size: var(--text-meta); }

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #3b3b40;
    font-size: var(--text-control);
    font-weight: 650;
}

.text-input,
.select-input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cfd0d6;
    border-radius: 10px;
    font-size: var(--text-control);
}

.text-input:hover, .select-input:hover { border-color: #aeb0b7; }
.text-input:focus, .select-input:focus { border-color: #8f9098; box-shadow: none; }
.textarea-input { min-height: 88px; padding-block: 11px; resize: vertical; line-height: 1.5; }
.number-input { font-variant-numeric: tabular-nums; }
.field-hint { margin-top: 7px; color: var(--quiet); font-size: var(--text-meta); }
.field-error { margin-top: 9px; color: var(--red); font-size: var(--text-meta); line-height: 1.5; }

.content-tabs {
    margin-bottom: 17px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    background: #f1f2f4;
    border-radius: 12px;
}

.content-tabs button {
    min-height: 40px;
    padding: 0 14px;
    color: var(--muted);
    background: transparent;
    border: 2px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: var(--text-control);
    font-weight: 650;
}

.content-tabs button[aria-selected="true"] {
    color: #005fbf;
    background: #fff;
    box-shadow: 0 2px 8px rgba(25, 28, 36, 0.09);
}

.field-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-group { min-width: 0; }

.color-field {
    min-height: 44px;
    padding: 4px 10px 4px 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #cfd0d6;
    border-radius: 10px;
    cursor: pointer;
}

.color-field:hover, .color-field:focus-within { border-color: #aeb0b7; }

.color-field input {
    width: 42px;
    height: 34px;
    padding: 2px;
    background: #fff;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.color-field output { color: var(--muted); font-size: var(--text-control); font-variant-numeric: tabular-nums; pointer-events: none; }
.range-field { margin-top: 18px; }
.range-label-row .field-label { margin-bottom: 0; }
.range-field input[type="range"] { width: 100%; height: 36px; margin-top: 4px; accent-color: var(--blue); cursor: pointer; }

.message {
    padding: 11px 13px;
    border-radius: 10px;
    font-size: var(--text-meta);
    line-height: 1.5;
}

.message { margin-top: 12px; }
.message-warning { color: var(--amber); background: var(--amber-soft); }

.margin-field { margin-top: 19px; }

.text-button {
    min-height: 36px;
    padding: 0 8px;
    color: var(--blue);
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: var(--text-control);
    font-weight: 650;
}

.upload-button {
    width: 100%;
    min-height: 82px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: var(--ink);
    background: #fbfbfc;
    border: 1.5px dashed #b8bac2;
    border-radius: 13px;
    cursor: pointer;
    text-align: left;
}

.upload-button:hover { border-color: var(--blue); background: #f7fbff; }
.upload-symbol { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 11px; font-size: 23px; }
.upload-button strong, .upload-button small { display: block; }
.upload-button strong { font-size: var(--text-control); }
.upload-button small { margin-top: 3px; color: var(--quiet); font-size: var(--text-meta); }

.logo-settings { margin-top: 16px; }
.logo-file-row { padding: 10px; display: flex; align-items: center; gap: 12px; background: #f7f8fa; border-radius: 12px; }
.logo-file-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; background: #fff; }
.logo-file-row div { min-width: 0; flex: 1; }
.logo-file-row strong, .logo-file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-file-row strong { font-size: var(--text-control); }
.logo-file-row small { margin-top: 3px; color: var(--quiet); font-size: var(--text-meta); }

.check-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.check-row label { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--text-control); }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.logo-background-field { margin-top: 13px; max-width: 320px; }
.logo-fit-field { margin-top: 14px; }

.segmented-control {
    min-height: 44px;
    padding: 3px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    background: #f1f2f4;
    border-radius: 11px;
}

.segmented-control button {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    color: var(--muted);
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: var(--text-control);
    font-weight: 650;
}

.segmented-control button[aria-pressed="true"] {
    color: #005fbf;
    background: #fff;
    box-shadow: 0 2px 8px rgba(25, 28, 36, 0.09);
}

.toggle-heading { align-items: flex-start; }
.switch-control { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--text-control); white-space: nowrap; }
.switch-control input { position: absolute; opacity: 0; }
.switch-control > span { width: 42px; height: 24px; padding: 3px; display: flex; align-items: center; background: #c7c8ce; border-radius: 999px; transition: background 0.18s ease; }
.switch-control > span::after { content: ""; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform 0.18s ease; }
.switch-control input:checked + span { background: var(--blue); }
.switch-control input:checked + span::after { transform: translateX(18px); }
.switch-control input:focus-visible + span { outline: 3px solid rgba(0, 113, 227, 0.28); outline-offset: 3px; }
#styleSettings, #logoControls, #textSettings { padding-top: 2px; }
.text-options-grid { margin-top: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.text-range-field { margin-top: 15px; }
.text-color-field { max-width: 320px; margin-top: 16px; }

.size-options { display: flex; flex-wrap: wrap; gap: 9px; }
.size-option { position: relative; cursor: pointer; }
.size-option input { position: absolute; opacity: 0; }
.size-option span { min-width: 62px; min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: #f5f5f7; border: 1px solid transparent; border-radius: 999px; font-size: var(--text-control); font-variant-numeric: tabular-nums; }
.size-option input:checked + span { color: #005fbf; background: var(--blue-soft); border-color: #83bfff; font-weight: 650; }
.size-option input:focus-visible + span { outline: 3px solid rgba(0, 113, 227, 0.28); outline-offset: 2px; }

.custom-size-row { margin-top: 18px; padding-top: 17px; border-top: 1px solid #ececf0; }
.custom-size-row > div { display: grid; grid-template-columns: minmax(0, 170px) auto; gap: 10px; }

.button {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: var(--text-control);
    font-weight: 650;
}

.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { color: #3b3b40; background: #fff; border-color: #cfd0d6; }
.button:disabled { color: #9c9ca2; background: #e5e5e9; border-color: transparent; cursor: not-allowed; }
.preview-column { min-width: 0; position: sticky; top: 24px; }
.preview-card { padding: 22px; box-shadow: var(--shadow); }
.preview-heading { align-items: flex-start; }

.preview-stage {
    min-height: 360px;
    margin-top: 18px;
    padding: 18px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background-color: #f4f5f7;
    background-image: linear-gradient(45deg, #e9eaed 25%, transparent 25%), linear-gradient(-45deg, #e9eaed 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9eaed 75%), linear-gradient(-45deg, transparent 75%, #e9eaed 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    border-radius: 15px;
}

.preview-stage canvas { display: block; width: 100%; height: auto; max-height: 540px; object-fit: contain; box-shadow: 0 12px 30px rgba(25, 28, 36, 0.14); }
.preview-placeholder { display: flex; flex-direction: column; align-items: center; gap: 15px; color: var(--quiet); font-size: var(--text-control); text-align: center; }
.mini-qr { width: 82px; height: 82px; padding: 9px; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 5px; background: #fff; border-radius: 14px; box-shadow: 0 10px 26px rgba(25,28,36,.08); }
.mini-qr::before, .mini-qr::after, .mini-qr i { content: ""; border: 4px solid #70747b; border-radius: 3px; }
.mini-qr::before { grid-column: 1 / 3; grid-row: 1 / 3; }
.mini-qr::after { grid-column: 4 / 6; grid-row: 1 / 3; }
.mini-qr i:first-child { grid-column: 1 / 3; grid-row: 4 / 6; }
.mini-qr i:nth-child(2) { grid-column: 3; grid-row: 3; border: 0; background: #9da0a6; }
.mini-qr i:nth-child(3) { grid-column: 4 / 6; grid-row: 4 / 6; border: 0; background: repeating-linear-gradient(90deg, #9da0a6 0 5px, transparent 5px 9px); }

.download-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e9e9ee; }
.download-heading { align-items: center; }
.download-heading h3 { font-size: 17px; }
.download-heading .button { min-height: 40px; padding-inline: 14px; }
.download-list { margin-top: 12px; display: grid; gap: 8px; }
.download-item { min-height: 48px; padding: 7px 8px 7px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f7f8fa; border-radius: 11px; }
.download-item-copy { min-width: 0; font-size: var(--text-control); font-variant-numeric: tabular-nums; }
.download-item small { margin-left: 5px; color: var(--quiet); font-size: var(--text-meta); }
.download-item em { margin-top: 3px; display: block; font-size: var(--text-meta); font-style: normal; line-height: 1.45; }
.download-item-warning { color: var(--amber); }
.download-item-error { color: var(--red); }
.download-item.is-invalid { background: var(--red-soft); }
.download-item .button { min-height: 36px; padding-inline: 13px; flex: 0 0 auto; align-self: center; }
.download-message { margin-top: 10px; color: var(--red); font-size: var(--text-meta); line-height: 1.5; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .preview-column { position: static; }
    .preview-card { box-shadow: 0 8px 28px rgba(25, 28, 36, 0.045); }
}

@media (max-width: 640px) {
    .tool-header-inner, .tool-shell { width: min(100% - 28px, 1180px); }
    .tool-shell { padding: 34px 0 54px; }
    .tool-title-row h1 { font-size: 30px; }
    .workspace-grid { margin-top: 24px; gap: 16px; }
    .control-card, .preview-card { padding: 19px 17px 20px; border-radius: 16px; }
    .two-columns, .text-options-grid { grid-template-columns: 1fr 1fr; }
    .preview-stage { min-height: 310px; padding: 12px; }
}

@media (max-width: 420px) {
    .home-link { font-size: 13px; }
    .tool-title-row h1 { font-size: 28px; }
    .tool-title-row p { font-size: 15px; }
    .two-columns, .text-options-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; }
    .custom-size-row > div { grid-template-columns: minmax(0, 1fr); }
    .download-heading { align-items: flex-start; flex-direction: column; }
    .download-heading .button { width: 100%; }
    .preview-stage { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* 服务端可抓取的页面说明与 FAQ */
.tool-page-intro { width: 100%; max-width: none; margin-bottom: 32px; }
.tool-page-intro h1 { font-size: 36px; line-height: 1.18; letter-spacing: -0.035em; }
.tool-page-intro p { margin-top: 12px; color: var(--muted); line-height: 1.75; }
.status-panel h2 { margin-top: 20px; font-size: 28px; line-height: 1.25; }
#toolUnavailable h2 { margin-top: 0; }
.seo-faq { width: 100%; max-width: none; margin: 64px 0 0; }
.seo-faq h2 { margin-bottom: 20px; font-size: 26px; letter-spacing: -0.025em; }
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--card); border: 1px solid var(--soft-line); border-radius: 14px; }
.faq-item summary { min-height: 48px; padding: 14px 48px 14px 18px; cursor: pointer; font-weight: 650; position: relative; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "＋"; position: absolute; right: 18px; top: 14px; color: var(--quiet); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 18px 18px; color: var(--muted); line-height: 1.75; }
@media (max-width: 640px) {
    .tool-page-intro h1 { font-size: 30px; }
    .tool-page-intro { margin-bottom: 24px; }
    .seo-faq { margin-top: 44px; }
    .seo-faq h2 { font-size: 23px; }
}
