/* ============================================================
   轻匣工具 · 基础样式
   纯静态、零依赖、浏览器端处理
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --border: #e5e8ee;
  --border-strong: #d3d8e2;
  --text: #14181f;
  --text-2: #5b6472;
  --text-3: #8b94a3;
  --brand: #1f5eff;
  --brand-dark: #1747c4;
  --brand-soft: #eef3ff;
  --ok: #0f8a5f;
  --ok-soft: #e9f7f0;
  --warn: #b45309;
  --danger: #c53030;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, .05), 0 1px 3px rgba(20, 24, 31, .04);
  --shadow-md: 0 4px 16px rgba(20, 24, 31, .07), 0 1px 3px rgba(20, 24, 31, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 16.5px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #4b8bff 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(31, 94, 255, .28);
}
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--brand); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 34px; text-align: center; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(27px, 4.2vw, 38px);
  line-height: 1.28;
  font-weight: 760;
  letter-spacing: -.022em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand), #6aa2ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  margin: 0 auto; max-width: 620px;
  color: var(--text-2); font-size: 15.5px;
}
.hero-badges {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 9px; margin-top: 22px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.badge b { color: var(--ok); font-weight: 650; }

/* ---------- Section title ---------- */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 40px 0 16px;
}
.section-title h2 {
  margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.012em;
}
.section-title span { font-size: 13px; color: var(--text-3); }

/* ---------- Tool grid ---------- */
.tool-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.tool-card {
  display: block;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: inherit;
}
.tool-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 18px; margin-bottom: 12px;
}
.tool-card h3 {
  margin: 0 0 6px; font-size: 15.5px; font-weight: 650; color: var(--text);
  letter-spacing: -.008em;
}
.tool-card p { margin: 0; font-size: 13.2px; color: var(--text-2); line-height: 1.58; }
.tool-card .tag {
  display: inline-block; margin-top: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); padding: 3px 8px; border-radius: 5px;
}

/* ---------- Panel / workbench ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 {
  margin: 0 0 8px; font-size: clamp(23px, 3.4vw, 29px);
  font-weight: 720; letter-spacing: -.018em;
}
.page-head p { margin: 0; color: var(--text-2); font-size: 14.6px; max-width: 680px; }
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--brand); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin: 22px 0;
}

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 42px 24px;
  border: 1.6px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone svg { color: var(--text-3); }
.dropzone:hover svg, .dropzone.dragover svg { color: var(--brand); }
.dropzone strong { font-size: 14.6px; font-weight: 620; }
.dropzone small { font-size: 12.6px; color: var(--text-3); }
.dropzone input[type=file] { display: none; }

/* ---------- Controls ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.2px; font-weight: 600; color: var(--text); margin-bottom: 7px;
}
.field label .val {
  font-family: var(--mono); font-size: 12.4px;
  color: var(--brand); font-weight: 600;
}
.field .hint { font-size: 12.4px; color: var(--text-3); margin-top: 5px; }

input[type=range] {
  width: 100%; height: 4px; border-radius: 3px;
  background: var(--border-strong); outline: none; -webkit-appearance: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand); cursor: pointer;
  box-shadow: 0 1px 4px rgba(31, 94, 255, .4);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--brand); cursor: pointer;
}

input[type=text], input[type=number], select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 94, 255, .12);
}

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

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all .14s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand); border-color: var(--brand);
  color: #fff; font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.2px; font-weight: 620;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-primary:disabled { background: var(--border-strong); cursor: not-allowed; }
.btn-ghost {
  background: var(--surface); color: var(--text-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Result list ---------- */
.result-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.result-item img {
  width: 46px; height: 46px; object-fit: cover;
  border-radius: 7px; border: 1px solid var(--border); flex: none;
}
.result-meta { flex: 1; min-width: 0; }
.result-meta .name {
  font-size: 13.4px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-meta .size { font-size: 12.2px; color: var(--text-3); margin-top: 2px; }
.result-meta .size b { color: var(--ok); }
.result-item .btn { padding: 7px 14px; font-size: 13px; flex: none; }

.empty-note {
  padding: 26px; text-align: center; color: var(--text-3); font-size: 13.5px;
}

/* ---------- Ad slot ---------- */
.ad-slot {
  margin: 26px 0;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  min-height: 90px;
  display: grid; place-items: center;
}

/* ---------- Prose ---------- */
.prose { max-width: 760px; }
.prose h2 {
  font-size: 17.5px; font-weight: 700; letter-spacing: -.012em;
  margin: 32px 0 10px;
}
.prose h3 {
  font-size: 15px; font-weight: 650; margin: 22px 0 8px;
}
.prose p, .prose li { font-size: 14.2px; color: var(--text-2); line-height: 1.78; }
.prose ul { padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose li strong { color: var(--text); font-weight: 620; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 60px; padding: 30px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 14px 24px;
  align-items: center; justify-content: space-between;
  font-size: 12.8px; color: var(--text-3);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--brand); }
.filing { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mono { font-family: var(--mono); }

@media (max-width: 720px) {
  .nav { gap: 14px; }
  .nav a:not(.nav-keep) { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .hero { padding: 36px 0 22px; }
  .dropzone { padding: 32px 18px; }
}

/* ---------- 教程 / 长尾文章 ---------- */
.article .prose { max-width: none; overflow-x: auto; }
.article .prose > *:first-child { margin-top: 0; }
.article table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 13.6px; min-width: 420px;
}
.article th, .article td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article th {
  background: var(--surface-2); font-weight: 650; color: var(--text);
  white-space: nowrap; border-bottom: 1px solid var(--border-strong);
}
.article td { color: var(--text-2); }
.article tr:last-child td { border-bottom: none; }
.article .note {
  margin: 18px 0; padding: 14px 16px; font-size: 13.8px; line-height: 1.75;
  color: var(--text-2); background: var(--brand-soft);
  border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article .note b { color: var(--text); }
.article-meta { font-size: 12.8px; color: var(--text-3); margin: 8px 0 0; }
.article-list { display: grid; gap: 12px; margin: 24px 0; }
.article-item {
  display: block; padding: 18px 20px; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.article-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); color: inherit; }
.article-item h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; }
.article-item p { margin: 0; font-size: 13.4px; color: var(--text-2); line-height: 1.62; }
.article-item time { display: block; margin-top: 9px; font-size: 12.4px; color: var(--text-3); }
