.fans-tool-page {
    --tool-accent: #2563eb;
    --tool-accent-dark: #1d4ed8;
    --tool-accent-soft: #eff6ff;
    --tool-ink: #172033;
    --tool-muted: #64748b;
    --tool-border: #e2e8f0;
    --tool-surface: #ffffff;
    --tool-bg: #f8fafc;
    background: var(--tool-bg);
    color: var(--tool-ink);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 42px max(18px, calc((100vw - 1140px) / 2)) 72px;
}

.fans-tool-page.theme-yalixiang {
    --tool-accent: #7c3aed;
    --tool-accent-dark: #6d28d9;
    --tool-accent-soft: #f5f3ff;
    --tool-bg: #fbfaff;
}

.fans-tool-page.theme-zfensi {
    --tool-accent: #16865a;
    --tool-accent-dark: #106b48;
    --tool-accent-soft: #ecfdf5;
    --tool-bg: #f6fcf9;
}

.tool-shell { width: 100%; max-width: 1140px; margin: 0 auto; }
.tool-breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; color: var(--tool-muted); font-size: 14px; }
.tool-breadcrumb a { color: var(--tool-accent); text-decoration: none; }
.tool-hero { max-width: 780px; margin-bottom: 28px; }
.tool-eyebrow { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--tool-accent-soft); color: var(--tool-accent-dark); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.tool-title { margin: 14px 0 10px; color: var(--tool-ink); font-size: clamp(30px, 5vw, 48px); font-weight: 800; line-height: 1.15; }
.tool-section-heading { margin: 14px 0 8px; color: var(--tool-ink); font-size: clamp(25px, 4vw, 34px); font-weight: 800; }
.tool-lead { margin: 0; color: var(--tool-muted); font-size: 17px; line-height: 1.8; }
.tool-privacy { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; color: #3f556f; font-size: 14px; }
.tool-privacy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }

