/* ============================================================================
   tools.jiunotes.top · 实用工具速查站 · 统一皮肤
   ----------------------------------------------------------------------------
   设计语言与主站（玖的分享站 jiunotes.top）完全同源：
   - 同一套 :root 设计 token（暖瓷米色 / 品牌红 / 圆角）
   - 同一套组件类名（.brand / .site-header / .site-footer / .tool-card）
   改样式时保持与主站 admin/skins/base.css 的视觉一致。
   ========================================================================== */

/* ============ 设计 token（与主站 default 皮肤一致） ============ */
:root {
  --bg: #faf8f3;
  --bg-soft: #f3efe6;
  --bg-alt: #f6f2e9;
  --bg-card: #ffffff;
  --text: #1c1a17;
  --text-soft: #6b655d;
  --text-muted: #726b60;
  --brand: #c8332b;
  --brand-soft: #fbeee9;
  --brand-dark: #9e211b;
  --accent: #c8332b;
  --border: #e6e1d6;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 6px 20px rgba(16,24,40,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --serif: "Iowan Old Style","Palatino Linotype","Songti SC","Noto Serif SC",Georgia,"Times New Roman",serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --post-card-min: 300px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 800;
}
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: .95rem;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 36px; text-align: center; }
.hero h1 { font-size: 2.3rem; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero h1 span { color: var(--brand); }
.hero p { color: var(--text-soft); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }
.hero .hero-badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- Tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 8px 0 48px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.tool-card .tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.tool-card h3 { margin: 4px 0 0; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--text-soft); font-size: .94rem; }
.tool-card .tool-tag {
  margin-top: auto;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.tool-card .tool-tag::after { content: "→"; color: var(--brand); font-weight: 700; }

/* ---------- Tool page ---------- */
.tool-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}
.tool-shell .tool-head { margin-bottom: 20px; }
.tool-shell .tool-head h1 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.tool-shell .tool-head p { color: var(--text-soft); margin: 0; }

.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.tool-panel label { display: block; font-weight: 600; font-size: .95rem; margin: 0 0 6px; }
.tool-panel .field { margin-bottom: 16px; }
.tool-panel .field:last-child { margin-bottom: 0; }
.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel select,
.tool-panel textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.tool-panel input:focus,
.tool-panel select:focus,
.tool-panel textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.tool-panel textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .swap { display: flex; align-items: flex-end; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

.tool-result {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--brand-soft);
  border: 1px solid #f2d8cf;
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 600;
  display: none;
}
.tool-result.show { display: block; }
.tool-result .sub { display: block; font-weight: 400; font-size: .88rem; color: var(--text-soft); margin-top: 6px; }

.tool-tip { font-size: .85rem; color: var(--text-muted); margin-top: 10px; }

/* 点单翻译结果表 */
.menu-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.menu-table th, .menu-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: .95rem; vertical-align: top;
}
.menu-table th { color: var(--text-soft); font-weight: 600; background: var(--bg-alt); }
.menu-table td .zh { display: block; font-weight: 600; }
.menu-table td .en { display: block; color: var(--text-soft); font-size: .9rem; }

/* 高铁速查结果 */
.rail-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .95rem; }
.rail-table th, .rail-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rail-table th { color: var(--text-soft); font-weight: 600; background: var(--bg-alt); }
.rail-table tr:hover td { background: var(--bg-alt); }

/* 菜谱结果 */
.recipe-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; background: var(--bg-card); }
.recipe-card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.recipe-card .meta { color: var(--text-muted); font-size: .85rem; margin: 0 0 10px; }
.recipe-card .ing { color: var(--text-soft); font-size: .94rem; margin: 0 0 10px; white-space: pre-wrap; }
.recipe-card .steps { font-size: .95rem; white-space: pre-wrap; margin: 0; color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 24px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-soft); font-size: .92rem; }
.footer-links a:hover { color: var(--brand); }
.footer-note { width: 100%; color: var(--text-muted); font-size: .85rem; margin-top: 14px; }

/* ---------- Related articles（互链到主站） ---------- */
.rel-links { display: flex; flex-direction: column; gap: 10px; }
.rel-links a {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--text); font-size: .95rem; line-height: 1.5;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.rel-links a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.rel-links a::before { content: "›"; color: var(--brand); font-weight: 700; }

/* ---------- Back to main site ---------- */
.back-home {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-soft); font-size: .9rem; margin-bottom: 12px;
}
.back-home:hover { color: var(--brand); }

/* ---------- Utility ---------- */
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.section-title {
  font-size: 1.2rem; margin: 8px 0 18px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 5px; height: 18px;
  background: var(--brand); border-radius: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero h1 { font-size: 1.8rem; }
  .header-inner { height: 58px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px 10px; font-size: .88rem; }
  .tool-shell { padding: 24px 16px 48px; }
  .tool-panel { padding: 18px; }
}
