/* LiteBox — 轻盒工具箱
   Light theme, no external dependencies. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fbfcfd;
  --line: #e6e9ef;
  --line-strong: #d5dae3;
  --text: #0e1726;
  --text-2: #475467;
  --text-3: #8494a8;
  --accent: #2f5bff;
  --accent-2: #6b4dff;
  --accent-soft: #eef2ff;
  --ok: #0f9d58;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 10px 28px -12px rgba(16, 24, 40, .16);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.28; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }

::selection { background: #dbe4ff; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; font-size: 15px; font-weight: 800; box-shadow: 0 4px 12px -4px rgba(47, 91, 255, .7);
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; line-height: 1; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--text-2); font-size: 14px; font-weight: 500; padding: 7px 11px; border-radius: 9px;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav .nav-cta {
  margin-left: 6px; color: #fff; background: var(--text);
  box-shadow: var(--shadow-sm);
}
.nav .nav-cta:hover { background: #1d2939; color: #fff; }

/* ---------- generic blocks ---------- */
.section { padding: 56px 0; }
.section-head { max-width: 620px; margin-bottom: 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.section-head h2 { font-size: 26px; }
.section-head p { margin-top: 10px; color: var(--text-2); font-size: 15px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 22px; }

/* ---------- hero ---------- */
.hero { padding: 62px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -160px -10% auto -10%; height: 420px;
  background:
    radial-gradient(46% 60% at 22% 40%, rgba(47, 91, 255, .13), transparent 70%),
    radial-gradient(40% 60% at 78% 25%, rgba(107, 77, 255, .12), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; }
.hero h1 { font-size: 42px; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin-top: 18px; font-size: 17px; color: var(--text-2); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; color: var(--text-3); font-size: 13px; }
.hero-badges span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, #3a63ff, #2f5bff);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 8px 20px -10px rgba(47, 91, 255, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, #2a55f5, #2348e0); text-decoration: none; }
.btn-ghost { background: var(--panel); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--panel-2); border-color: #c3cad6; text-decoration: none; }
.btn-quiet { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-quiet:hover { background: #eef1f6; color: var(--text); text-decoration: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- tool cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfd8ea; }
.tool-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 19px;
}
.tool-card h3 { font-size: 16px; }
.tool-card p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.tool-card .meta { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.tag.blue { background: var(--accent-soft); color: var(--accent); }
.tag.gray { background: #f0f2f6; color: var(--text-2); }

/* ---------- feature list ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.feature { display: flex; gap: 12px; }
.feature .fi {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 700;
}
.feature h4 { font-size: 14.5px; margin-bottom: 3px; }
.feature p { font-size: 13.5px; color: var(--text-2); }

/* ---------- ad slot ---------- */
.ad-slot {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, #fbfcfe 0 10px, #f7f9fc 10px 20px);
  color: var(--text-3); font-size: 12px;
  display: grid; place-items: center; text-align: center;
  min-height: 96px; padding: 16px; letter-spacing: .04em;
}
.ad-slot strong { display: block; font-size: 13px; color: var(--text-2); font-weight: 600; letter-spacing: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 18px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 14.5px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 0 16px; color: var(--text-2); font-size: 14px; }

/* ---------- tool page layout ---------- */
.page-head { padding: 36px 0 20px; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.page-head h1 { font-size: 30px; letter-spacing: -.03em; }
.page-head p { margin-top: 10px; color: var(--text-2); max-width: 640px; }

.workspace { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* dropzone */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--panel-2); padding: 34px 22px; text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { font-size: 26px; margin-bottom: 8px; }
.dropzone strong { display: block; font-size: 15px; margin-bottom: 4px; }
.dropzone span { color: var(--text-3); font-size: 13px; }

/* file rows */
.file-list { display: grid; gap: 8px; margin-top: 14px; }
.file-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel);
}
.file-row .thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: #f0f2f6; border: 1px solid var(--line);
}
.file-row .fname { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsub { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-row .fsub .arrow { color: var(--text-3); }
.file-row .fsub .new { color: var(--ok); font-weight: 600; }
.file-row .fsub .kept { color: var(--text-3); }
.file-row .factions { display: flex; align-items: center; gap: 6px; }
.save-pill { font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 7px; border-radius: 999px; }

.summary-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--accent-soft); border: 1px solid #dbe3ff;
  border-radius: var(--radius-sm); font-size: 13.5px; color: #1e3a8a; margin-top: 14px;
}
.summary-bar b { font-weight: 700; }
.summary-bar .spacer { margin-left: auto; }

/* form controls */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
select, input[type="text"], input[type="number"], textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 91, 255, .14); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
textarea.mono, .mono { font-family: var(--mono); font-size: 13px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; background: #e3e8f0; outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(16,24,40,.22); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; transition: all .14s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

.note {
  font-size: 12.5px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid #ffe4bf; border-radius: var(--radius-sm); padding: 10px 12px;
}
.muted { color: var(--text-3); font-size: 13px; }

/* content prose */
.prose h2 { font-size: 21px; margin: 30px 0 10px; }
.prose h3 { font-size: 16.5px; margin: 22px 0 8px; }
.prose p { color: var(--text-2); margin: 10px 0; font-size: 14.5px; }
.prose ul, .prose ol { color: var(--text-2); font-size: 14.5px; padding-left: 22px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose .panel { padding: 22px; }
.prose code { font-family: var(--mono); font-size: 13px; background: #f0f2f6; padding: 1px 5px; border-radius: 5px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; padding: 36px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; }
.footer-grid h5 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text-2); font-size: 13.5px; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--text-3); font-size: 12.5px;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px);
  background: #101828; color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav a:not(.nav-cta) { display: none; }
  .tool-grid, .feature-grid, .stat-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 29px; }
  .hero p.lead { font-size: 15.5px; }
  .section { padding: 40px 0; }
  .panel-pad { padding: 16px; }
  .file-row { grid-template-columns: 38px 1fr; }
  .file-row .factions { grid-column: 1 / -1; justify-content: flex-end; }
  .file-row .thumb { width: 38px; height: 38px; }
}
