/*!
 * Nano Works v4 — Theme CSS
 *
 * 从 docs/v4-design/nano-works-v4-reference.html 抽出并应用字号铁律（全部 ≥ 12px）。
 * 改这个文件会影响所有 v4 页面的视觉。不要在这里加工具页私有样式。
 * 支持 html[data-theme="dark"] 自动切换暗色。
 */

:root{
  --accent: #6A4BE0;
  --accent-2: #3B5BDB;
  --accent-soft: rgba(106,75,224,.1);
  --ink: #0A0E24;
  --ink-2: #3A4266;
  --muted: #737994;
  --line: #E6E8F2;
  --line-2: #EFF1F8;
  --paper: #F5F4FB;
  --card: #FFFFFF;
  --ff: 'Inter', 'Noto Sans SC', sans-serif;
  --ff-serif: 'Instrument Serif', serif;
  --ff-mono: 'JetBrains Mono', monospace;
  --ff-grotesk: 'Space Grotesk', var(--ff);
  --density: 1;

  --ic-blue:   #3B5BDB;
  --ic-violet: #6A4BE0;
  --ic-teal:   #14A3A3;
  --ic-green:  #2BA66E;
  --ic-amber:  #D98A22;
  --ic-red:    #D84D4D;
  --ic-pink:   #C6478F;
  --ic-slate:  #5A6480;
}
html[data-theme="dark"]{
  --ink: #F2F3FA;
  --ink-2: #BDC1D8;
  --muted: #7A8199;
  --line: #242A48;
  --line-2: #1B2039;
  --accent-soft: rgba(142,110,240,.16);
  --paper: #0B0D1E;
  --card: #151833;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: var(--ff);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ambient wash */
body::before{
  content:""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 20% -5%, rgba(106,75,224,.14), transparent 60%),
    radial-gradient(800px 500px at 110% 8%, rgba(59,91,219,.12), transparent 60%),
    radial-gradient(900px 500px at 50% 120%, rgba(206,120,200,.08), transparent 60%);
}
html[data-theme="dark"] body::before{
  background:
    radial-gradient(800px 450px at 15% -5%, rgba(106,75,224,.28), transparent 60%),
    radial-gradient(900px 520px at 110% 5%, rgba(59,91,219,.22), transparent 60%),
    radial-gradient(900px 500px at 50% 120%, rgba(210,120,200,.1), transparent 60%);
}

/* scrollbar */
::-webkit-scrollbar{ width: 8px; height: 8px;}
::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 4px;}
::-webkit-scrollbar-thumb:hover{ background: var(--muted);}

/* ============ APP SHELL ============ */
.shell{
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  max-width: 1560px;
  margin: 0 auto;
  gap: 0;
  padding: 14px;
}

