/* ==========================================================================
   淮叶工具站 - 站点样式
   ========================================================================== */

:root {
  --blue: #2f6df6;
  --blue-dark: #1f52c9;
  --teal: #12b3a6;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #667085;
  --line: #e5e9f2;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(29, 36, 51, .06);
  --shadow-hover: 0 14px 34px rgba(47, 109, 246, .14);
  --max: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ============================ 头部 ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff; font-weight: 700; font-size: 19px;
  flex: none;
}
.logo-mark.small { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 16px; }
.logo-text small { color: var(--muted); font-size: 11px; letter-spacing: .3px; }

.nav { margin-left: auto; display: flex; gap: 6px; }
.nav a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  transition: .18s;
}
.nav a:hover { background: #eef2fb; color: var(--blue-dark); }
.nav a.active { background: #e9f0ff; color: var(--blue); font-weight: 600; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  padding: 9px 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  margin: 4px 0;
}

/* ============================ 首页 Hero ============================ */
.hero {
  background:
    radial-gradient(1000px 380px at 15% -20%, rgba(47, 109, 246, .18), transparent 60%),
    radial-gradient(900px 340px at 88% 0%, rgba(18, 179, 166, .16), transparent 62%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 56px 0 46px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue-dark);
  font-size: 12.5px;
  letter-spacing: .4px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 42px);
  letter-spacing: -.5px;
  margin-bottom: 14px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); font-size: 15.5px; margin-bottom: 26px; }

.search-box {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.search-box input {
  width: 100%;
  height: 50px;
  padding: 0 110px 0 20px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow);
  transition: .2s;
}
.search-box input:focus { border-color: #b9cdfb; box-shadow: 0 0 0 4px rgba(47, 109, 246, .12); }
.search-count {
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  color: var(--muted);
  pointer-events: none;
}
.search-box.small { max-width: 300px; margin: 0; }
.search-box.small input { height: 42px; font-size: 14px; padding-right: 20px; box-shadow: none; }
.search-box.small .search-count { display: none; }

.hero-tags { margin-top: 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.hero-tags a {
  font-size: 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
}
.hero-tags a:hover { color: var(--blue); border-color: #c9d9fb; background: #f7faff; }

/* ============================ 工具网格 ============================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 21px; margin: 0; }
.more { font-size: 14px; }

.group { margin-bottom: 30px; }
.group-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .6px;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--blue);
}

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

.tool-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 16px 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: #cfdcfb;
  box-shadow: var(--shadow-hover);
  color: var(--text);
}
.tool-icon {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: #eff4ff;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 15px;
}
.tool-icon.large { width: 54px; height: 54px; font-size: 20px; border-radius: 14px; }
.tool-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-body strong { font-size: 15px; }
.tool-body small { color: var(--muted); font-size: 12.8px; line-height: 1.55; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ============================ 工具详情 ============================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumb span { color: #aab2c0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

.tool-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.tool-head h1 { font-size: 24px; margin: 0 0 4px; }
.tool-head p { margin: 0; color: var(--muted); font-size: 14px; }
.local-badge {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: #0d7a71;
  background: #e6faf7;
  border: 1px solid #bdeee8;
  border-radius: 999px;
  padding: 4px 12px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 34px;
}
.loading { color: var(--muted); margin: 0; }

.related h2 { font-size: 18px; margin-bottom: 16px; }

/* ============================ 表单控件 ============================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #3b4457; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

textarea, input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: .18s;
}
textarea {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.6;
}
textarea[readonly] { background: #f6f8fc; }
textarea:focus, input:focus, select:focus {
  border-color: #b9cdfb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, .1);
}
select { cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.btn-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-group.center { justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3b4457;
  cursor: pointer;
  transition: .18s;
}
.btn:hover { border-color: #c9d6ee; background: #f7f9ff; color: var(--blue-dark); }
.btn.primary {
  background: linear-gradient(135deg, var(--blue), #4f86f7);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 109, 246, .25);
}
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 6px 12px; font-size: 13px; }

.msg { font-size: 13px; margin: 12px 0 0; min-height: 20px; color: var(--muted); }
.msg.ok { color: #0d7a71; }
.msg.err { color: #d64545; }

.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.stat {
  flex: 1 1 110px;
  background: #f7f9fe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.stat b { display: block; font-size: 19px; color: var(--blue-dark); }
.stat span { font-size: 12px; color: var(--muted); }

.result-box {
  background: #0f1729;
  color: #d7e2f7;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 60px;
}

.inline-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-row .field { margin-bottom: 0; flex: 1 1 180px; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #3b4457; cursor: pointer; }
.swatch {
  width: 100%;
  height: 90px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

mark { background: #fff2a8; padding: 0 1px; border-radius: 2px; }

/* ============================ 特性 / 页面 ============================ */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.2px; }

.page-title { font-size: 26px; margin-bottom: 22px; }

.prose {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  font-size: 14.5px;
}
.prose h2 { font-size: 17px; margin: 26px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0 0 1em; padding-left: 22px; color: #3b4457; }
.prose li { margin-bottom: 4px; }

.info-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 14px; }
.info-table th, .info-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.info-table th { width: 130px; color: var(--muted); font-weight: 500; background: #fafbfe; }

.not-found { text-align: center; padding: 60px 0 80px; }
.not-found .code {
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 10px;
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.not-found p { color: var(--muted); }

/* ============================ 页脚 ============================ */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 28px;
  padding-bottom: 32px;
}
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.footer-desc { color: var(--muted); font-size: 12.8px; margin: 0; max-width: 300px; }
.footer-col h4 { font-size: 13px; color: #3b4457; margin-bottom: 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.footer-links li { margin-bottom: 8px; color: var(--muted); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-bottom p { margin: 0 0 6px; }
.footer-bottom .beian { font-size: 13px; color: #3b4457; }
.footer-bottom .beian a { color: #3b4457; font-weight: 500; }
.footer-bottom .beian a:hover { color: var(--blue); text-decoration: underline; }
.footer-bottom .beian .sep { margin: 0 8px; color: #c6ccd8; }
.footer-bottom .disclaimer { font-size: 12px; color: #98a1b3; margin: 0; }

.back-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: .22s;
  z-index: 90;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { color: var(--blue); border-color: #c9d6ee; }

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .feature-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 30px 0; }
  .hero { padding: 38px 0 34px; }
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
    box-shadow: 0 12px 24px rgba(29, 36, 51, .08);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; border-radius: 10px; }
  .nav-toggle { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .tool-head { flex-wrap: wrap; }
  .local-badge { margin-left: 0; }
  .prose { padding: 22px; }
  .panel { padding: 17px; }
  .section-head { flex-direction: column; align-items: stretch; }
  .search-box.small { max-width: none; }
}
