* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: #1f2937;
    background: #f7f8fa;
    line-height: 1.7;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.home-page,
.tool-page,
.category-page,
.error-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.hero {
    background: linear-gradient(135deg, #eef4ff, #f9fbff);
    border: 1px solid #dbeafe;
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 44px);
    color: #0f172a;
}

.hero p {
    margin: 0 auto 24px;
    max-width: 720px;
    color: #475569;
}

.search-box {
    display: block;
    max-width: 560px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 16px;
    outline: none;
    background: #fff;
}

.search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-empty {
    margin-top: 16px;
    color: #b45309;
}

.category-search {
    position: relative;
    max-width: 480px;
    margin: 0 0 32px;
}

.category-search::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 17px;
    width: 16px;
    height: 16px;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
    transform: translateY(-50%);
    pointer-events: none;
}

.category-search input {
    padding: 11px 16px 11px 44px;
    font-size: 15px;
}

.category-search-results > h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #0f172a;
}

.category-search-results .search-empty {
    margin: 0 0 16px;
}

.tool-card-category {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
}

.category-block {
    margin-top: 40px;
}

.category-heading h2,
.tool-steps h2,
.tool-sections h2,
.tool-faq h2,
.related-tools h2,
.comment-section h2 {
    margin: 0 0 8px;
    font-size: 26px;
    color: #0f172a;
}

.category-heading p {
    display: -webkit-box;
    margin: 0 0 24px;
    overflow: hidden;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.tool-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    text-decoration: none;
}

.tool-card h2,
.tool-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #0f172a;
}

.tool-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-page .category-block {
    margin-top: 56px;
}

.home-page .category-heading h2 {
    position: relative;
    padding-left: 14px;
}

.home-page .category-heading h2::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: #2563eb;
    transform: translateY(-50%);
}

.home-page .tool-card h3 {
    font-size: 18px;
    font-weight: 700;
}

.ad-slot {
    margin: 32px 0;
    min-height: 90px;
    overflow: hidden;
}

.ad-label {
    margin: 0 0 4px;
    font-size: 12px;
    color: #64748b;
}

.breadcrumb {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 18px;
}

.breadcrumb a {
    color: #64748b;
}

.breadcrumb span {
    margin: 0 6px;
}

.tool-page h1,
.category-page h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 38px);
    color: #0f172a;
}

.tool-summary {
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
}

