* { box-sizing: border-box; }
body {
    min-width: 320px;
    color: #333;
    background: radial-gradient(#dcebe6 15%, transparent 15%) 0 0,
        radial-gradient(#dcebe6 15%, transparent 15%) 30px 30px,
        radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 0 1px,
        radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 30px 30px #edf3f1;
    background-size: 50px 50px;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
}
.text-difference.container { width: 96%; max-width: none; padding-top: 70px; padding-bottom: 45px; }
.page-heading { margin: 0 0 18px; padding: 0 5px; }
.page-heading h1 { margin: 0 0 7px; font-size: 28px; font-weight: 600; }
.page-heading p { margin: 0; color: #777; font-size: 14px; }
.tool-card {
    margin-bottom: 18px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e4e9e7;
    border-radius: 5px;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12);
}
.tool-options, .compare-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-options { margin-bottom: 12px; }
.ignore-option { margin: 0; color: #555; font-size: 14px; font-weight: 400; cursor: pointer; }
.ignore-option input { margin: 0 5px 0 0; vertical-align: middle; }
.top-actions, .panel-actions { display: flex; align-items: center; gap: 6px; }
.swap-button, .panel-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 10px; border: 1px solid #d6e3df; border-radius: 6px; background: #fff; color: #42645d; font-size: 13px; line-height: 1.4; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.swap-button:hover, .panel-action:hover { border-color: #8bbeb3; background: #eaf6f2; color: #245e54; }
.swap-button:focus-visible, .panel-action:focus-visible { outline: 2px solid #4aaecb; outline-offset: 2px; }
.clear-action { color: #a65853; }
.clear-action:hover { border-color: #e2b7b3; background: #fff1f0; color: #973d38; }
.compare-summary { min-height: 32px; margin-bottom: 12px; padding: 6px 10px; background: #f6f9f8; border-radius: 4px; }
.compare-summary p { margin: 0; color: #60736e; font-size: 13px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.input-panel { min-width: 0; }
.panel-toolbar { position: sticky; top: 50px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 8px 12px; border: 1px solid #d4ddda; border-radius: 6px 6px 0 0; background: #f7faf9; }
.panel-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel-title label { margin: 0; color: #334d47; font-size: 15px; font-weight: 600; white-space: nowrap; }
.text-count { color: #888; font-size: 12px; white-space: nowrap; }
.editor-shell { position: relative; min-height: 400px; overflow: hidden; border: 1px solid #d4ddda; border-top: 0; border-radius: 0 0 6px 6px; background: #fff; }
.line-gutter, .editor-backdrop, .editor-shell textarea.form-control { position: absolute; top: 0; bottom: 0; font: 13px/22px Consolas, Monaco, "Courier New", monospace; font-variant-ligatures: none; tab-size: 4; }
.line-gutter { left: 0; width: 44px; overflow: hidden; padding: 12px 0; color: #99a7a4; background: #f8faf9; border-right: 1px solid #e4e9e7; text-align: right; pointer-events: none; }
.gutter-line { height: 22px; padding-right: 8px; }
.gutter-line.old { color: #a94442; background: #fff0f0; }
.gutter-line.new { color: #34784b; background: #eff9f0; }
.editor-backdrop { right: 0; left: 44px; overflow: hidden; pointer-events: none; }
.highlight-content { width: 100%; padding: 12px 11px; color: transparent; }
.highlight-line { min-height: 22px; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-all; }
.highlight-line.old { background: #fff0f0; }
.highlight-line.new { background: #eff9f0; }
.highlight-line mark { padding: 0; color: transparent; background: #f9c8c8; }
.highlight-line.new mark { background: #bde6c4; }
.editor-shell textarea.form-control {
    right: 0;
    left: 44px;
    width: calc(100% - 44px);
    height: 100%;
    margin: 0;
    padding: 12px 11px;
    resize: none;
    overflow: hidden;
    color: #333;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-all;
}
.editor-shell textarea.form-control:focus { box-shadow: none; }
.editor-shell textarea.drag-over { background: rgba(240, 251, 254, .9); }
.text-diff-file-picker[hidden] { display: none !important; }
.file-message { min-height: 0; margin: 10px 0 0; color: #a14e34; font-size: 13px; }
.file-message:empty { display: none; }
.legend { display: flex; gap: 8px; font-size: 12px; }
.legend span { padding: 3px 8px; border-radius: 3px; }
.legend-old { color: #a94442; background: #fce8e8; }
.legend-new { color: #34784b; background: #e8f6eb; }
.result-note { margin: 10px 0 0; color: #888; font-size: 12px; }
.result-note:empty { display: none; }
@media (min-width: 768px) and (max-width: 900px) {
    .panel-toolbar { flex-wrap: wrap; }
    .panel-actions { width: 100%; }
    .panel-action { flex: 1; }
}
@media (max-width: 767px) {
    .text-difference.container { width: 100%; padding: 62px 12px 28px; }
    .page-heading h1 { font-size: 24px; }
    .tool-card { padding: 14px; }
    .input-grid { grid-template-columns: 1fr; }
    .line-gutter { width: 36px; }
    .editor-backdrop, .editor-shell textarea.form-control { left: 36px; }
    .editor-shell textarea.form-control { width: calc(100% - 36px); }
}
@media (max-width: 480px) {
    .panel-toolbar { flex-wrap: wrap; }
    .panel-actions { width: 100%; }
    .panel-action { flex: 1; }
}
