
:root{
  --bg:#f6f8fc;--surface:#fff;--surface2:#eef4ff;--text:#101828;--muted:#667085;
  --line:#dfe6ef;--accent:#3b82f6;--accent2:#7c3aed;--shadow:0 18px 45px rgba(15,23,42,.08);
  --ok:#0f9f6e;--danger:#d92d20;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;background:linear-gradient(180deg,#fbfdff,#f5f7fb 42%,#f7f8fb);color:var(--text)}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}
.wrap{width:min(1120px,calc(100% - 28px));margin:auto}
.topbar{position:sticky;top:0;z-index:30;background:rgba(255,255,255,.9);backdrop-filter:blur(14px);border-bottom:1px solid rgba(223,230,239,.9)}
.nav{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:10px;font-weight:850;letter-spacing:-.02em}
.brand img{width:36px;height:36px}
.navlinks{display:flex;gap:20px;color:#536172;font-size:14px}
.navlinks a:hover,.navlinks a.active{color:var(--accent)}
.mobile-nav{display:none}
.hero{padding:74px 0 44px;display:grid;grid-template-columns:1.1fr .9fr;gap:46px;align-items:center}
.eyebrow{margin:0;color:var(--accent);font-size:12px;font-weight:850;letter-spacing:.14em;text-transform:uppercase}
.hero h1,.page-head h1{font-size:clamp(42px,6vw,68px);line-height:1.03;letter-spacing:-.055em;margin:14px 0}
.hero h1 span,.gradient-text{background:linear-gradient(90deg,var(--accent),var(--accent2));-webkit-background-clip:text;background-clip:text;color:transparent}
.hero p,.page-head p{color:var(--muted);line-height:1.75;font-size:17px}
.hero-panel{min-height:330px;border:1px solid var(--line);border-radius:30px;background:radial-gradient(circle at 18% 20%,rgba(59,130,246,.2),transparent 30%),radial-gradient(circle at 80% 78%,rgba(124,58,237,.18),transparent 34%),#edf4fb;position:relative;overflow:hidden}
.hero-symbol{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:140px;height:140px;opacity:.95}
.float-tag{position:absolute;background:rgba(255,255,255,.93);border:1px solid var(--line);border-radius:14px;padding:10px 13px;font-size:12px;font-weight:800;box-shadow:0 12px 30px rgba(15,23,42,.09)}
.ft1{left:22px;top:38px}.ft2{right:24px;top:120px}.ft3{left:42px;bottom:42px}.ft4{right:35px;bottom:45px}
.searchbar{display:flex;gap:10px;margin-top:26px;max-width:650px}
.searchbar input{flex:1;min-height:50px;border:1px solid var(--line);border-radius:15px;padding:0 15px;background:#fff}
.btn,.btn-secondary{min-height:46px;border-radius:13px;padding:0 17px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;border:0}
.btn{background:linear-gradient(135deg,var(--accent),#2563eb);color:#fff;box-shadow:0 10px 24px rgba(59,130,246,.2)}
.btn-secondary{background:#fff;border:1px solid var(--line);color:var(--text)}
.section{padding:48px 0}
.section-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:22px}
.section-head h2{font-size:34px;letter-spacing:-.04em;margin:7px 0 0}
.section-head a{font-size:13px;color:var(--accent);font-weight:750}
.category-grid,.tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.category-card,.tool-card{background:#fff;border:1px solid var(--line);border-radius:21px;padding:21px;transition:.18s ease}
.category-card:hover,.tool-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:#cdd8e7}
.category-icon,.tool-icon{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;background:var(--surface2);color:var(--accent);font-weight:900;font-size:19px}
.category-card h3,.tool-card h3{margin:14px 0 7px}
.category-card p,.tool-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.55}
.page-head{padding:58px 0 26px;max-width:850px}
.breadcrumb{font-size:12px;color:var(--muted);margin-bottom:12px}
.breadcrumb a{color:var(--accent)}
.tool-shell{background:#fff;border:1px solid var(--line);border-radius:24px;padding:18px;box-shadow:var(--shadow);margin:8px 0 28px}
.tool-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:18px}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:18px}
.panel h3{margin:0 0 12px;font-size:16px}
.dropzone{min-height:320px;border:1px dashed #b9c5d5;border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px;background:#fbfdff}
.dropzone.drag{border-color:var(--accent);background:#f2f7ff}
.dropzone .plus{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#eaf3ff,#f1ecff);color:var(--accent);font-size:32px}
.dropzone h3{margin:14px 0 5px;font-size:22px}.dropzone p{margin:0 0 13px;color:var(--muted)}
.hidden{display:none!important}
.preview{background:#f7f9fc;border:1px solid var(--line);border-radius:18px;padding:14px}
.file-row{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}
.file-row div{display:flex;flex-direction:column;min-width:0}.file-row strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-row span{font-size:12px;color:var(--muted);margin-top:3px}
.canvas-wrap{min-height:360px;border-radius:15px;padding:14px;display:flex;align-items:center;justify-content:center;overflow:auto;background:
linear-gradient(45deg,#edf1f6 25%,transparent 25%) 0 0/18px 18px,
linear-gradient(45deg,transparent 75%,#edf1f6 75%) 0 0/18px 18px,
linear-gradient(45deg,transparent 75%,#edf1f6 75%) 9px -9px/18px 18px,
linear-gradient(45deg,#edf1f6 25%,#fff 25%) 9px -9px/18px 18px}
canvas{max-width:100%;height:auto;display:block}
.controls{display:flex;flex-direction:column;gap:12px}
.card{border:1px solid var(--line);border-radius:16px;padding:15px;background:#fff}
.card h4{margin:0 0 10px;font-size:14px}
.row{display:flex;gap:9px;align-items:center}.row-between{display:flex;justify-content:space-between;gap:10px;align-items:center}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:9px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
input[type=text],input[type=number],input[type=password],input[type=datetime-local],textarea,select{width:100%;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--text);padding:10px 11px}
textarea{min-height:180px;resize:vertical;line-height:1.55}
.small{font-size:12px;color:var(--muted);line-height:1.5}
.seg button,.format-btn,.ratio-btn,.mode-btn{min-height:39px;border:1px solid var(--line);border-radius:10px;background:#fff;font-weight:700;color:#566273}
.seg button.active,.format-btn.active,.ratio-btn.active,.mode-btn.active{border-color:var(--accent);background:#eef5ff;color:#1d4ed8}
.status{font-size:12px;color:var(--muted);min-height:18px}
.output-box{background:#f7f9fc;border:1px solid var(--line);border-radius:14px;padding:13px;word-break:break-all}
.result-list{display:grid;gap:9px}
.result-item{display:flex;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:12px;padding:11px}
.kpi-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.kpi{background:#f7f9fc;border:1px solid var(--line);border-radius:14px;padding:14px}.kpi b{display:block;font-size:22px;margin-top:4px}
.crop-stage{position:relative;display:inline-block;max-width:100%;line-height:0}
.crop-overlay{position:absolute;inset:0;pointer-events:none}
.crop-box{position:absolute;border:2px solid #fff;box-shadow:0 0 0 9999px rgba(15,23,42,.48),0 0 0 1px rgba(15,23,42,.35);cursor:grab;pointer-events:auto;touch-action:none}
.crop-box:active{cursor:grabbing}
.crop-guide{position:absolute;background:rgba(255,255,255,.6);pointer-events:none}
.crop-guide.v1,.crop-guide.v2{top:0;bottom:0;width:1px}.crop-guide.v1{left:33.333%}.crop-guide.v2{left:66.666%}
.crop-guide.h1g,.crop-guide.h2g{left:0;right:0;height:1px}.crop-guide.h1g{top:33.333%}.crop-guide.h2g{top:66.666%}
.crop-handle{position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;border:2px solid var(--accent);box-shadow:0 2px 8px rgba(15,23,42,.18);display:none}
.crop-box.free-mode .crop-handle{display:block;pointer-events:auto}
.crop-handle.nw{left:-9px;top:-9px;cursor:nwse-resize}.crop-handle.ne{right:-9px;top:-9px;cursor:nesw-resize}
.crop-handle.sw{left:-9px;bottom:-9px;cursor:nesw-resize}.crop-handle.se{right:-9px;bottom:-9px;cursor:nwse-resize}
.tool-copy{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:30px 0 60px}
.tool-copy article{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px}.tool-copy h3{margin-top:0}.tool-copy p{color:var(--muted);line-height:1.7}
footer{border-top:1px solid var(--line);background:rgba(255,255,255,.7);margin-top:50px}
.footer{min-height:110px;display:flex;align-items:center;justify-content:space-between;gap:20px}.footer div{display:flex;gap:16px;color:var(--muted);font-size:13px}
@media(max-width:900px){
  .hero{grid-template-columns:1fr}.hero-panel{min-height:260px}.category-grid,.tool-grid{grid-template-columns:1fr 1fr}.tool-layout{grid-template-columns:1fr}
}
@media(max-width:640px){
  .wrap{width:min(100% - 20px,1120px)}.navlinks{display:none}.mobile-nav{display:block;font-size:13px;color:var(--muted)}
  .hero{padding-top:42px}.hero h1,.page-head h1{font-size:43px}.hero-panel{min-height:220px}
  .category-grid,.tool-grid{grid-template-columns:1fr}.grid2,.kpi-grid{grid-template-columns:1fr}.grid3{grid-template-columns:1fr 1fr}
  .tool-copy{grid-template-columns:1fr}.footer{align-items:flex-start;flex-direction:column;justify-content:center;padding:24px 0}
}


/* Sidebar navigation */
.menu-btn{
  width:42px;height:42px;border:1px solid var(--line);background:#fff;border-radius:12px;
  display:grid;place-items:center;padding:0;flex:0 0 auto
}
.menu-btn span,.menu-btn span:before,.menu-btn span:after{
  display:block;width:18px;height:2px;background:#344054;border-radius:999px;content:"";position:relative
}
.menu-btn span:before{position:absolute;top:-6px;left:0}
.menu-btn span:after{position:absolute;top:6px;left:0}
.nav-left{display:flex;align-items:center;gap:12px}
.sidebar-backdrop{
  position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:79;opacity:0;pointer-events:none;transition:.2s ease
}
.sidebar{
  position:fixed;left:0;top:0;bottom:0;width:min(330px,88vw);z-index:80;background:#fff;
  border-right:1px solid var(--line);transform:translateX(-102%);transition:.23s ease;
  box-shadow:20px 0 55px rgba(15,23,42,.16);padding:18px;overflow:auto
}
body.sidebar-open .sidebar{transform:translateX(0)}
body.sidebar-open .sidebar-backdrop{opacity:1;pointer-events:auto}
body.sidebar-open{overflow:hidden}
.sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.sidebar-head .brand img{width:38px;height:38px}
.sidebar-close{
  width:38px;height:38px;border:1px solid var(--line);background:#fff;border-radius:11px;font-size:20px
}
.sidebar-group{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.sidebar-label{font-size:11px;color:var(--muted);font-weight:850;letter-spacing:.12em;text-transform:uppercase;margin:0 0 7px 9px}
.sidebar a.side-link{
  display:flex;align-items:center;gap:11px;padding:10px 11px;border-radius:11px;color:#344054;font-size:14px;font-weight:650
}
.sidebar a.side-link:hover{background:#f3f6fb;color:var(--accent)}
.side-icon{width:28px;height:28px;border-radius:9px;background:#eef4ff;color:var(--accent);display:grid;place-items:center;font-size:12px;font-weight:900}
.guide-steps{display:grid;gap:10px;counter-reset:step}
.guide-step{position:relative;padding:14px 14px 14px 52px;background:#f8fafc;border:1px solid var(--line);border-radius:14px;line-height:1.55}
.guide-step:before{counter-increment:step;content:counter(step);position:absolute;left:14px;top:12px;width:26px;height:26px;border-radius:9px;background:#eaf2ff;color:#2563eb;font-weight:850;display:grid;place-items:center}
.faq-list{display:grid;gap:12px}
.faq-item{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px}
.faq-item h3{font-size:16px;margin:0 0 8px}.faq-item p{margin:0;color:var(--muted);line-height:1.7}
.legal-copy{max-width:850px}
.legal-copy h2{font-size:24px;margin:34px 0 9px}.legal-copy h3{font-size:17px;margin:23px 0 7px}
.legal-copy p,.legal-copy li{color:#475467;line-height:1.8}
.notice-box{background:#fff8e8;border:1px solid #f7d892;border-radius:14px;padding:14px 16px;color:#7a5a10;margin:14px 0}
@media(max-width:640px){.nav-left{gap:8px}.menu-btn{width:39px;height:39px}}

/* Language switcher */
.lang-switch{display:flex;align-items:center;gap:8px}
.lang-label{font-size:12px;color:var(--muted);font-weight:700}
.lang-select{
  min-width:112px;height:40px;border:1px solid var(--line);border-radius:11px;
  background:#fff;color:#344054;padding:0 30px 0 11px;font-size:13px;font-weight:750
}
.nav-right{display:flex;align-items:center;gap:10px}
@media(max-width:760px){
  .lang-label{display:none}.lang-select{min-width:96px;height:38px;padding-left:9px}
}
@media(max-width:520px){
  .nav-right .mobile-nav{display:none}.lang-select{min-width:88px;font-size:12px}
}

/* v4 logo tuning */
.brand img{filter:drop-shadow(0 5px 12px rgba(59,130,246,.12))}
.hero-symbol{width:156px;height:156px}

/* v7 mobile hardening */
html{-webkit-text-size-adjust:100%}
body{min-width:0;overflow-x:hidden}
button,.btn,.btn-secondary,.format-btn,.ratio-btn,.mode-btn,.menu-btn,.sidebar-close{
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
input,textarea,select{font-size:16px}
input[type="range"]{touch-action:pan-x}
input[type="file"]{max-width:100%}
.tool-shell,.panel,.preview,.controls,.tool-layout{min-width:0}
.row{flex-wrap:wrap}
.canvas-wrap{-webkit-overflow-scrolling:touch;max-width:100%}
.crop-stage{max-width:100%;user-select:none;-webkit-user-select:none}
.crop-box{touch-action:none}
.crop-box.free-mode .crop-handle{
  width:24px;height:24px;
}
.crop-handle.nw{left:-13px;top:-13px}
.crop-handle.ne{right:-13px;top:-13px}
.crop-handle.sw{left:-13px;bottom:-13px}
.crop-handle.se{right:-13px;bottom:-13px}
.sidebar{padding-bottom:max(18px,env(safe-area-inset-bottom))}
.topbar{padding-top:env(safe-area-inset-top)}
@media(max-width:640px){
  .nav{min-height:60px;gap:8px}
  .brand{gap:7px}
  .brand img{width:32px;height:32px}
  .brand span{font-size:15px}
  .lang-select{width:90px;min-width:90px}
  .hero{padding-top:30px}
  .hero h1,.page-head h1{font-size:36px}
  .page-head{padding-top:36px}
  .tool-shell{padding:11px;border-radius:18px}
  .panel{padding:14px}
  .dropzone{min-height:250px;padding:20px}
  .canvas-wrap{min-height:260px;padding:8px}
  .grid3{grid-template-columns:1fr 1fr}
  .btn,.btn-secondary{min-height:48px}
  .format-btn,.ratio-btn,.mode-btn{min-height:46px}
  textarea{min-height:150px}
  .footer div{flex-wrap:wrap}
}

/* v11 substantive tool content */
.seo-detail h2{font-size:24px;margin:0 0 12px}
.seo-detail h3{font-size:16px;margin:22px 0 7px}
.seo-detail p{color:var(--muted);line-height:1.75;margin:0}
.related-tools .tool-card h3{margin-top:0}

/* v12 final sidebar tool tree */
.side-details{border-radius:12px;margin:3px 0}
.side-details summary{list-style:none;display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:11px;color:#344054;font-size:14px;font-weight:700;cursor:pointer}
.side-details summary::-webkit-details-marker{display:none}
.side-details summary:hover{background:#f3f6fb;color:var(--accent)}
.side-details[open] summary{background:#f6f8fc}
.side-sub{display:grid;gap:2px;padding:4px 8px 8px 47px}
.side-sub-link{font-size:12px;color:#667085;padding:6px 4px;border-radius:7px;line-height:1.25}
.side-sub-link:hover{color:var(--accent);background:#f7f9fc}
.sidebar-update{margin-top:20px;padding:12px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);line-height:1.5}
.sidebar-update strong{font-size:12px;color:#475467}
