:root {
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #16a34a;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(30, 41, 59, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* 顶部导航 */
header.site {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); display: inline-block; }
.nav a.navlink { color: var(--muted); font-size: 15px; margin-left: 18px; }
.nav a.navlink:hover { color: var(--brand); }

/* 容器 */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

/* 首页 hero */
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 640px; }

/* 工具网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(30,41,59,.12); }
.tool-card .icon { font-size: 26px; }
.tool-card h3 { margin: 10px 0 6px; font-size: 17px; }
.tool-card p { color: var(--muted); font-size: 13px; margin: 0; }

/* 工具页布局 */
.tool-wrap { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 860px) {
  .tool-wrap { grid-template-columns: 1.4fr 1fr; }
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; font-size: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
button.calc {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
button.calc:hover { background: var(--brand-dark); }

.result {
  margin-top: 18px;
  background: #f0f6ff;
  border: 1px solid #c7ddff;
  border-radius: 10px;
  padding: 16px;
  font-size: 15px;
}
.result .big { font-size: 26px; font-weight: 800; color: var(--brand); }
.result table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.result td { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.result td:last-child { text-align: right; font-weight: 600; }

.note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* 广告位 */
.ad {
  background: repeating-linear-gradient(45deg,#fafafa,#fafafa 10px,#f0f0f0 10px,#f0f0f0 20px);
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 12px;
  margin: 18px 0;
}
.ad.leaderboard { min-height: 90px; }
.ad.rectangle { min-height: 250px; }
/* 广告位为空时整块隐藏（含 HTML 注释不算内容，故 :empty 生效） */
.ad:empty { display: none; }

/* 页脚 */
footer.site {
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 40px;
}
.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}
.foot a { color: var(--muted); margin-right: 14px; }

/* 面包屑 */
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.crumb a { color: var(--brand); }

.tag {
  display: inline-block;
  background: #eef2ff;
  color: var(--brand-dark);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
}