/* ============ SIDEBAR ============ */
.sidebar{
  position: sticky; top: 14px;
  align-self: start;
  height: calc(100vh - 28px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 20px -8px rgba(20,25,60,.08);
  overflow-y: auto;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.mark{
  width: 36px; height: 36px; border-radius: 10px;
  background:
    radial-gradient(120% 120% at 0% 0%, #8E6EF0 0%, #6A4BE0 45%, #3B5BDB 100%);
  display:grid; place-items:center; color:#fff;
  box-shadow: 0 6px 18px -4px rgba(106,75,224,.5), inset 0 1px 0 rgba(255,255,255,.25);
  position:relative;
}
.mark::after{
  content:""; position:absolute; inset:2px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.15);
  pointer-events:none;
}
.mark svg{ width: 20px; height: 20px; position:relative; z-index:1;}
.brand-t{ line-height:1.05; }
.brand-t .n{ font-family: var(--ff-grotesk); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-t .s{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; }

.sidebar .sb-label{
  font-family: var(--ff-mono); font-size: 12px;
  color: var(--muted); letter-spacing: .16em; text-transform: uppercase;
  padding: 10px 8px 6px;
  display:flex; justify-content:space-between; align-items:center;
}
.sidebar .sb-label .mini{ color: var(--muted); }
.sb-quick{ display:flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.sb-item{
  display:flex; align-items:center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  text-decoration:none; cursor: pointer;
  transition: all .12s;
  border: 1px solid transparent;
  position: relative;
}
.sb-item:hover{ background: var(--paper); color: var(--ink); }
.sb-item.active{ background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-item.active::before{
  content:""; position:absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.sb-item .ic{
  width: 24px; height: 24px; border-radius: 7px;
  display:grid; place-items:center; flex-shrink:0;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.sb-item .ic svg{ width: 13px; height: 13px; }
.sb-item .n{ flex: 1; }
.sb-item .c{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); background: var(--paper); padding: 2px 6px; border-radius: 4px; }
.sb-item.active .c{ background: var(--card); color: var(--accent); }

.sb-cats{ display:flex; flex-direction: column; gap: 2px; }

.sb-footer{
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
}
.sb-stat{
  display:flex; justify-content:space-between; align-items:center;
  padding: 7px 8px; font-family: var(--ff-mono); font-size: 12px; color: var(--muted);
  letter-spacing: .06em;
}
.sb-stat b{ color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-stat .led{ width:6px; height:6px; border-radius:50%; background: #25B16E; box-shadow: 0 0 0 3px rgba(37,177,110,.16);}

/* ============ MAIN ============ */
.main{
  padding-left: 14px;
  min-width: 0;
}

/* topbar */
.topbar{
  display:flex; align-items:center; gap: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,.62);
  backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px -8px rgba(20,25,60,.06);
}
html[data-theme="dark"] .topbar{ background: rgba(20,24,40,.6); }
.breadcrumb{ display:flex; align-items:center; gap: 8px; font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.breadcrumb a{ color: var(--ink-2); text-decoration:none; }
.breadcrumb a:hover{ color: var(--accent); }
.breadcrumb .sep{ color: var(--line); }
.breadcrumb .now{ color: var(--ink); font-weight: 700; }

.topbar .spacer{ flex:1 }
.cmd-trigger{
  display:flex; align-items:center; gap: 10px;
  width: 320px; max-width: 40vw;
  padding: 7px 10px 7px 12px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px;
  cursor: text;
  color: var(--muted);
  font-size: 13px;
  transition: all .15s;
}
.cmd-trigger:hover{ border-color: var(--accent); background: var(--card); }
.cmd-trigger svg{ width: 14px; height: 14px; }
.cmd-trigger .ph{ flex: 1; }
.cmd-trigger .kbd{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; }

.top-acts{ display:flex; gap: 6px; align-items:center; }
.top-ic{
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2);
  display:grid; place-items:center; cursor: pointer; transition: all .12s;
  position: relative;
}
.top-ic:hover{ border-color: var(--accent); color: var(--accent); }
.top-ic svg{ width: 15px; height: 15px; }
.top-ic .badge{
  position:absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--ic-red); color: #fff; font-family: var(--ff-mono); font-size: 12px; font-weight: 700;
  display:grid; place-items:center; padding: 0 4px;
  box-shadow: 0 0 0 2px var(--card);
}

.top-cta{
  display:inline-flex; align-items:center; gap: 8px;
  height: 34px; padding: 0 14px;
  background: linear-gradient(180deg, var(--accent) 0%, #5339B8 100%);
  color: #fff;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(60,40,160,.5); cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 18px -4px rgba(106,75,224,.45);
  transition: all .15s;
}
.top-cta:hover{ filter: brightness(1.08); }
.top-cta svg{ width: 13px; height: 13px; }

/* ============ HERO ============ */
.hero{
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 32px 28px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(60,50,180,.18);
}
.hero-blur{
  position: absolute; inset: 0; pointer-events:none;
  background:
    radial-gradient(500px 250px at 8% -10%, rgba(106,75,224,.22), transparent 60%),
    radial-gradient(500px 300px at 100% 0%, rgba(59,91,219,.16), transparent 65%);
}
.hero-noise{
  position:absolute; inset:0; pointer-events:none;
  opacity: .4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.hero-grid{
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: start;
}

.eyebrow{
  display:inline-flex; align-items:center; gap: 10px;
  padding: 5px 12px 5px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(20,25,60,.05);
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  backdrop-filter: blur(8px);
}
.eyebrow .led{ width:8px; height:8px; border-radius:50%; background: #25B16E; box-shadow: 0 0 0 3px rgba(37,177,110,.2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse{ 50%{ opacity: .4 } }
.eyebrow .sep{ width:1px; height:12px; background: var(--line); }
.eyebrow .v{ font-family: var(--ff-mono); color: var(--muted); font-size: 12px;}

h1.title{
  font-size: 72px; line-height: 0.96;
  font-weight: 800; letter-spacing: -0.045em;
  margin: 18px 0 4px;
  color: var(--ink);
}
h1.title .em{
  font-family: var(--ff-serif); font-style: italic; font-weight: 400;
  background: linear-gradient(90deg, #6A4BE0 0%, #3B5BDB 60%, #C6478F 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.02em;
}
h1.title .cn{
  display:block;
  font-family: var(--ff-grotesk);
  font-weight: 600; font-size: 32px;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  margin-top: 12px;
}
.lead{ max-width: 520px; margin: 20px 0 0; font-size: 16px; line-height: 1.62; color: var(--ink-2); }
.lead b{ color: var(--ink); font-weight: 600; }

/* command palette inside hero */
.cmd{
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  display:flex; align-items:center; gap: 10px;
  box-shadow: 0 1px 2px rgba(20,25,60,.04), inset 0 1px 0 rgba(255,255,255,.6);
  position: relative;
}
.cmd:focus-within{ border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cmd .ic{ color: var(--muted); display:grid; place-items:center; }
.cmd .ic svg{ width: 17px; height: 17px; }
.cmd input{
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--ff); font-size: 15px; color: var(--ink);
  height: 32px;
}
.cmd input::placeholder{ color: var(--muted); }
.cmd .kb{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: var(--paper); padding: 3px 7px; border-radius: 6px; }
.cmd-hints{
  display:flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.hint{
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 6px;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer;
}
.hint:hover{ border-color: var(--accent); color: var(--accent); }
.hint .k{ color: var(--muted); margin-right: 4px; }

/* featured dashboard (right) */
.hero-board{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 12px;
  position: relative; z-index: 1;
}
.hbox{
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px;
  box-shadow: 0 1px 2px rgba(20,25,60,.04);
  position: relative; overflow: hidden;
  min-height: 180px;
}
.hbox.span2{ grid-column: span 2; min-height: auto; }
.hbox h6{
  font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 8px; display:flex; justify-content:space-between; align-items:center;
}
.hbox h6 .on{ color: #25B16E; display:inline-flex; align-items:center; gap:4px; font-weight: 600; }
.hbox h6 .on .d{ width:5px; height:5px; border-radius:50%; background: #25B16E; }

.counter{
  font-family: var(--ff-grotesk); font-weight: 600; font-size: 30px; line-height: 1;
  letter-spacing: -0.02em; color: var(--ink);
  display:flex; align-items:baseline; gap: 4px; font-variant-numeric: tabular-nums;
}
.counter .u{ font-size: 13px; color: var(--muted); font-weight: 500; }
.counter .trend{ font-family: var(--ff-mono); font-size: 12px; color: #25B16E; font-weight: 700; margin-left: 6px; }

.spark-full{ width: 100%; height: 44px; margin-top: 10px; }

.feat-mini{
  background: linear-gradient(135deg, rgba(106,75,224,.06), rgba(59,91,219,.03));
  border: 1px solid var(--line);
}
.feat-mini .row{ display:flex; align-items:center; gap: 10px; }
.feat-mini .ic{
  width: 38px; height: 38px; border-radius: 10px; color:#fff;
  background: linear-gradient(135deg, #6A4BE0, #3B5BDB);
  display:grid; place-items:center;
  box-shadow: 0 6px 14px -4px rgba(106,75,224,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.feat-mini .ic svg{ width: 18px; height: 18px; }
.feat-mini h5{ margin: 0 0 2px; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.feat-mini .en{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); }

.ring-box{ display:flex; align-items:center; gap: 14px; }
.ring-box .txt b{ color: var(--ink); }
.ring-box .txt{ font-size: 12px; color: var(--ink-2); line-height: 1.45; }

.activity-row{
  display:flex; justify-content:space-between; align-items:center;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px;
}
.activity-row:last-child{ border-bottom: none; }
.activity-row .l{ display:flex; align-items:center; gap: 8px; color: var(--ink-2); }
.activity-row .t{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); }
.activity-row .dot{ width: 6px; height: 6px; border-radius:50%; }

/* ============ HIGHLIGHT RAIL ============ */
.rail{
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.rail-card{
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  overflow: hidden;
  transition: all .2s;
  display:flex; flex-direction: column; gap: 10px;
  min-height: 116px;
}
.rail-card:hover{ transform: translateY(-2px); border-color: rgba(106,75,224,.35); box-shadow: 0 12px 30px -10px rgba(106,75,224,.28); }
.rail-card .tag{
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.rail-card .tag.new{ color: var(--ic-violet); }
.rail-card .tag.hot{ color: var(--ic-red); }
.rail-card .tag.beta{ color: var(--ic-teal); }
.rail-card h5{
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
.rail-card p{ margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.rail-card .meta{
  margin-top: auto; display:flex; justify-content:space-between; align-items:center;
  font-family: var(--ff-mono); font-size: 12px; color: var(--muted);
}
.rail-card .meta .go{ color: var(--accent); font-weight: 600; }
.rail-card::after{
  content:""; position:absolute; right: -40px; top: -40px; width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rc, rgba(106,75,224,.18)), transparent 60%);
  filter: blur(10px);
  opacity: .6;
}

/* ============ TOOL MATRIX ============ */
.matrix{ }
.sec{ margin-bottom: 24px; }
.sec-head{
  display:flex; align-items:center; gap: 14px;
  margin-bottom: 14px;
  padding: 0 4px;
}
.sec-label{
  display:inline-flex; align-items:center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 100px;
  background: var(--card); border: 1px solid var(--line);
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; color: var(--ink);
  box-shadow: 0 1px 2px rgba(15,20,50,.04);
}
.sec-label .icb{ width: 22px; height: 22px; border-radius: 7px; display:grid; place-items:center; color:#fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2);}
.sec-label .icb svg{ width: 12px; height: 12px; }
.sec-cn{ font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.sec-desc{ font-size: 13px; color: var(--muted); margin-left: 4px;}
.sec-line{ flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.sec-count{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em;}
.sec-count b{ color: var(--ink); }

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card{
  grid-column: span 3;
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: calc(16px * var(--density));
  cursor: pointer;
  transition: all .2s cubic-bezier(.2,.7,.2,1);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: calc(178px * var(--density));
  box-shadow: 0 1px 2px rgba(20,25,60,.03);
}
.card.feature{ grid-column: span 6; min-height: calc(210px * var(--density)); }
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(106,75,224,.35);
  box-shadow: 0 18px 44px -18px rgba(106,75,224,.35), 0 2px 10px rgba(15,20,50,.06);
}
.card .glow{
  position:absolute; inset:0; pointer-events:none; opacity:0;
  background: radial-gradient(260px 130px at var(--mx, 50%) 0%, var(--gcolor, rgba(106,75,224,.1)), transparent 60%);
  transition: opacity .25s;
}
.card:hover .glow{ opacity: 1; }
.card .grain{
  position:absolute; inset:0; pointer-events:none; opacity:.25;
  background: linear-gradient(to bottom, transparent 70%, var(--grain, rgba(106,75,224,.05)));
}

.c-top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 12px; }
.c-icon{
  width: 36px; height: 36px; border-radius: 10px;
  display:grid; place-items:center; color:#fff;
  box-shadow: 0 6px 14px -4px var(--icsh, rgba(59,91,219,.45)), inset 0 1px 0 rgba(255,255,255,.22);
}
.c-icon svg{ width: 18px; height: 18px; }

.c-right{ display:flex; align-items:center; gap: 6px; }
.c-unit{ font-family: var(--ff-mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.c-unit b{ color: var(--ink); font-weight: 700; }
.c-fav{
  width: 24px; height: 24px; border-radius: 6px;
  display:grid; place-items:center;
  color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.c-fav:hover{ background: var(--accent-soft); color: var(--accent); }
.c-fav.on{ color: var(--ic-red); }
.c-fav svg{ width: 13px; height: 13px; }

.card h4{ font-size: 15px; font-weight: 700; margin: 0 0 2px; letter-spacing: -0.015em; }
.card .en{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; letter-spacing: .02em; }
.card .desc{ font-size: 12px; line-height: 1.5; color: var(--ink-2); margin: 0; }

.c-bot{
  display:flex; justify-content: space-between; align-items:center;
  margin-top: auto; padding-top: 12px;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .06em;
}
.c-bot .l{ display:flex; gap: 8px; color: var(--muted); }
.c-bot .l b{ color: var(--ink); font-weight: 700; }
.c-bot .go{ color: var(--ink-2); font-weight: 600; display:inline-flex; align-items:center; gap: 4px; opacity: .5; transition: all .15s; }
.card:hover .c-bot .go{ opacity: 1; color: var(--accent); }
.c-bot .go .ar{ transition: transform .2s; }
.card:hover .c-bot .go .ar{ transform: translateX(3px); }

.c-status{
  display:inline-flex; align-items:center; gap: 4px;
  color: #25B16E; font-weight: 600;
}
.c-status .d{ width: 5px; height: 5px; border-radius: 50%; background: #25B16E; }

.c-ribbon{
  position:absolute; top: 12px; right: 0;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .1em;
  background: linear-gradient(90deg, #FF7E47, #FF5F6D);
  color:#fff; font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px 0 0 4px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px -2px rgba(255,95,109,.4);
  z-index: 3;
}
/* featured 大卡 ribbon 改放左上（和 icon 之间留出空间，避免和 UNIT 编号重叠）*/
.card.feature .c-ribbon{
  top: 16px; right: auto; left: 0;
  border-radius: 0 4px 4px 0;
  padding: 4px 12px;
  font-size: 12px; letter-spacing: .14em;
}
.c-ribbon.beta{ background: linear-gradient(90deg, #14A3A3, #2DC5BE); box-shadow: 0 4px 10px -2px rgba(20,163,163,.4); }
.c-ribbon.new{ background: linear-gradient(90deg, #6A4BE0, #3B5BDB); box-shadow: 0 4px 10px -2px rgba(106,75,224,.4); }
.c-ribbon.feat{ background: linear-gradient(90deg, #8E6EF0, #6A4BE0); box-shadow: 0 4px 10px -2px rgba(106,75,224,.45); }

.card .spark{
  position:absolute; right: 12px; bottom: 38px;
  width: 70px; height: 22px; opacity: .35; pointer-events:none;
}
.card:hover .spark{ opacity: .75; }

.card.feature h4{ font-size: 22px; }
.card.feature .en{ font-size: 12px; }
.card.feature .desc{ font-size: 13px; }
.card.feature .preview{
  margin: 14px 0 10px;
  height: 66px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(106,75,224,.08), rgba(59,91,219,.04) 60%, transparent),
    repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(15,20,50,.03) 6px, rgba(15,20,50,.03) 7px);
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 14px;
  font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .12em;
}
.card.feature .preview .mini-bars{ display:flex; gap: 3px; align-items: flex-end; height: 30px; }
.card.feature .preview .mini-bars i{ width: 4px; background: var(--accent); border-radius: 1px; opacity: .8;}

/* ============ FOOTER ============ */
footer{
  margin-top: 18px; padding: 22px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  display:flex; justify-content:space-between; align-items:center;
  font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em;
  flex-wrap: wrap; gap: 14px;
}
footer .fbrand{ display:flex; align-items:center; gap:10px; color: var(--ink); font-weight: 700; font-family: var(--ff-grotesk); font-size: 14px; letter-spacing: -0.01em; }
footer a{ color: var(--ink-2); text-decoration: none; }
footer a:hover{ color: var(--accent); }
footer nav{ display:flex; gap: 18px; }

/* ============ TWEAKS ============ */
.tweaks{
  position: fixed; bottom: 20px; left: 20px; z-index: 100;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; width: 290px; display: none;
  box-shadow: 0 20px 40px -12px rgba(15,20,50,.25);
}
.tweaks.on{ display:block; }
.tweaks h6{ display:flex; justify-content:space-between; align-items:center; font-family: var(--ff-mono); font-size: 12px; letter-spacing: .18em; color: var(--ink); text-transform: uppercase; font-weight: 700; margin: 0 0 14px; }
.tweaks h6 .x{ color: var(--muted); cursor: pointer; font-weight: 400; font-size: 16px; }
.tw-row{ margin-bottom: 14px; }
.tw-row label{ font-family: var(--ff-mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; display:block; margin-bottom: 6px; }
.tw-sw{ display:flex; gap: 8px; }
.sw{ width: 26px; height: 26px; border-radius: 7px; cursor: pointer; position:relative; }
.sw.on::after{ content:""; position:absolute; inset:-3px; border: 1.5px solid var(--ink); border-radius: 10px; }
.tw-seg{ display:flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.tw-seg button{ flex:1; background: transparent; border: none; padding: 7px 4px; font-family: var(--ff-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line); }
.tw-seg button:last-child{ border-right: none; }
.tw-seg button.on{ background: var(--ink); color: var(--paper); }

/* ============ COMMAND PALETTE OVERLAY ============ */
.palette-ov{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8,10,28,.55);
  backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.palette-ov.on{ display: flex; }
.palette{
  width: min(620px, 92vw);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 60px -12px rgba(10,14,40,.5);
  overflow: hidden;
  animation: pop .16s ease-out;
}
@keyframes pop{ from{ opacity:0; transform: translateY(-10px) scale(.98);} to{opacity:1; transform:none;} }
.palette .head{ display:flex; align-items:center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.palette .head svg{ width: 16px; height: 16px; color: var(--muted); }
.palette input{ flex: 1; border:none; outline:none; background: transparent; font-size: 15px; color: var(--ink); font-family: var(--ff); }
.palette input::placeholder{ color: var(--muted); }
.palette .esc{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px;}
.palette .results{ max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette .group-h{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; padding: 10px 10px 6px; }
.palette .item{
  display:flex; align-items:center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.palette .item:hover, .palette .item.sel{ background: var(--accent-soft); }
.palette .item .ic{ width: 28px; height: 28px; border-radius: 8px; display:grid; place-items:center; color:#fff; flex-shrink: 0;}
.palette .item .ic svg{ width: 14px; height: 14px; }
.palette .item .t{ flex: 1; }
.palette .item .t .n{ font-size: 13px; color: var(--ink); font-weight: 600; }
.palette .item .t .s{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); margin-top: 1px; }
.palette .item .cat{ font-family: var(--ff-mono); font-size: 12px; color: var(--muted); background: var(--paper); padding: 3px 7px; border-radius: 5px; letter-spacing: .06em;}
.palette .foot{ border-top: 1px solid var(--line); padding: 8px 14px; display:flex; justify-content:space-between; font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em;}
.palette .foot .keys span{ margin-right: 10px; }
.palette .foot .keys b{ background: var(--paper); border:1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--ink-2); font-weight: 600;}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px){
  .shell{ grid-template-columns: 200px 1fr; }
  .hero-grid{ grid-template-columns: 1fr; }
  .rail{ grid-template-columns: repeat(2, 1fr); }
  .card{ grid-column: span 6; }
  .card.feature{ grid-column: span 12; }
  h1.title{ font-size: 56px; }
}
@media (max-width: 820px){
  .shell{ grid-template-columns: 1fr; padding: 10px; }
  .sidebar{ position: relative; top: 0; height: auto; }
  .main{ padding-left: 0; }
  .hero{ padding: 22px 20px; }
  h1.title{ font-size: 44px; }
  h1.title .cn{ font-size: 22px; }
  .rail{ grid-template-columns: 1fr; }
  .cmd-trigger{ display:none; }
}
/* ============================================================
   V4 工具页专用：tool-header + 内容容器 + footer
   ============================================================ */
.v4-tool-header{
  position: relative;
  margin: 20px 0 0;
  padding: 32px 32px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 20px -10px rgba(20,25,60,.08);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}
.v4-tool-header::before{
  content:""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(500px 260px at -5% -20%, var(--accent-soft), transparent 60%),
    radial-gradient(400px 260px at 105% -20%, rgba(59,91,219,.08), transparent 60%);
}
.v4-th-main{ position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.v4-th-unit{
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .2em;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}
.v4-th-title{
  font-family: var(--ff-grotesk);
  font-size: 38px; line-height: 1.15;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}
.v4-th-sub{
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .08em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin-top: -4px;
}
.v4-th-desc{
  font-size: 14px; line-height: 1.7;
  color: var(--ink-2);
  margin: 6px 0 0;
  max-width: 640px;
}
.v4-th-tags{ display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.v4-th-tag{
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .04em;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
}

.v4-th-side{
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 120px;
}
.v4-th-status{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .14em;
  font-weight: 700;
  background: rgba(43,166,110,.1);
  border: 1px solid rgba(43,166,110,.2);
  border-radius: 6px;
  color: #2BA66E;
}
.v4-th-status .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: #2BA66E;
  box-shadow: 0 0 6px rgba(43,166,110,.6);
}
.v4-th-ver{
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .1em;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-weight: 600;
}
.v4-th-stats{ display: flex; flex-direction: column; gap: 6px; margin-top: 4px; align-items: flex-end; }
.v4-th-stat{
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .06em;
  color: var(--muted);
}
.v4-th-stat b{
  color: var(--ink);
  font-weight: 700;
  margin-left: 6px;
  font-family: var(--ff-grotesk);
  font-size: 13px;
}

/* 工具业务内容容器（tool-content 来自 v2 工具页，同时也给 v4-tool-body 一个底部留白）*/
.tool-content.v4-tool-body{
  position: relative;
  margin: 20px 0 40px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 20px -10px rgba(20,25,60,.06);
  min-height: 200px;
}

/* v4 页脚 */
.v4-foot{
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 24px 4px 16px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 12px; letter-spacing: .06em;
  color: var(--muted);
}
.v4-foot .fbrand{ display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.v4-foot .fbrand .mark{
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #8E6EF0 0%, #6A4BE0 45%, #3B5BDB 100%);
  border-radius: 7px; width: 24px; height: 24px;
}
.v4-foot nav{ display: flex; gap: 18px; flex-wrap: wrap; }
.v4-foot nav a{ color: var(--muted); text-decoration: none; transition: color .15s; }
.v4-foot nav a:hover{ color: var(--accent); }

/* 响应式：窄屏 tool-header 单列 */
@media (max-width: 820px){
  .v4-tool-header{ grid-template-columns: 1fr; padding: 24px 20px; }
  .v4-th-side{ flex-direction: row; align-items: center; flex-wrap: wrap; }
  .v4-th-stats{ align-items: flex-start; }
  .v4-th-title{ font-size: 28px; }
  .tool-content.v4-tool-body{ padding: 20px; margin: 14px 0 32px; }
}


/* ============================================================
   V2 → V4 变量桥（兼容 inc/tool-guides.php 和 inc/tool-faq.php
   等共享文件中的老变量，无需改动老代码）
   ============================================================ */
:root{
  /* 文本色 */
  --t:  var(--ink);
  --t2: var(--ink-2);
  --t3: var(--ink-2);
  --t4: var(--muted);
  --t5: var(--muted);
  --text:        var(--ink);
  --text-strong: var(--ink);
  --text-dim:    var(--muted);
  --dim:         var(--muted);
  /* 主色 */
  --blue:   var(--accent);
  --brand:  var(--accent);
  --cyan:   var(--accent-2);
  --green:  var(--ic-green);
  --g:      var(--ic-green);
  --danger: var(--ic-red);
  --red:    var(--ic-red);
  --amber:  var(--ic-amber);
  --orange: var(--ic-amber);
  --warn:   var(--ic-amber);
  --pink:   var(--ic-pink);
  --purple: var(--ic-violet);
  --violet: var(--ic-violet);
  /* 背景与边框 */
  --border:  var(--line);
  --surface: var(--paper);
  --bg-elev: var(--card);
  --bg:      var(--paper);
  /* 字体 */
  --fm:   var(--ff-mono);
  --fr:   var(--ff);
  --fb:   var(--ff);
  --fd:   var(--ff-grotesk);
  --mono: var(--ff-mono);
  --sans: var(--ff);
  /* 最短的单字母别名（image-compress 等老工具用过） */
  --r: var(--ic-red);
  /* ECC 简写桥 */
  --acc: var(--accent);
  --bdr: var(--line);
  --srf: var(--paper);
  --grn: var(--ic-green);
  --org: var(--ic-amber);
}

/* 字号铁律兜底：在 v4 body 下，把共享组件里的 <12px 字号拉到 12px */
body .tg-card-tag,
body .faq-label,
body .faq-q-icon,
body [style*="0.6875rem"],
body [style*="0.625rem"],
body [style*="0.5625rem"]{
  font-size: 0.75rem !important;
}
