/* 星菱工具箱 / 导航页共用样式
   浅色底 + 白色卡片，和门户、成员页保持一致 */

:root {
  --ink: #16233a;
  --muted: #61708a;
  --faint: #8b98ac;
  --accent: #2c5f8a;
  --accent-soft: rgba(44, 95, 138, 0.08);
  --line: #e3e8f0;
  --card: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 6vw, 72px) 20px 40px;
  font-family: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(760px 520px at 12% -10%, #e6f0fb 0%, transparent 62%),
    radial-gradient(700px 480px at 92% 4%, #ece7fb 0%, transparent 58%),
    radial-gradient(720px 520px at 50% 108%, #e8f6f0 0%, transparent 60%),
    #f0f2f5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(940px, 100%); }
.wrap.narrow { width: min(760px, 100%); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: rgba(44, 95, 138, 0.4);
}

h1 {
  margin: 16px 0 10px;
  font-size: clamp(27px, 4.2vw, 36px);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 卡片网格（组件页） ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 16px;
  margin-top: 38px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(30, 42, 58, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: #cfdbe9;
  box-shadow: 0 18px 40px rgba(30, 42, 58, 0.11);
  outline: none;
}

.card .icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card .icon svg { width: 20px; height: 20px; }

.card .name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card .desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.card .go {
  margin-top: auto;
  padding-top: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.card:hover .go { color: var(--accent); }

/* ---------- 分组列表（导航页） ---------- */
.section { margin-top: 38px; }

.section h2 {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.rows { display: grid; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.row:hover,
.row:focus-visible {
  transform: translateX(3px);
  border-color: #cfdbe9;
  box-shadow: 0 10px 24px rgba(30, 42, 58, 0.08);
  outline: none;
}

.row .mark {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.row .name {
  font-size: 14px;
  font-weight: 500;
}

.row .meta {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--faint);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.row .tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------- 工具面板 ---------- */
.panel {
  margin-top: 38px;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 14px 36px rgba(30, 42, 58, 0.07);
}

.panel .hint {
  margin-bottom: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.field { margin-bottom: 14px; }

.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: #a9c4e0;
  box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.10);
}

textarea { min-height: 96px; line-height: 1.6; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.btn:hover { background: #24507a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.ghost {
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
}

.btn.ghost:hover { color: var(--ink); border-color: #cfdbe9; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.result {
  padding: 14px 0 18px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: clamp(38px, 9vw, 60px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--accent);
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #eef2f7;
}

.seg label { position: relative; cursor: pointer; }

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.seg input:checked + span {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 42, 58, 0.12);
}

.range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range input { width: 110px; text-align: center; }
.range .sep { color: var(--faint); font-size: 13px; }

.file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.file input[type="file"] { font-size: 13px; }

.qr-box {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.qr-box #qrcode {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.qr-box #qrcode img,
.qr-box #qrcode canvas {
  display: block;
  width: 200px;
  height: 200px;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (max-width: 520px) {
  .row .meta { display: none; }
  .card { padding: 18px 16px 16px; }
}
