:root{
  --bg0:#f6f7fb;
  --bg1:#eefdf6;
  --card:rgba(255,255,255,0.92);
  --cardBorder:rgba(15,23,42,0.10);
  --text:#0f172a;
  --muted:#475569;
  --muted2:#64748b;
  --accent:#06b6d4;
  --accent2:#22c55e;
  --danger:#ef4444;
  --shadow:0 20px 60px rgba(15,23,42,0.10);
  --radius:18px;
  --radius2:14px;
  --focus:0 0 0 4px rgba(6,182,212,0.20);
  --line:rgba(15,23,42,0.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Helvetica Neue",sans-serif;
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 10% 0%, rgba(6,182,212,0.14), transparent 60%),
    radial-gradient(900px 540px at 90% 10%, rgba(34,197,94,0.12), transparent 55%),
    linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 55%, #f7fbff 100%);
}

.skipLink{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;height:1px;
  overflow:hidden;
}
.skipLink:focus{
  left:16px; top:16px;
  width:auto;height:auto;
  z-index:9999;
  background:#fff;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:saturate(180%) blur(12px);
  background:rgba(246,247,251,0.70);
  border-bottom:1px solid rgba(15,23,42,0.06);
}
.topbar__inner{
  max-width:1200px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.brand{display:flex; align-items:center; gap:12px;}
.brand__mark{
  width:38px;height:38px;
  border-radius:12px;
  background:
    radial-gradient(12px 12px at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 12px 30px rgba(6,182,212,0.20);
}
.brand__title{font-weight:850; letter-spacing:0.2px;}
.brand__sub{font-size:12px; color:var(--muted2); margin-top:2px;}
.topbar__meta{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.pill{
  font-size:12px;
  color:var(--muted);
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.7);
  padding:6px 10px;
  border-radius:999px;
}

.page{max-width:1200px; margin:0 auto; padding:18px;}
.layout{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:16px;
  align-items:start;
}

.sidebar{
  position:sticky;
  top:86px;
  background:var(--card);
  border:1px solid var(--cardBorder);
  border-radius:var(--radius);
  box-shadow:0 10px 40px rgba(15,23,42,0.06);
  padding:14px;
}
.sidebar__section + .sidebar__section{margin-top:14px;}
.sidebar__title{
  font-weight:800;
  font-size:13px;
  color:var(--muted2);
  margin-bottom:10px;
}

.toolBtn{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.7);
  color:var(--text);
  cursor:pointer;
  transition:transform .06s ease, border-color .15s ease, background .15s ease;
  margin-bottom:10px;
}
.toolBtn:last-child{margin-bottom:0}
.toolBtn:focus{outline:none; box-shadow:var(--focus);}
.toolBtn:hover{transform:translateY(-1px); border-color:rgba(6,182,212,0.35)}
.toolBtn.is-active{
  border-color:rgba(6,182,212,0.55);
  background:linear-gradient(180deg, rgba(6,182,212,0.12), rgba(255,255,255,0.75));
}
.toolIcon{width:20px;height:20px; color:rgba(15,23,42,0.75)}
.toolBtn.is-active .toolIcon{color:var(--accent);}
.toolBtn span{font-weight:750;}

.sidebar__section--help{
  background:linear-gradient(180deg, rgba(6,182,212,0.08), rgba(255,255,255,0.65));
  border:1px solid rgba(6,182,212,0.18);
  border-radius:16px;
  padding:12px;
}
.helpText{color:var(--muted); font-size:13px; line-height:1.55;}
.helpLinks{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px;}
.helpTag{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px dashed rgba(15,23,42,0.18);
  color:rgba(15,23,42,0.74);
  background:rgba(255,255,255,0.75);
}

.main{min-width:0;}
.seoBlock{
  margin:4px 0 14px;
  background:linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
  border:1px solid rgba(15,23,42,0.08);
  border-radius:var(--radius);
  padding:18px 18px 16px;
}
.seoH1{margin:0; font-size:28px; letter-spacing:-0.4px;}
.seoP{margin:8px 0 0; color:var(--muted); line-height:1.75; font-size:14px;}

.appShell{
  background:var(--card);
  border:1px solid var(--cardBorder);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.editorCard{padding:16px;}
.uploadRow{
  display:flex;
  gap:12px;
  align-items:stretch;
}
.dropzone{
  flex:1;
  border:2px dashed rgba(6,182,212,0.35);
  border-radius:var(--radius2);
  background:
    radial-gradient(800px 180px at 10% 0%, rgba(6,182,212,0.12), transparent 55%),
    rgba(255,255,255,0.65);
  padding:14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:92px;
  position:relative;
}
.dropzone:focus{outline:none; box-shadow:var(--focus);}
.dropzone.is-dragging{
  border-color:rgba(34,197,94,0.7);
  background:linear-gradient(180deg, rgba(34,197,94,0.10), rgba(255,255,255,0.75));
}
.dropzone__inner{display:flex; align-items:center; gap:12px;}
.dropzone__icon{
  width:40px;height:40px;
  border-radius:14px;
  background:
    linear-gradient(135deg, rgba(6,182,212,0.9), rgba(34,197,94,0.75));
  box-shadow:0 18px 40px rgba(6,182,212,0.22);
  position:relative;
}
.dropzone__icon:after{
  content:"";
  position:absolute;
  left:50%; top:50%;
  width:18px;height:12px;
  transform:translate(-50%,-50%);
  border:2px solid rgba(255,255,255,0.95);
  border-top:0;
  border-radius:2px;
}
.dropzone__title{font-weight:850; letter-spacing:-0.2px;}
.dropzone__sub{font-size:12px; color:var(--muted); margin-top:2px;}

.transformBar{
  width:240px;
  border-radius:var(--radius2);
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.55);
  padding:10px;
  display:flex;
  flex-wrap:wrap;
  align-content:flex-start;
  gap:8px;
  justify-content:flex-start;
}
.iconBtn{
  width:44px;height:40px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.75);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(15,23,42,0.75);
  transition:transform .06s ease, border-color .15s ease;
}
.iconBtn:hover{transform:translateY(-1px); border-color:rgba(6,182,212,0.35);}
.iconBtn:focus{outline:none; box-shadow:var(--focus);}
.iconBtn svg{width:18px;height:18px;}
.textBtn{
  height:40px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.75);
  cursor:pointer;
  color:rgba(15,23,42,0.78);
  font-weight:750;
}
.textBtn:hover{border-color:rgba(34,197,94,0.45);}
.textBtn:focus{outline:none; box-shadow:var(--focus);}

