/* 零宽字符隐写术 — 浅色简洁主题（Notion / Linear 风格） */

:root {
  --bg: #FAFAF8;
  --bg-grad: radial-gradient(1100px 420px at 50% -12%, #EFF1FF 0%, rgba(239, 241, 255, 0) 60%);
  --surface: #FFFFFF;
  --surface-2: #F5F5F1;
  --border: #E8E6E0;
  --border-strong: #DAD7CE;
  --text: #1F2328;
  --muted: #6F6B63;
  --faint: #B2ADA3;
  --accent: #4F46E5;
  --accent-strong: #4338CA;
  --accent-soft: #EEF0FF;
  --success: #15803D;
  --warn-bg: #FFF7ED;
  --warn-border: #FED7AA;
  --warn-text: #9A3412;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 10px 28px -14px rgba(31, 35, 40, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

code {
  font-family: var(--mono);
  font-size: .92em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4F46E5, #7C6FF0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-sub { font-size: 11px; color: var(--muted); font-weight: 400; }

.tabs {
  display: flex;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.tab {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(31, 35, 40, .12);
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 54px 0 26px; }

.hero h1 {
  font-size: 34px;
  margin: 0 0 10px;
  letter-spacing: -.5px;
}

.hero-sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.hero-badges {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  color: var(--muted);
}

.badge b { color: var(--accent); font-weight: 600; }

/* ---------- 设置栏 ---------- */
.settings {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 6px 0 22px;
}

.setting-group { display: flex; flex-direction: column; gap: 7px; }
.setting-key { flex: 1; min-width: 260px; }

.setting-label { font-size: 13px; font-weight: 600; }

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.seg-option input { position: absolute; opacity: 0; pointer-events: none; }

.seg-option span {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}

.seg-option input:checked + span {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(31, 35, 40, .10);
}

.seg-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.key-input { min-width: 280px; width: 100%; }

/* ---------- 输入控件 ---------- */
.text-input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}

.text-input::placeholder { color: var(--faint); }

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px;
  resize: vertical;
  min-height: 130px;
  transition: border-color .15s, box-shadow .15s;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea-result { min-height: 96px; }
.field-gap { height: 22px; }

/* ---------- 面板与布局 ---------- */
.panel { display: none; }

.panel.active {
  display: block;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card { margin-top: 20px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h2 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.card-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn.copied {
  background: #DCFCE7;
  color: var(--success);
  border-color: #86EFAC;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 显形开关 ---------- */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.slider {
  width: 34px;
  height: 20px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background .18s;
  flex-shrink: 0;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform .18s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(14px); }

.switch-label { font-size: 13px; color: var(--muted); }

/* ---------- 预览 ---------- */
.preview {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 58px;
  margin: 0 0 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.preview.is-placeholder { color: var(--faint); }
.preview-carrier { margin-top: 2px; }
.preview-extracted { min-height: 42px; max-height: 96px; overflow-y: auto; }

.preview-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 6px;
}

.preview-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- 统计 ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--muted);
}

.chip b { color: var(--text); font-weight: 600; }

/* ---------- 警告 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}

/* ---------- 技术原理页 ---------- */
.table-wrap { overflow-x: auto; margin-top: 14px; }

.map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.map-table th, .map-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.map-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.map-table td:first-child { font-weight: 600; color: var(--accent); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }

.steps li {
  position: relative;
  padding: 0 0 18px 44px;
  counter-increment: step;
}

.steps li:last-child { padding-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.steps b { display: block; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: 14px; }

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

.scenario {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
}

.scenario h3 { margin: 0 0 6px; font-size: 14.5px; }
.scenario p { margin: 0; font-size: 13.5px; color: var(--muted); }

.notes { margin: 0; padding: 0; list-style: none; }

.notes li {
  position: relative;
  padding: 9px 0 9px 22px;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
}

.notes li:last-child { border-bottom: 0; }

.notes li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  color: var(--accent);
}

.notes b { font-weight: 600; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 52px;
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  text-align: center;
}

.disclaimer {
  color: var(--warn-text);
  font-size: 13px;
  margin: 0 0 8px;
}

.footer-note { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }

  .nav-inner {
    height: auto;
    padding: 12px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tabs { align-self: flex-start; }

  .hero { padding: 34px 0 20px; }
  .hero h1 { font-size: 27px; }
  .hero-sub { font-size: 15px; }

  .settings { align-items: stretch; }
  .setting-key { min-width: 0; }
  .key-input { min-width: 0; }

  .card { padding: 18px; }
}