.category-intro {
    display: -webkit-box;
    margin: 0 0 24px;
    overflow: hidden;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tool-app {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    margin: 24px 0;
}

.tool-widget {
    text-align: center;
    color: #475569;
}

.tool-widget [hidden] {
    display: none !important;
}

.upload-zone {
    border: 2px dashed #bfdbfe;
    border-radius: 16px;
    background: #f8fbff;
    padding: 40px 20px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
    outline: none;
}

.upload-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.upload-hint {
    margin: 8px 0 0;
    font-size: 14px;
    color: #64748b;
}

.tool-status {
    min-height: 22px;
    margin: 16px 0 0;
    font-size: 15px;
    color: #334155;
}

.tool-progress {
    height: 10px;
    margin-top: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.tool-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.3s ease;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.tool-download,
.tool-retry {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
}

.tool-download {
    background: #2563eb;
    color: #fff;
    border: none;
}

.tool-download:hover {
    background: #1d4ed8;
}

.tool-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-retry {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

.tool-retry:hover {
    border-color: #94a3b8;
}

.tool-noscript {
    margin: 0;
    padding: 14px 18px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
}

.tool-form {
    display: grid;
    gap: 18px;
    text-align: left;
}

.tool-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-field label,
.tool-field .tool-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.tool-input,
.tool-select,
.tool-output {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 15px;
    font-family: inherit;
}

.tool-textarea {
    min-height: 180px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.6;
}

.code-highlight {
    margin: 0;
    min-height: 200px;
    max-height: 520px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre;
}

.code-highlight:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.code-highlight code {
    font-family: inherit;
}

.code-highlight .token.comment,
.code-highlight .token.prolog,
.code-highlight .token.doctype,
.code-highlight .token.cdata {
    color: #8c8c8c;
    font-style: italic;
}

.code-highlight .token.punctuation,
.code-highlight .token.operator {
    color: #1f2937;
}

.code-highlight .token.property,
.code-highlight .token.key,
.code-highlight .token.symbol {
    color: #7c3aed;
}

.code-highlight .token.tag,
.code-highlight .token.keyword,
.code-highlight .token.atrule {
    color: #0033b3;
}

.code-highlight .token.attr-name {
    color: #174ad4;
}

.code-highlight .token.string,
.code-highlight .token.char,
.code-highlight .token.attr-value,
.code-highlight .token.inserted {
    color: #067d17;
}

.code-highlight .token.number,
.code-highlight .token.boolean,
.code-highlight .token.constant {
    color: #1750eb;
}

.code-highlight .token.function,
.code-highlight .token.class-name,
.code-highlight .token.selector,
.code-highlight .token.builtin {
    color: #00627a;
}

.code-highlight .token.regex,
.code-highlight .token.important,
.code-highlight .token.deleted {
    color: #b45309;
}

.code-highlight .token.important,
.code-highlight .token.bold {
    font-weight: 600;
}

.code-highlight .token.italic {
    font-style: italic;
}

.tool-input:focus,
.tool-select:focus,
.tool-output:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.tool-input[type="file"] {
    padding: 8px;
    background: #f8fbff;
}

.tool-range {
    width: 100%;
    accent-color: #2563eb;
}

.tool-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.code-indent-label {
    align-self: center;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.tool-actions-row .code-indent-select {
    width: auto;
    min-width: 132px;
}

.tool-hint {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.cron-examples {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 10px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.cron-example {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.cron-example-desc {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.cron-example-expr {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    white-space: nowrap;
}

.cron-example-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.cron-example .tool-retry {
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .cron-examples {
        grid-template-columns: 1fr;
    }

    .cron-example {
        flex-wrap: wrap;
    }

    .cron-example-desc {
        flex-basis: 100%;
    }

    .cron-example-actions {
        margin-left: auto;
    }
}

.tool-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.tool-field .tool-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    color: #334155;
    cursor: pointer;
}

.tool-check input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.tool-error {
    color: #b91c1c;
}

.tool-result {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

.tool-success {
    color: #047857;
}

.image-preview {
    width: fit-content;
    max-width: 640px;
    margin: 20px auto 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    text-align: center;
}

.image-preview:has(img[hidden]) {
    display: none;
}

.image-preview img {
    display: block;
    max-width: 100%;
    max-height: min(520px, 72vh);
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
}

.diff-view {
    margin-top: 20px;
    max-height: 520px;
    overflow: auto;
    border: 1px solid #e3e6eb;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.diff-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 2px 8px;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-row--same {
    background: #fff;
}

.diff-row--add {
    background: #e8f7ee;
}

.diff-row--remove {
    background: #fdeaea;
}

.diff-ln {
    flex: 0 0 44px;
    text-align: right;
    color: #94a3b8;
    user-select: none;
}

.diff-text {
    flex: 1;
    min-width: 0;
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 260px;
    border: 1px solid #e3e6eb;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.qr-batch-list {
    margin: 20px 0 0;
    padding: 0 0 0 22px;
    color: #374151;
    word-break: break-all;
}

.qr-batch-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eef1f5;
}

.qr-batch-list li > span {
    flex: 1;
    min-width: 0;
}

.qr-batch-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border: 1px solid #e3e6eb;
    border-radius: 8px;
    background: #f5f6f8;
    image-rendering: pixelated;
}

.image-grid-preview {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.image-grid-preview canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.image-grid-preview .image-grid-lines {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    max-width: none;
    pointer-events: none;
    border-radius: 10px;
}

.tool-value {
    font-weight: 400;
    color: #64748b;
}

.image-tool-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    margin-top: 18px;
}

.image-stage {
    position: relative;
    width: fit-content;
    max-width: 640px;
    margin: 18px auto 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
}

.image-stage canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(520px, 72vh);
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

.checkerboard {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.brush-cursor {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.65);
    pointer-events: none;
}

.bg-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bg-swatch {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
}

.bg-swatch.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.bg-swatches + .tool-check {
    margin-top: 10px;
}

.tool-check input[type="color"] {
    width: 34px;
    height: 28px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

#idp-preview {
    cursor: grab;
}

#idp-preview.is-dragging {
    cursor: grabbing;
}

.crop-stage {
    position: relative;
    width: fit-content;
    max-width: 640px;
    margin: 18px auto 0;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
}

.crop-stage canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(520px, 72vh);
    height: auto;
}

.crop-stage #crop-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.wm-file-list {
    display: grid;
    gap: 10px;
}

.wm-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.wm-file-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
    flex-shrink: 0;
}

.wm-file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.wm-file-name {
    font-size: 14px;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-file-size {
    font-size: 12px;
    color: #64748b;
}

.wm-file-item .tool-retry {
    padding: 6px 14px;
    font-size: 13px;
}

.st-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.st-item-actions .tool-retry {
    padding: 6px 10px;
    font-size: 13px;
}

.st-item-actions .tool-retry:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tool-field input[type="color"].tool-input {
    height: 42px;
    padding: 4px;
}

#wm-preview {
    cursor: default;
}

.tree-output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tree-view-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
}

.tree-view-btn {
    padding: 5px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.tree-view-btn.is-active {
    background: #2563eb;
    color: #fff;
}

.tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tree-actions .tool-retry {
    padding: 6px 14px;
    font-size: 13px;
}

.tree-view {
    max-height: 420px;
    overflow: auto;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
}

.tree-node-children {
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px dashed #cbd5e1;
}

.tree-node-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
}

.tree-node-toggle {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tree-node-toggle--spacer {
    cursor: default;
}

.tree-node-toggle:hover {
    color: #2563eb;
}

.tree-node.is-collapsed > .tree-node-children {
    display: none;
}

.tree-node-key {
    color: #7c3aed;
}

.tree-node-sep,
.tree-node-brace {
    color: #475569;
}

.tree-node-summary {
    color: #94a3b8;
    font-size: 12px;
}

.tree-node-string {
    color: #047857;
}

.tree-node-number {
    color: #b45309;
}

.tree-node-boolean {
    color: #2563eb;
}

.tree-node-null {
    color: #64748b;
    font-style: italic;
}

.ip-result-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.ip-result-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 14px;
}

.ip-result-table th,
.ip-result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    word-break: break-all;
}