.tool-card,
.tool-editor-card,
.tool-guide-card { background: var(--tool-surface); border: 1px solid var(--tool-border); border-radius: 22px; box-shadow: 0 14px 34px rgba(15, 23, 42, .06); }
.tool-card { display: flex; flex-direction: column; min-height: 220px; padding: 24px; color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.tool-card:hover { color: inherit; text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--tool-accent) 30%, white); box-shadow: 0 18px 40px rgba(15, 23, 42, .1); }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 15px; background: var(--tool-accent-soft); color: var(--tool-accent-dark); font-size: 22px; font-weight: 800; }
.tool-card h2 { margin: 0 0 9px; color: var(--tool-ink); font-size: 20px; font-weight: 750; }
.tool-card p { margin: 0 0 20px; color: var(--tool-muted); line-height: 1.7; }
.tool-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; color: var(--tool-accent-dark); font-weight: 700; font-size: 14px; }
.tool-status { padding: 5px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 12px; }
.tool-card.is-planned { box-shadow: none; }
.tool-card.is-planned .tool-card-icon { background: #f1f5f9; color: #64748b; }
.tool-card.is-planned .tool-card-foot { color: #64748b; }

.tool-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.tool-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; color: #334155; cursor: pointer; user-select: none; }
.tool-check input { width: 18px; height: 18px; accent-color: var(--tool-accent); }
.tool-editors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.tool-editor-card { overflow: hidden; }
.tool-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--tool-border); }
.tool-editor-head h2 { margin: 0; color: var(--tool-ink); font-size: 16px; font-weight: 750; }
.tool-editor-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tool-textarea { display: block; width: 100%; min-height: 390px; resize: vertical; padding: 18px; border: 0; outline: 0; background: #fff; color: #1e293b; font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool-textarea:focus { box-shadow: inset 0 0 0 2px var(--tool-accent); }
.tool-textarea::placeholder { color: #94a3b8; }
.tool-md-editor { min-height: 520px; }
.tool-md-preview {
    min-height: 520px;
    padding: 24px;
    overflow-wrap: anywhere;
    background: #fff;
    color: #273449;
    line-height: 1.75;
}
.tool-md-preview > :first-child { margin-top: 0; }
.tool-md-preview > :last-child { margin-bottom: 0; }
.tool-md-preview h1,
.tool-md-preview h2,
.tool-md-preview h3,
.tool-md-preview h4 { margin: 1.35em 0 .55em; color: var(--tool-ink); font-weight: 780; line-height: 1.3; }
.tool-md-preview h1 { padding-bottom: .35em; border-bottom: 1px solid var(--tool-border); font-size: 2em; }
.tool-md-preview h2 { padding-bottom: .3em; border-bottom: 1px solid var(--tool-border); font-size: 1.55em; }
.tool-md-preview h3 { font-size: 1.25em; }
.tool-md-preview p,
.tool-md-preview ul,
.tool-md-preview ol,
.tool-md-preview blockquote,
.tool-md-preview pre,
.tool-md-preview table { margin: 0 0 1.1em; }
.tool-md-preview a { color: var(--tool-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.tool-md-preview blockquote { padding: 10px 16px; border-left: 4px solid var(--tool-accent); background: var(--tool-accent-soft); color: #475569; }
.tool-md-preview code { padding: .15em .38em; border-radius: 6px; background: #eef2f7; color: #be123c; font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool-md-preview pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: #162033; color: #e5edf8; }
.tool-md-preview pre code { padding: 0; background: transparent; color: inherit; }
.tool-md-preview img { max-width: 100%; height: auto; border-radius: 10px; }
.tool-md-preview table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.tool-md-preview th,
.tool-md-preview td { padding: 8px 12px; border: 1px solid var(--tool-border); text-align: left; }
.tool-md-preview th { background: #f8fafc; }
.tool-md-empty { display: grid; place-items: center; min-height: 470px; color: #94a3b8; text-align: center; }
.tool-editor-meta { padding: 9px 18px; border-top: 1px solid var(--tool-border); background: #fafcff; color: var(--tool-muted); font-size: 12px; }
.tool-form-card { padding: 22px; background: var(--tool-surface); border: 1px solid var(--tool-border); border-radius: 22px; box-shadow: 0 14px 34px rgba(15, 23, 42, .06); }
.tool-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool-form-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.tool-field.is-full { grid-column: 1 / -1; }
.tool-field > label,
.tool-field-label { margin: 0; color: #334155; font-size: 14px; font-weight: 750; }
.tool-input,
.tool-select,
.tool-output {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--tool-border);
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: var(--tool-ink);
    font: inherit;
}
.tool-input:focus,
.tool-select:focus,
.tool-output:focus { border-color: var(--tool-accent); box-shadow: 0 0 0 3px var(--tool-accent-soft); }
textarea.tool-input,
textarea.tool-output { min-height: 180px; resize: vertical; line-height: 1.65; }
.tool-input.is-compact { min-height: 110px; }
.tool-help { margin: 0; color: var(--tool-muted); font-size: 12px; line-height: 1.55; }
.tool-section-title { margin: 0 0 16px; color: var(--tool-ink); font-size: 18px; font-weight: 780; }
.tool-result-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--tool-border); border-radius: 16px; background: #fbfdff; }
.tool-result-panel h2 { margin: 0 0 12px; color: var(--tool-ink); font-size: 17px; }
.tool-result-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tool-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tool-metric { padding: 15px; border: 1px solid var(--tool-border); border-radius: 13px; background: #fff; }
.tool-metric strong { display: block; color: var(--tool-ink); font-size: clamp(19px, 3vw, 26px); line-height: 1.25; overflow-wrap: anywhere; }
.tool-metric span { display: block; margin-top: 5px; color: var(--tool-muted); font-size: 12px; }
.tool-progress { height: 10px; margin: 13px 0 7px; overflow: hidden; border-radius: 999px; background: #e8edf4; }
.tool-progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--tool-accent); transition: width .2s ease; }
.tool-progress > span.is-warning { background: #f59e0b; }
.tool-progress > span.is-danger { background: #ef4444; }
.tool-result-message { margin: 0; color: var(--tool-muted); font-size: 14px; }
.tool-result-message.is-success { color: #15803d; }
.tool-result-message.is-danger { color: #dc2626; }
.tool-inline-options { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 16px 0; }
.tool-inline-options .tool-field { flex: 1 1 170px; }
.tool-preview-list { margin: 0; padding-left: 20px; color: #475569; line-height: 1.8; }
.tool-big-result { padding: 18px; border-radius: 14px; background: var(--tool-accent-soft); color: var(--tool-accent-dark); font-size: clamp(22px, 4vw, 34px); font-weight: 800; overflow-wrap: anywhere; }
.tool-code-result { min-height: 170px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border-radius: 12px; background: #162033; color: #e7eef9; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool-qr-stage { display: grid; place-items: center; min-height: 300px; padding: 20px; border: 1px dashed var(--tool-border); border-radius: 16px; background: #fff; }
.tool-qr-stage canvas { max-width: 100%; height: auto; }
.tool-strength { display: flex; gap: 5px; margin-top: 9px; }
.tool-strength span { flex: 1; height: 7px; border-radius: 99px; background: #e2e8f0; }
.tool-strength span.is-on { background: var(--tool-accent); }
.tool-diff { max-height: 520px; overflow: auto; border: 1px solid var(--tool-border); border-radius: 12px; background: #fff; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool-diff-line { display: block; padding: 3px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-diff-line.is-add { background: #dcfce7; color: #166534; }
.tool-diff-line.is-remove { background: #fee2e2; color: #991b1b; }
.tool-diff-line.is-same { color: #64748b; }
.tool-data-list { display: grid; gap: 9px; margin: 0; }
.tool-data-row { display: grid; grid-template-columns: minmax(120px, .35fr) 1fr; gap: 12px; padding: 10px 12px; border: 1px solid var(--tool-border); border-radius: 10px; background: #fff; }
.tool-data-row dt { color: var(--tool-muted); font-size: 13px; font-weight: 700; }
.tool-data-row dd { margin: 0; color: var(--tool-ink); overflow-wrap: anywhere; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 15px; border: 1px solid var(--tool-border); border-radius: 11px; background: #fff; color: #334155; font: inherit; font-weight: 700; cursor: pointer; transition: .15s ease; }
.tool-btn:hover { border-color: var(--tool-accent); color: var(--tool-accent-dark); }
.tool-btn-primary { border-color: var(--tool-accent); background: var(--tool-accent); color: #fff; }
.tool-btn-primary:hover { background: var(--tool-accent-dark); color: #fff; }
.tool-btn-danger:hover { border-color: #ef4444; color: #dc2626; }
.tool-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.tool-stat { min-width: 0; padding: 14px 12px; border: 1px solid var(--tool-border); border-radius: 14px; background: #fff; text-align: center; }
.tool-stat strong { display: block; color: var(--tool-ink); font-size: 23px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.tool-stat span { display: block; margin-top: 5px; color: var(--tool-muted); font-size: 12px; }
.tool-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-feedback { min-height: 24px; margin: 10px 0 0; color: var(--tool-accent-dark); font-size: 14px; font-weight: 650; }
.tool-guide-card { margin-top: 22px; padding: 24px; }
.tool-guide-card h2 { margin: 0 0 12px; color: var(--tool-ink); font-size: 22px; }
.tool-guide-card ol { margin: 0; padding-left: 22px; color: var(--tool-muted); line-height: 1.9; }

@media (max-width: 900px) {
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-editors { grid-template-columns: 1fr; }
    .tool-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tool-textarea { min-height: 280px; }
    .tool-md-editor, .tool-md-preview { min-height: 360px; }
    .tool-md-empty { min-height: 310px; }
    .tool-form-grid,
    .tool-form-grid.is-three { grid-template-columns: 1fr; }
    .tool-field.is-full { grid-column: auto; }
    .tool-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
    .fans-tool-page { padding-top: 28px; padding-bottom: 48px; }
    .tool-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: 190px; }
    .tool-toolbar { gap: 4px 16px; }
    .tool-editor-head { align-items: flex-start; flex-direction: column; }
    .tool-editor-actions { width: 100%; }
    .tool-editor-actions .tool-btn { flex: 1; }
    .tool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-action-row .tool-btn { flex: 1 1 calc(50% - 5px); }
    .tool-form-card { padding: 16px; }
    .tool-metrics { grid-template-columns: 1fr 1fr; }
    .tool-result-actions .tool-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .tool-card, .tool-btn { transition: none; }
}
