:root { color-scheme: light; --blue:#3b82f6; --blue-dark:#2563eb; --canvas:#f3f7fd; --surface:#fff; --line:#dce6f2; --ink:#172033; --text:#40516a; --muted:#7b8a9e; font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; color:var(--text); background:var(--canvas); letter-spacing:0; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-width:320px; overflow:hidden; background:var(--canvas); }
button,input,select { font:inherit; letter-spacing:0; }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible { outline:3px solid #bfdbfe; outline-offset:2px; }
.app-shell { display:grid; grid-template-columns:230px minmax(520px,1fr) 300px; grid-template-rows:66px minmax(0,1fr); height:100vh; }
.topbar { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; padding:0 22px; background:#fff; border-bottom:1px solid #e2e8f0; box-shadow:0 2px 10px rgba(37,99,235,.05); z-index:5; }
.brand { display:flex; align-items:center; gap:11px; }
.brand-mark { width:38px; height:38px; display:grid; place-items:center; border-radius:7px; background:var(--blue); color:#fff; font-size:19px; font-weight:750; box-shadow:0 5px 14px rgba(59,130,246,.2); }
.brand h1 { margin:0; color:var(--ink); font-size:16px; }
.brand span:not(.brand-mark) { display:block; margin-top:3px; color:#8a97a8; font-size:10px; }
.top-actions { display:flex; align-items:center; gap:10px; }
.status { padding:6px 10px; border:1px solid var(--line); border-radius:6px; background:#f8fbff; color:var(--muted); font-size:12px; }
.status.online { border-color:#b9e8d9; background:#edf9f5; color:#087b5d; }
.mobile-tools { display:none; min-height:36px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--blue-dark); }
.sidebar { grid-row:2; min-height:0; overflow:hidden; background:#fff; border-right:1px solid #e3eaf3; }
.sidebar-title { padding:18px 18px 10px; color:#94a3b8; font-size:11px; font-weight:650; }
.tool-nav { height:calc(100% - 44px); overflow:auto; padding:0 10px 18px; }
.tool-nav button { width:100%; min-height:44px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:0 12px; border:0; border-radius:6px; background:transparent; color:#334155; text-align:left; }
.tool-nav button::before { content:""; width:7px; height:7px; margin-right:2px; border-radius:2px; background:#93c5fd; grid-column:1; position:absolute; }
.tool-nav button span { padding-left:17px; font-size:13px; }
.tool-nav button em { color:#94a3b8; font-size:9px; font-style:normal; }
.tool-nav button:hover { background:#f5f8fd; }
.tool-nav button.selected { background:#e8f1ff; color:#1d4ed8; font-weight:650; }
.tool-nav button.selected::before { background:var(--blue); }
.workspace { grid-row:2; min-width:0; overflow:auto; padding:18px 24px 40px; }
.workspace-head { max-width:1240px; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:0 auto 12px; }
.workspace-head h2 { margin:0; color:var(--ink); font-size:24px; }
.workspace-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.workspace-mode { color:#71839a; font-size:12px; }
.tool-workspace { max-width:1240px; min-height:calc(100vh - 126px); margin:0 auto; }
.work-surface { min-height:100%; padding:20px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 14px 32px rgba(51,93,150,.07); }
.editor-layout,.editor-main { min-width:0; }
.editor-layout { display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:18px; }
.clear-workspace { display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:18px; min-height:calc(100vh - 146px); }
.clear-workspace .editor-main { min-height:0; }
.canvas-box { position:relative; min-height:520px; display:grid; place-items:center; overflow:auto; border:1px dashed #60a5fa; border-radius:8px; background:#edf5ff; }
.clear-workspace .canvas-box { height:calc(100vh - 188px); min-height:620px; }
.canvas-box.has-image { display:block; padding:12px; }
.canvas-box canvas { display:block; max-width:100%; max-height:760px; margin:auto; background:#fff; touch-action:none; box-shadow:0 3px 12px rgba(42,72,110,.12); }
.canvas-box.has-image canvas { max-width:none; max-height:none; }
.canvas-box canvas:not(.has-content) { width:0; height:0; }
.dropzone { transition:background .16s ease,border-color .16s ease; }
.dropzone.is-dragging,.dropzone:hover { border-color:var(--blue-dark); background:#e5f1ff; }
.drop-input { display:none; }
.drop-prompt { display:grid; gap:8px; color:#71839a; text-align:center; pointer-events:none; }
.drop-prompt strong { color:#334d6b; font-size:16px; }
.drop-prompt span { font-size:12px; }
.options-panel { display:grid; align-content:start; gap:12px; min-width:0; }
.options-panel label { display:grid; gap:6px; color:#607187; font-size:11px; }
.options-panel input:not([type="range"]):not([type="color"]),.options-panel select { width:100%; min-height:38px; padding:0 10px; border:1px solid #cddced; border-radius:5px; background:#fff; color:var(--text); }
.options-panel input[type="range"] { width:100%; accent-color:var(--blue); }
.options-panel input[type="color"] { width:100%; height:38px; padding:3px; border:1px solid #cddced; border-radius:5px; background:#fff; }
.control-value { color:var(--muted); font-size:11px; text-align:right; }
.primary,.secondary,.download,.icon-command { min-height:40px; display:inline-flex; align-items:center; justify-content:center; padding:0 14px; border:1px solid #c9d8ea; border-radius:6px; background:#fff; color:#40516a; text-decoration:none; }
.primary { border-color:var(--blue); background:var(--blue); color:#fff; box-shadow:0 6px 14px rgba(59,130,246,.18); }
.primary:hover { background:var(--blue-dark); }
.primary:disabled,.secondary:disabled { cursor:not-allowed; opacity:.45; }
.secondary:hover { border-color:#93bdf5; background:#f1f7ff; color:var(--blue-dark); }
.tool-actions { display:grid; gap:8px; margin-top:4px; }
.viewport-actions,.dual-inputs { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.message { margin:0; color:#71839a; font-size:11px; line-height:1.6; }
.result-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.download { border-color:#a9dfcf; background:#edf9f5; color:#087b5d; }
.file-summary { display:grid; gap:4px; padding:12px; border:1px solid #dce7f4; border-radius:6px; background:#f8fbff; }
.file-summary strong { overflow:hidden; color:#263449; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.file-summary span { color:#71839a; font-size:10px; }
.compression-result { display:grid; gap:8px; color:#087b5d; font-size:12px; }
.dropzone-wide { min-height:170px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; border:1px dashed #60a5fa; border-radius:8px; background:#edf5ff; color:#334d6b; }
.dropzone-wide span { color:#8194ad; font-size:12px; }
.merge-workspace { display:grid; gap:14px; }
.merge-thumbs { display:flex; gap:8px; overflow:auto; padding-bottom:3px; }
.merge-thumb { width:210px; min-width:210px; display:grid; grid-template-columns:54px minmax(0,1fr) 28px; align-items:center; gap:8px; padding:7px; border:1px solid #dce7f4; border-radius:6px; background:#f8fbff; }
.merge-thumb img { width:54px; height:54px; object-fit:cover; border-radius:4px; background:#fff; }
.merge-thumb div { min-width:0; display:grid; gap:3px; }
.merge-thumb strong { overflow:hidden; color:#334155; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.merge-thumb span { color:#8492a6; font-size:9px; }
.merge-thumb button { width:26px; height:26px; border:1px solid #dbe4ef; border-radius:4px; background:#fff; color:#64748b; }
.merge-editor { display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:18px; }
.merge-preview { position:relative; min-height:480px; display:grid; place-items:center; overflow:auto; border:1px solid #dce7f4; border-radius:7px; background:#f4f7fb; }
.merge-preview canvas { max-width:100%; max-height:700px; background:#fff; box-shadow:0 3px 12px rgba(42,72,110,.1); }
.watermark-options { max-height:calc(100vh - 178px); overflow:auto; padding-right:3px; }
.history-panel { grid-row:2; min-height:0; overflow:auto; padding:20px 16px; background:#fff; border-left:1px solid #e3eaf3; }
.history-head { display:flex; align-items:center; justify-content:space-between; padding-bottom:16px; border-bottom:1px solid #e7edf5; }
.history-head > div { display:flex; align-items:center; gap:8px; }
.history-head strong { color:#263449; font-size:13px; }
.history-head span { padding:3px 7px; border-radius:8px; background:#e8f1ff; color:var(--blue-dark); font-size:11px; }
.icon-command { min-height:34px; padding:0 10px; font-size:11px; }
.record-list { display:grid; gap:0; }
.record-item { padding:14px 2px; border-bottom:1px solid #e7edf5; }
.record-title,.record-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.record-title strong { color:#263449; font-size:12px; }
.record-title button { width:24px; height:24px; border:0; background:transparent; color:#94a3b8; font-size:18px; }
.record-meta { margin-top:5px; color:#8492a6; font-size:9px; }
.record-file { display:grid; grid-template-columns:45px minmax(0,1fr) auto; gap:6px; margin-top:8px; padding:8px; border-radius:5px; background:#f1f6fd; font-size:9px; }
.record-file b { color:#2563eb; }.record-file span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.record-file em { color:#8492a6; font-style:normal; }
.result-file { background:#edf9f5; }.result-file b { color:#087b5d; }
.empty-history { padding:40px 8px; color:#94a3b8; font-size:11px; text-align:center; }

@media (max-width:1050px) {
  .app-shell { grid-template-columns:210px minmax(460px,1fr); }
  .history-panel { display:none; }
}
@media (max-width:760px) {
  body { overflow:auto; }
  .app-shell { display:block; height:auto; min-height:100vh; }
  .topbar { position:sticky; top:0; height:58px; padding:0 14px; }
  .brand h1 { font-size:14px; }.brand span:not(.brand-mark) { display:none; }.brand-mark { width:34px; height:34px; }
  .mobile-tools { display:inline-flex; }.status { font-size:9px; }
  .sidebar { position:fixed; inset:58px 0 0; display:none; z-index:10; padding:12px; border:0; background:rgba(255,255,255,.98); }
  body.show-tools .sidebar { display:block; }
  .tool-nav { height:auto; display:grid; grid-template-columns:1fr 1fr; gap:7px; }
  .tool-nav button { border:1px solid var(--line); background:#fff; }
  .workspace { padding:16px 12px 28px; overflow:visible; }
  .workspace-head h2 { font-size:21px; }.workspace-mode { display:none; }
  .tool-workspace { min-height:0; }
  .work-surface { padding:12px; box-shadow:none; }
  .editor-layout,.clear-workspace,.merge-editor { grid-template-columns:1fr; min-height:0; }
  .canvas-box,.clear-workspace .canvas-box { height:62vh; min-height:420px; }
  .merge-preview { min-height:420px; }
  .watermark-options { max-height:none; }
}