.ip-result-table th {
    width: 120px;
    color: #4b5563;
    font-weight: 600;
}

.ip-raw {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.qr-canvas {
    display: inline-block;
    width: auto;
    max-width: 100%;
    max-height: min(520px, 72vh);
    height: auto;
    border-radius: 8px;
    image-rendering: pixelated;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 20px;
    text-align: left;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.stat-item span {
    font-size: 13px;
    color: #64748b;
}

.stat-item strong {
    font-size: 18px;
    color: #0f172a;
}

.compare-widget {
    text-align: left;
}

.compare-uploads {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.compare-upload-group {
    flex: 1;
    min-width: 240px;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f8fbff;
}

.compare-upload-btn {
    display: block;
    padding: 10px 18px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.compare-upload-btn:hover {
    background: #1d4ed8;
}

.compare-file-list {
    margin: 12px 0 0;
    padding-left: 18px;
    font-size: 14px;
    color: #475569;
    word-break: break-all;
}

p.compare-file-list {
    padding-left: 0;
}

.compare-params {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.compare-params label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.compare-params input {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
}

.compare-params input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.compare-result {
    margin-top: 24px;
}

.compare-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.compare-result-head h2 {
    margin: 0;
    font-size: 20px;
}

.compare-result .tool-actions {
    margin-top: 0;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.compare-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 14px;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.compare-table thead {
    background: #f3f4f6;
}

.compare-summary {
    margin-top: 16px;
}

.compare-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.compare-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
}

.compare-stat span {
    font-size: 13px;
    color: #64748b;
}

.compare-stat strong {
    font-size: 20px;
    color: #0f172a;
}

.compare-doc-stats {
    margin: 12px 0 0;
    padding-left: 18px;
    font-size: 14px;
    color: #475569;
}

.compare-highlights {
    margin-top: 24px;
}

.compare-highlights h3 {
    margin: 0;
    font-size: 18px;
}

.compare-hint {
    margin: 8px 0 0;
    font-size: 14px;
    color: #64748b;
}

.compare-highlight-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.compare-highlight {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.compare-highlight-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

.compare-highlight-head strong {
    color: #0f172a;
}

.compare-highlight-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.compare-context {
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
}

.compare-context-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.compare-context p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.compare-context mark {
    padding: 0 2px;
    background: #fde68a;
    color: #7c2d12;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .compare-highlight-columns {
        grid-template-columns: 1fr;
    }
}

.compare-widget [hidden] {
    display: none !important;
}



.tool-steps,
.tool-sections,
.tool-faq,
.related-tools {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    margin-top: 24px;
}

.tool-steps ol {
    margin: 12px 0 0;
    padding-left: 24px;
}

.tool-steps li {
    margin-bottom: 10px;
}

.tool-section + .tool-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.tool-section h2 {
    font-size: 22px;
}

.tool-section p,
.faq-item p {
    margin: 8px 0 0;
    color: #475569;
}

.faq-item + .faq-item {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}

.faq-item h3 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.related-tools ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related-tools a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
}

.comment-section {
    margin-top: 48px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
}

.comment-section .container {
    width: 100%;
}

.comment-form {
    display: grid;
    gap: 10px;
    margin: 16px 0 24px;
}

.comment-form label {
    font-weight: 600;
    font-size: 14px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
}

.comment-form textarea {
    min-height: 110px;
    resize: vertical;
}

.comment-form button {
    justify-self: start;
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.comment-form button:hover {
    background: #1d4ed8;
}

.comment-item {
    padding: 14px 0;
    border-top: 1px solid #eef2f7;
}

.comment-item p {
    margin: 6px 0;
    color: #334155;
}

.comment-item .time {
    color: #94a3b8;
    font-size: 13px;
}

.error-page {
    text-align: center;
    padding-top: 96px;
}

.error-page h1 {
    font-size: 36px;
    margin-bottom: 12px;
}

.error-page p {
    color: #475569;
}

@media (max-width: 768px) {
    .home-page,
    .tool-page,
    .category-page,
    .error-page {
        width: calc(100% - 24px);
        padding-top: 24px;
    }

    .hero {
        padding: 32px 18px;
    }

    .home-page .category-block {
        margin-top: 40px;
    }

    .tool-app,
    .tool-steps,
    .tool-sections,
    .tool-faq,
    .related-tools,
    .comment-section {
        padding: 20px;
        border-radius: 16px;
    }

    .tool-input,
    .tool-select,
    .tool-output,
    .tool-actions-row .tool-download {
        width: 100%;
    }

    .tool-actions-row {
        flex-wrap: wrap;
    }

    .image-preview {
        max-width: 500px;
    }

    .image-preview img,
    .qr-canvas {
        max-height: min(450px, 70vh);
    }

    .image-tool-row {
        grid-template-columns: 1fr;
    }

    .image-stage,
    .crop-stage {
        max-width: 500px;
    }

    .image-stage canvas,
    .crop-stage canvas {
        max-height: min(450px, 70vh);
    }
}

@media (max-width: 480px) {
    .image-preview {
        max-width: 360px;
    }

    .image-preview img,
    .qr-canvas {
        max-height: min(460px, 70vh);
    }

    .image-stage,
    .crop-stage {
        max-width: 360px;
    }

    .image-stage canvas,
    .crop-stage canvas {
        max-height: min(460px, 70vh);
    }
}

.pdf-drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    padding: 16px;
    border: 2px dashed #c7ccd4;
    border-radius: 12px;
    background: #fafbfc;
    color: #5b6472;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pdf-drop-zone:hover,
.pdf-drop-zone.is-dragging {
    border-color: #2f6fed;
    background: #f2f6ff;
}

.pdf-file-list {
    list-style: none;
    margin: 12px 0;
    padding: 0;
}

.pdf-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e3e6eb;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
}

.pdf-file-name {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.pdf-file-meta {
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pdf-file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pdf-file-actions .btn {
    padding: 4px 8px;
    border: 1px solid #d5d9e0;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.pdf-file-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-status.is-error {
    color: #c62828;
}

.pdf-file-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e3e6eb;
    background: #f5f6f8;
    flex-shrink: 0;
}

#pw-preview {
    display: block;
    width: 360px;
    max-width: 100%;
    height: auto;
    align-self: flex-start;
    border: 1px solid #e3e6eb;
    border-radius: 8px;
    background: #f5f6f8;
}

.tool-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