.workspace{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr 380px;
  gap:12px;
  align-items:start;
}
.previewWrap{
  position:relative;
  background:linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0.55));
  border:1px solid rgba(15,23,42,0.10);
  border-radius:var(--radius2);
  overflow:hidden;
  height:420px;
}
#previewCanvas{
  width:100%;
  height:100%;
  display:block;
}
.emptyState{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:18px;
  text-align:center;
  color:var(--muted);
}
.emptyState__title{font-weight:900; color:rgba(15,23,42,0.80); font-size:18px;}
.emptyState__sub{margin-top:8px; font-size:13px; line-height:1.6; max-width:280px;}

.cropLayer{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.cropBox{
  position:absolute;
  border:2px dashed rgba(6,182,212,0.95);
  background:rgba(6,182,212,0.07);
  box-shadow:0 0 0 1px rgba(6,182,212,0.25);
  pointer-events:auto;
  border-radius:10px;
}
.cropGrid{
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(to right, rgba(6,182,212,0.30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6,182,212,0.30) 1px, transparent 1px);
  background-size:25% 25%;
  opacity:0.65;
  border-radius:10px;
}
.cropHandle{
  position:absolute;
  width:12px;height:12px;
  background:var(--accent);
  border-radius:4px;
  transform:translate(-50%,-50%);
  box-shadow:0 12px 25px rgba(6,182,212,0.35);
  touch-action:none;
}
.cropHandle--nw{left:0; top:0;}
.cropHandle--ne{left:100%; top:0;}
.cropHandle--sw{left:0; top:100%;}
.cropHandle--se{left:100%; top:100%;}
.hidden{display:none !important;}

.controlsCol{display:flex; flex-direction:column; gap:12px; min-width:0;}
.panel{
  background:rgba(255,255,255,0.60);
  border:1px solid rgba(15,23,42,0.10);
  border-radius:var(--radius2);
  padding:12px;
}
.panelTitle{
  font-weight:900;
  letter-spacing:-0.2px;
  margin-bottom:10px;
}
.field{display:block; margin-top:10px;}
.field:first-child{margin-top:0}
.fieldLabel{font-weight:800; font-size:13px; color:rgba(15,23,42,0.78); display:block; margin-bottom:6px;}
.fieldHelp{font-size:12px; color:var(--muted2); line-height:1.5; display:block; margin-top:6px;}
.inlineField{display:flex; align-items:center; gap:8px;}
input[type="number"], select, input[type="color"]{
  width:100%;
  height:42px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.75);
  padding:0 12px;
  color:var(--text);
  font-size:14px;
}
input[type="color"]{
  width:auto;
  padding:0 0;
}
input[type="range"]{width:100%}
.rangeValue{
  display:inline-block;
  min-width:54px;
  text-align:right;
  font-weight:900;
  color:rgba(15,23,42,0.86);
}
.qualityWrap .field{margin-top:0}

