/* =========================================================
   MOYU 工具箱 · 公共设计系统
   沿用 MOYU 品牌：深蓝夜色 + 金色点缀
   ========================================================= */
:root {
  --night: #0A1628;
  --night-2: #0E1E35;
  --night-3: #142844;
  --night-4: #1A3358;
  --ink: #E8EEF7;
  --ink-dim: #9FB0C8;
  --ink-faint: #6B7D96;
  --gold: #E8B45A;
  --gold-soft: #F4D48E;
  --gold-deep: #D99A3D;
  --line: rgba(232, 238, 247, 0.1);
  --line-gold: rgba(232, 180, 90, 0.25);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --ok: #4ECB8D;
  --danger: #E26D6D;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 8px 30px rgba(232, 180, 90, 0.2);
  --nav-h: 64px;
  --max-w: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(26, 51, 88, 0.55), transparent 60%),
    radial-gradient(900px 480px at -10% 4%, rgba(232, 180, 90, 0.08), transparent 55%),
    var(--night);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--ink); }
img { max-width: 100%; display: block; }
::selection { background: rgba(232, 180, 90, 0.32); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 22, 40, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  height: var(--nav-h); padding: 0 22px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; font-size: 18px; letter-spacing: .5px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-gold); }
.brand em { font-style: normal; color: var(--gold); }
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--ink-faint); }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 14.5px; color: var(--ink-dim);
  transition: all .2s; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--card); }
.nav-links a.active { color: var(--gold-soft); background: rgba(232, 180, 90, 0.08); }
.nav-toggle { display: none; margin-left: auto; font-size: 24px; color: var(--gold); }

/* ---------- 布局容器 ---------- */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 22px; }
.section { padding: 46px 0; }
.page-head { padding: 54px 0 26px; }
.page-head .kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: var(--gold); border: 1px solid var(--line-gold);
  padding: 5px 14px; border-radius: 20px; margin-bottom: 16px;
  background: rgba(232, 180, 90, 0.06);
}
.page-head h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 900; letter-spacing: .5px; line-height: 1.25; }
.page-head h1 span { color: var(--gold); }
.page-head p { margin-top: 12px; color: var(--ink-dim); max-width: 720px; font-size: 15.5px; }

/* ---------- 卡片 / 网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  transition: transform .25s, border-color .25s, background .25s;
}
a.card:hover, .card.hoverable:hover {
  transform: translateY(-4px); background: var(--card-hover);
  border-color: var(--line-gold); box-shadow: var(--shadow);
}
.card .ico {
  width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center;
  font-size: 25px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(232,180,90,.18), rgba(232,180,90,.05));
  border: 1px solid var(--line-gold);
}
.card h3 { font-size: 18px; font-weight: 800; margin-bottom: 7px; }
.card p { color: var(--ink-dim); font-size: 14px; }
.card .go { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--gold); }
.card .tag-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12px; color: var(--ink-dim); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,.03);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: all .2s; user-select: none;
}
.btn:hover { background: var(--card-hover); border-color: var(--line-gold); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1a1200; border-color: transparent; box-shadow: var(--shadow-gold);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--gold-soft), var(--gold)); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(226,109,109,.35); color: var(--danger); }
.btn-danger:hover { background: rgba(226,109,109,.1); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-dim); margin-bottom: 8px; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  background: rgba(0,0,0,.22); border: 1px solid var(--line);
  transition: border-color .2s; outline: none;
}
.input:focus, textarea.input:focus, select.input:focus { border-color: var(--line-gold); }
textarea.input { resize: vertical; line-height: 1.7; }
select.input option { background: var(--night-3); color: var(--ink); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

/* ---------- 工具工作台通用 ---------- */
.tool-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.tool-layout > * { min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { font-size: 16px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.big-stage {
  min-height: 380px; display: grid; place-items: center;
  background: rgba(0,0,0,.18); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 24px; position: relative;
}

/* ---------- 徽章 / 结果 ---------- */
.pill { font-size: 12.5px; padding: 4px 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); color: var(--ink-dim); }
.result-name {
  font-size: clamp(40px, 9vw, 84px); font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-align: center; line-height: 1.1;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--night-4); border: 1px solid var(--line-gold); color: var(--ink);
  padding: 12px 22px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .3s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0; color: var(--ink-faint); font-size: 13.5px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer a { color: var(--ink-dim); }
.footer a:hover { color: var(--gold); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Hero(首页) ---------- */
.hero { padding: 70px 0 40px; text-align: center; position: relative; }
.hero .kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 4px;
  color: var(--gold); border: 1px solid var(--line-gold); padding: 6px 18px;
  border-radius: 20px; margin-bottom: 24px; background: rgba(232,180,90,.06);
}
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 900; line-height: 1.18; }
.hero h1 .grad {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 20px auto 0; max-width: 640px; color: var(--ink-dim); font-size: 16.5px; }
.hero .cta-row { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.stat-row { display: flex; gap: 34px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat b { display: block; font-size: 30px; font-weight: 900; color: var(--gold); }
.stat span { font-size: 13px; color: var(--ink-faint); letter-spacing: 1px; }
.sec-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.sec-title h2 { font-size: 24px; font-weight: 900; }
.sec-title span { font-size: 13.5px; color: var(--ink-faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tool-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px;
    background: rgba(10,22,40,.97); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 34px 0; }
}

/* ---------- 灯箱 Lightbox ---------- */
.lb-overlay{position:fixed;inset:0;z-index:1000;background:rgba(4,8,16,.93);backdrop-filter:blur(6px);display:grid;place-items:center;animation:lbIn .25s ease}
@keyframes lbIn{from{opacity:0}to{opacity:1}}
.lb-stage{position:relative;max-width:min(94vw,1200px);max-height:92vh}
.lb-stage img{max-width:94vw;max-height:86vh;border-radius:12px;box-shadow:0 30px 80px rgba(0,0,0,.6);border:1px solid var(--line-gold)}
.lb-cap{position:absolute;left:0;right:0;bottom:-34px;text-align:center;color:var(--ink-dim);font-size:14px;letter-spacing:1px}
.lb-close,.lb-prev,.lb-next{position:absolute;border:1px solid var(--line);background:rgba(10,22,40,.7);color:var(--ink);width:46px;height:46px;border-radius:50%;font-size:26px;line-height:1;display:grid;place-items:center;transition:.2s}
.lb-close:hover,.lb-prev:hover,.lb-next:hover{border-color:var(--gold);color:var(--gold)}
.lb-close{top:-18px;right:-18px;font-size:24px;z-index:2}
.lb-prev{left:-60px;top:50%;transform:translateY(-50%)}
.lb-next{right:-60px;top:50%;transform:translateY(-50%)}
@media(max-width:680px){.lb-prev{left:6px}.lb-next{right:6px}.lb-close{top:8px;right:8px}}
