/* ============================================================
   Summer 查询 — 样式表
   纯静态，无外部依赖（不加载任何 CDN / 网络字体）
   ============================================================ */

:root {
  --mint: #7ddea8;
  --leaf: #3ecf8e;
  --forest: #1a7a4c;
  --deep: #0d4a32;
  --cream: #f4fff8;
  --gold: #f0c75e;
  --soft: #c8f5d8;

  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.72);

  --text: #0d4a32;
  --text-soft: #4a7a63;
  --text-dim: #7d9e8e;

  --line: rgba(26, 122, 76, 0.14);
  --line-strong: rgba(26, 122, 76, 0.28);

  --shadow-sm: 0 1px 2px rgba(13, 74, 50, 0.06);
  --shadow: 0 4px 16px rgba(13, 74, 50, 0.08);
  --shadow-lg: 0 12px 36px rgba(13, 74, 50, 0.12);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --maxw: 1120px;
  --header-h: 64px;
}

html[data-theme="dark"] {
  --cream: #0b1a13;
  --glass: rgba(18, 40, 30, 0.62);
  --glass-strong: rgba(20, 45, 34, 0.9);
  --glass-border: rgba(125, 222, 168, 0.16);

  --text: #e6f7ee;
  --text-soft: #a8c9ba;
  --text-dim: #7d9e8e;

  --line: rgba(125, 222, 168, 0.14);
  --line-strong: rgba(125, 222, 168, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 背景光斑 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 78% 52% at 8% 6%, rgba(125, 222, 168, 0.5), transparent 58%),
    radial-gradient(ellipse 66% 46% at 92% 14%, rgba(240, 199, 94, 0.24), transparent 52%),
    radial-gradient(ellipse 58% 48% at 46% 104%, rgba(62, 207, 142, 0.32), transparent 56%),
    linear-gradient(168deg, #eafff3 0%, #f8fffc 42%, #e2f9ec 100%);
}

html[data-theme="dark"] .bg {
  background:
    radial-gradient(ellipse 78% 52% at 8% 6%, rgba(62, 207, 142, 0.16), transparent 58%),
    radial-gradient(ellipse 66% 46% at 92% 14%, rgba(240, 199, 94, 0.08), transparent 52%),
    radial-gradient(ellipse 58% 48% at 46% 104%, rgba(62, 207, 142, 0.12), transparent 56%),
    linear-gradient(168deg, #08150f 0%, #0b1a13 46%, #07130d 100%);
}

/* ---------- 顶栏 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 2px 8px rgba(26, 122, 76, 0.22);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  flex: 1;
  min-width: 0;
}

.nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  transition: background 0.16s, color 0.16s;
  white-space: nowrap;
}

.nav a:hover { background: rgba(125, 222, 168, 0.2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: rgba(125, 222, 168, 0.24); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
  padding: 0;
}

.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }

html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

.nav-toggle { display: none; }

/* ---------- 布局 ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.hero { padding: 56px 0 34px; text-align: center; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--forest), var(--leaf) 55%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 15px;
}

/* ---------- 搜索 ---------- */
.search {
  position: relative;
  max-width: 460px;
  margin: 26px auto 0;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search input::placeholder { color: var(--text-dim); }
.search input:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(62, 207, 142, 0.16); }

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}

/* ---------- 工具网格 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 40px 0 16px;
}

.section-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.section-head span { font-size: 12.5px; color: var(--text-dim); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s,
    border-color 0.18s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(62, 207, 142, 0.5);
}

.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.card-ico {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--soft), rgba(240, 199, 94, 0.36));
  color: var(--forest);
  font-size: 15px;
  font-weight: 700;
}

.card h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }

.card .tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(125, 222, 168, 0.22);
  color: var(--forest);
  font-weight: 500;
}

html[data-theme="dark"] .tag { background: rgba(125, 222, 168, 0.14); color: var(--mint); }

.empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ---------- 工具页 ---------- */
.tool-head { padding: 40px 0 22px; }
.tool-head .crumb { font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; }
.tool-head .crumb a { color: var(--text-dim); text-decoration: none; }
.tool-head .crumb a:hover { color: var(--leaf); }
.tool-head h1 { margin: 0 0 6px; font-size: clamp(22px, 3.4vw, 30px); font-weight: 750; letter-spacing: -0.02em; }
.tool-head p { margin: 0; color: var(--text-soft); font-size: 14px; max-width: 640px; }

.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.panel + .panel { margin-top: 0; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

label.lbl {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text);
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(62, 207, 142, 0.14);
}

textarea { resize: vertical; min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; min-width: 0; }
.row.tight > * { flex: 0 1 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--leaf), var(--forest));
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(26, 122, 76, 0.24);
  transition: transform 0.14s, box-shadow 0.14s, opacity 0.14s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(26, 122, 76, 0.3); }
.btn:active { transform: translateY(0); }

.btn.ghost {
  background: var(--glass-strong);
  color: var(--text-soft);
  border-color: var(--line);
  box-shadow: none;
}

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

.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

.out {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(13, 74, 50, 0.05);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 44px;
  color: var(--text);
}

html[data-theme="dark"] .out { background: rgba(0, 0, 0, 0.28); }

.out .k { color: var(--text-dim); }
.out .v { color: var(--forest); font-weight: 600; }
html[data-theme="dark"] .out .v { color: var(--mint); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-family: inherit; font-size: 13.5px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ---------- 站点地图页 ---------- */
.site-list { list-style: none; margin: 0; padding: 0; }
.site-list li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.site-list li:last-child { border-bottom: 0; }
.site-list .site-ico { flex: 0 0 24px; text-align: center; font-size: 15px; line-height: 1.15; }
.site-list a { flex: 0 0 auto; min-width: 112px; font-weight: 600; color: var(--forest); text-decoration: none; }
.site-list a:hover { color: var(--leaf); text-decoration: underline; }
html[data-theme="dark"] .site-list a { color: var(--mint); }
.site-list .site-desc { flex: 1 1 auto; font-size: 12.5px; color: var(--text-dim); }

.hint { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }
.err { color: #c0392b; font-weight: 600; }
html[data-theme="dark"] .err { color: #ff8b7e; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: var(--maxw);
  margin: 56px auto 0;
  padding: 26px 20px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
}

.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--leaf); }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(13, 74, 50, 0.92);
  color: #eafff3;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 404 ---------- */
.center-page {
  min-height: calc(100vh - var(--header-h) - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.center-page .code {
  font-size: clamp(56px, 12vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(120deg, var(--forest), var(--leaf), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand-sub { display: none; }

  .nav.open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--glass-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--glass-border);
    margin: 0;
  }

  .nav.open a { padding: 11px 12px; font-size: 14.5px; }

  .hero { padding: 38px 0 24px; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