.inlineField input[type="number"]{flex:1}
.suffix{color:var(--muted2); font-size:12px; white-space:nowrap; padding-right:6px;}

.twoCols{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.checkField{
  display:flex; align-items:center; gap:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.08);
  background:rgba(255,255,255,0.60);
}
.checkField input{width:auto; height:auto;}

.jpegBgField[data-jpeg-bg]{margin-top:10px;}

.actionBar{
  background:linear-gradient(180deg, rgba(6,182,212,0.10), rgba(255,255,255,0.65));
  border:1px solid rgba(6,182,212,0.18);
  border-radius:var(--radius2);
  padding:12px;
}
.actionBar__status{
  min-height:22px;
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
  margin-bottom:10px;
}
.actionBar__btnRow{display:flex; gap:10px;}
.primaryBtn{
  flex:1;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(6,182,212,0.35);
  background:linear-gradient(135deg, rgba(6,182,212,0.95), rgba(34,197,94,0.85));
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.primaryBtn:focus{outline:none; box-shadow:0 0 0 4px rgba(34,197,94,0.18);}
.primaryBtn:disabled{opacity:0.6; cursor:not-allowed;}
.ghostBtn{
  height:46px;
  width:96px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.70);
  color:rgba(15,23,42,0.78);
  font-weight:850;
  cursor:pointer;
}
.ghostBtn:focus{outline:none; box-shadow:var(--focus);}
.smallNote{
  margin-top:10px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.5;
}

.resultRow{
  display:grid;
  grid-template-columns: 1fr 380px;
  gap:12px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid rgba(15,23,42,0.08);
}
.resultPreview, .resultMeta{
  background:rgba(255,255,255,0.62);
  border:1px solid rgba(15,23,42,0.10);
  border-radius:var(--radius2);
  padding:12px;
}
.resultTitle{font-weight:900; margin-bottom:10px;}
.resultCanvasWrap{
  height:220px;
  border-radius:14px;
  border:1px dashed rgba(15,23,42,0.16);
  background:rgba(255,255,255,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.resultImg{
  max-width:100%;
  max-height:100%;
  display:block;
}
.resultEmpty{color:var(--muted2); font-size:13px; line-height:1.6; padding:0 10px; text-align:center;}
.metaBlock{margin-bottom:12px;}
.metaTitle{font-weight:900; margin-bottom:10px;}
.metaLine{display:flex; gap:10px; margin-top:6px; font-size:13px;}
.metaKey{color:var(--muted2); min-width:60px;}
.metaVal{color:rgba(15,23,42,0.85); font-weight:800;}
.downloadBlock{display:flex; flex-direction:column; gap:10px;}
.downloadBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.12);
  background:rgba(255,255,255,0.75);
  font-weight:900;
  color:rgba(15,23,42,0.82);
  text-decoration:none;
}
.downloadBtn:hover{border-color:rgba(6,182,212,0.35)}
.downloadHint{font-size:12px; color:var(--muted2); line-height:1.5;}

.seoFooter{
  padding:0 16px 16px;
}
.seoH2{
  margin:16px 0 10px;
  font-size:18px;
  letter-spacing:-0.2px;
}
.faqList{
  display:grid;
  gap:10px;
}
.faqList details{
  border:1px solid rgba(15,23,42,0.10);
  background:rgba(255,255,255,0.65);
  border-radius:14px;
  padding:10px 12px;
}
.faqList summary{
  cursor:pointer;
  font-weight:900;
  color:rgba(15,23,42,0.82);
}
.faqList p{margin:10px 0 0; color:var(--muted); line-height:1.7; font-size:13px;}

.siteFooter{
  border-top:1px solid rgba(15,23,42,0.08);
  padding:14px 16px;
  background:rgba(255,255,255,0.55);
}
.footerInner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--muted2);
  font-size:12px;
}
.footerLinks a{
  color:rgba(15,23,42,0.72);
  text-decoration:none;
  border-bottom:1px dashed rgba(15,23,42,0.25);
}
.footerLinks a:hover{border-bottom-style:solid;}
.sep{margin:0 8px;}
.noscript{
  padding:10px 14px;
  background:#fff4f4;
  border-top:1px solid rgba(239,68,68,0.25);
  color:#991b1b;
}

@media (max-width: 980px){
  .layout{grid-template-columns:1fr;}
  .sidebar{position:relative; top:auto;}
  .workspace{grid-template-columns:1fr;}
  .transformBar{width:100%;}
  .uploadRow{flex-direction:column;}
  .resultRow{grid-template-columns:1fr;}
}

