/* ============================================================
   MiniForge · 后台基础样式
   ============================================================ */

:root {
  --brand: #ff5233;
  --brand-ink: #e23c1e;
  --brand-soft: #fff1ed;
  --ink: #12151a;
  --ink-2: #4b5563;
  --ink-3: #8a94a6;
  --line: #eaecf0;
  --line-2: #f2f4f7;
  --bg: #f7f8fa;
  --card: #ffffff;
  --ok: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -16px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 62px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff7a4d, var(--brand));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.03em;
  box-shadow: 0 4px 12px -4px rgba(255, 82, 51, .6);
}
.brand-text { display: flex; flex-direction: column; font-size: 15px; font-weight: 700; line-height: 1.1; }
.brand-text em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; }

.topnav { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: .15s;
}
.nav-link:hover { background: var(--line-2); color: var(--ink); }
.nav-link.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill-version {
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--line-2);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: .16s ease;
}
.btn:hover { border-color: #d6dae1; background: #fbfcfd; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #ff6a45, var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(255, 82, 51, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, #ff7a56, #f5492a); border-color: transparent; }
.btn-ghost { background: transparent; border-color: #d9dee6; }
.btn-ghost:hover { background: #fff; }
.btn-danger { color: #d92d20; border-color: #f5d3cf; }
.btn-danger:hover { background: #fff5f4; border-color: #eeb0a9; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 页面容器 ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 40px 28px 80px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
  padding: 44px 0 56px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 42px;
  line-height: 1.18;
  letter-spacing: -.035em;
}
.hero-sub {
  margin-top: 16px;
  max-width: 520px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.75;
}
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }
.hero-metrics {
  display: flex;
  gap: 34px;
  margin: 34px 0 0;
  padding: 22px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.hero-metrics strong { display: block; font-size: 22px; letter-spacing: -.03em; }
.hero-metrics span { font-size: 12px; color: var(--ink-3); }

/* ---------- 手机模型 ---------- */
.hero-visual { display: grid; place-items: center; }
.phone-stage { position: relative; }
.phone-mini {
  position: relative;
  width: 258px;
  height: 512px;
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(160deg, #2a2f38, #14171c);
  box-shadow: 0 40px 80px -40px rgba(16, 24, 40, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.phone-notch {
  position: absolute;
  top: 15px; left: 50%;
  transform: translateX(-50%);
  width: 78px; height: 18px;
  border-radius: 0 0 12px 12px;
  background: #14171c;
  z-index: 2;
}
.phone-screen {
  height: 100%;
  border-radius: 30px;
  background: #f5f6f8;
  overflow: hidden;
  padding: 26px 10px 10px;
}
.pm-bar { font-size: 10px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 8px; padding: 5px 8px; text-align: center; }
.pm-banner {
  margin-top: 8px;
  height: 96px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff8a5c, #ff4d6d);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.pm-nav { display: flex; justify-content: space-between; padding: 12px 6px 4px; }
.pm-nav i { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pm-goods { display: flex; gap: 6px; margin-top: 8px; }
.pm-goods b { flex: 1; height: 62px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.pm-tab {
  display: flex;
  justify-content: space-around;
  margin: 10px -10px -10px;
  padding: 8px 0 10px;
  background: #fff;
  border-top: 1px solid #f0f1f4;
}
.pm-tab span { font-size: 8px; color: #9aa0a6; }
.pm-tab span:first-child { color: var(--brand); font-weight: 600; }
.float-card {
  position: absolute;
  padding: 7px 13px;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
  white-space: nowrap;
}
.fc1 { left: -46px; top: 44px; color: #7c3aed; }
.fc2 { right: -52px; top: 186px; color: var(--brand-ink); animation-delay: 1.1s; }
.fc3 { left: -58px; bottom: 104px; color: #0d9488; animation-delay: 2.2s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- 区块 ---------- */
.section { padding: 26px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.section-head h2 { font-size: 20px; }
.section-head p { font-size: 13px; color: var(--ink-3); }

/* ---------- 项目卡片 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: .18s ease;
}
.proj-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dfe3ea; }
.proj-cover {
  position: relative;
  display: block;
  height: 116px;
  padding: 14px;
}
.proj-initial {
  position: absolute;
  right: 14px; bottom: 6px;
  font-size: 54px;
  font-weight: 800;
  color: rgba(255, 255, 255, .34);
  letter-spacing: -.05em;
  line-height: 1;
}
.proj-pages {
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, .22);
  padding: 2px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.proj-body { padding: 14px 16px 16px; }
.proj-body h3 { font-size: 15.5px; }
.proj-meta { margin-top: 5px; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; }
.proj-actions { display: flex; gap: 7px; margin-top: 14px; }

.proj-new {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  min-height: 218px;
  border: 1.5px dashed #d8dde5;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
.proj-new .plus { font-size: 26px; line-height: 1; color: #c2c8d2; }
.proj-new:hover { border-color: var(--brand); color: var(--brand-ink); background: #fffaf9; }
.proj-new:hover .plus { color: var(--brand); }

/* ---------- 模板卡片 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tpl-card {
  padding: 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: .18s ease;
}
.tpl-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-cover {
  position: relative;
  height: 128px;
  padding: 12px;
}
.tpl-cover span {
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, .2);
  padding: 2px 9px;
  border-radius: 999px;
}
.tpl-body { padding: 14px 16px 16px; }
.tpl-body h3 { font-size: 15px; }
.tpl-body p { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }
.tpl-meta { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 24, 40, .42); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: min(440px, calc(100vw - 40px));
  padding: 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { font-size: 18px; }
.modal-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.field { display: block; margin-top: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 7px; }
.field input, .field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 82, 51, .12); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 12px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: #14171c;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b42318; }

/* ---------- 页脚 ---------- */
.sitefoot {
  display: flex;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 空状态 ---------- */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 32px; }
  .hero-visual { display: none; }
  .proj-grid, .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 24px 16px 60px; }
  .topnav { display: none; }
  .proj-grid, .tpl-grid { grid-template-columns: 1fr; }
  .sitefoot { flex-direction: column; gap: 6px; }
}
