/* ============================================================
   0574666.top  —  统一样式表
   设计基调：简洁、卡片化、移动端优先、浅色主题
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --bg-soft: #eef1f6;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e3e8ef;
  --border-strong: #cfd6e0;
  --text: #1a2233;
  --text-2: #5a667d;
  --text-3: #8a94a6;
  --brand: #3b82d6;
  --brand-weak: #eef5fd;
  --brand-2: #2563b0;
  --ok: #12a150;
  --ok-weak: #e6f7ee;
  --warn: #e08700;
  --warn-weak: #fff4e2;
  --danger: #e5484d;
  --danger-weak: #fdeceb;
  --purple: #7c4dff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 32px rgba(16, 24, 40, .12);
  --header-h: 60px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

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

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

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

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }

textarea, input, select, button { font-family: inherit; font-size: inherit; }

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

/* 头部：套用主站风格（居中品牌 + 全站导航 + 工具分类） */
.site-header {
  padding: 44px 0 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--brand-weak) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: block; height: auto; }
.brand {
  display: inline-block;
  font-size: clamp(26px, 4.2vw, 36px);
  font-weight: 800; letter-spacing: 3px; line-height: 1.25;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 45%, #7cb3e8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand:hover { text-decoration: none; }
.site-sub {
  margin: 6px 0 0; font-size: 14px; color: var(--text-3); letter-spacing: 2px;
}
.site-title-divider {
  width: 68px; height: 3px; margin: 16px auto 14px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), #5b8fd4, #7cb3e8); opacity: .9;
}
.topnav-back {
  display: inline-block; margin: 2px auto 0; color: var(--brand); font-size: 14px; font-weight: 600;
  padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
}
.topnav-back:hover { border-color: var(--brand); background: var(--brand-weak); text-decoration: none; }
.wb-welcome { margin: 12px 0 0; font-size: 13px; color: var(--text-3); }

.nav-main { display: flex; gap: 2px; margin: 16px auto 0; justify-content: center; align-items: center; flex-wrap: wrap; }
.nav-main a {
  color: var(--text-2); font-size: 14px; padding: 6px 11px; border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav-main a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-main a.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }

.site-main { padding: 26px 0 60px; min-height: 60vh; }
/* 页脚：套用主站风格（品牌导航 + 版权 + 备案） */
.site-footer {
  border-top: 1px solid var(--border); background: #fff; padding: 26px 0 30px; color: var(--text-3); font-size: 13px;
}
.site-footer .wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; }
.footer-nav a { color: var(--text-2); }
.footer-nav a:hover { color: var(--brand); text-decoration: none; }
.site-footer .copyright { margin: 2px 0; color: var(--text-2); }
.site-footer .beian { margin: 0; }
.site-footer .beian a { color: var(--text-3); }
.site-footer .beian a:hover { color: var(--brand); text-decoration: none; }

/* ---------------- Breadcrumb ---------------- */
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.crumb a { color: var(--text-2); }
.crumb span { margin: 0 6px; }

/* ---------------- Tool hero ---------------- */
.tool-hero { margin-bottom: 18px; }
.tool-hero h1 { font-size: 27px; }
.tool-hero .lead { color: var(--text-2); margin-top: 8px; font-size: 15px; max-width: 760px; }
.tool-hero .kw { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: 15px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px; font-weight: 550;
  transition: background .15s, border-color .15s, transform .06s; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.94); }
.btn-danger { background: #fff; border-color: #f0b4b6; color: var(--danger); }
.btn-danger:hover { background: var(--danger-weak); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------------- Form controls ---------------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.field .hint.ok { color: var(--ok); }
.field .hint.err { color: var(--danger); }

.input, textarea.input, select.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .13); }
textarea.input { resize: vertical; min-height: 140px; line-height: 1.7; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
textarea.input.sm { min-height: 96px; }
textarea.input.lg { min-height: 240px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { flex: 1 1 190px; min-width: 0; }
.checks { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13.5px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ---------------- Toolbar / chips ---------------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar:last-child { margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg button {
  border: 0; background: #fff; padding: 7px 14px; cursor: pointer; color: var(--text-2); font-size: 13.5px; border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- Result area ---------------- */
#result, .result { margin-top: 16px; }
.result-empty { color: var(--text-3); font-size: 14px; text-align: center; padding: 34px 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.stat .u { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: 2px; }

.out-line {
  display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  margin-bottom: 7px; font-size: 13.5px; word-break: break-all;
}
.out-line .t { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl th { background: var(--surface-2); font-weight: 650; color: var(--text-2); font-size: 12.5px; position: sticky; top: 0; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
table.tbl th.num { text-align: right; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.err { background: var(--danger-weak); color: var(--danger); }
.badge.info { background: var(--brand-weak); color: var(--brand); }
.badge.mute { background: var(--bg-soft); color: var(--text-3); }

/* ---------------- Home grid ---------------- */
.hero { padding: 40px 0 26px; }
.hero h1 { font-size: 34px; letter-spacing: -.025em; }
.hero p { color: var(--text-2); margin-top: 12px; font-size: 16px; max-width: 680px; }
.hero .tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 13px; font-size: 13px; color: var(--text-2); }

.cat { margin-bottom: 34px; scroll-margin-top: calc(var(--header-h) + 12px); }
/* 手机点击栏目后，栏目标题短暂高亮，明确“已定位到本栏目” */
.cat-head h2.flash { animation: catFlash 1.4s ease-out; border-radius: 8px; }
@keyframes catFlash {
  0%   { background: var(--brand-weak); box-shadow: 0 0 0 6px var(--brand-weak); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 15px; flex: none; background: var(--brand-weak);
}
.cat-head h2 { font-size: 18px; }
.cat-head .cnt { font-size: 12.5px; color: var(--text-3); }
.cat-head .line { flex: 1; height: 1px; background: var(--border); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: block; color: var(--text); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.tcard:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: transparent; }
.tcard .ico {
  width: 36px; height: 36px; border-radius: 10px; background: var(--brand-weak); color: var(--brand);
  display: grid; place-items: center; font-size: 18px; margin-bottom: 11px;
}
.tcard h3 { font-size: 15px; }
.tcard p { color: var(--text-3); font-size: 13px; margin-top: 5px; }
.tcard .kwline { margin-top: 9px; font-size: 11.5px; color: var(--text-3); border-top: 1px dashed var(--border); padding-top: 8px; }

/* ---------------- Toast ---------------- */
.toast-host { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1a2233; color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: tin .22s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- Misc ---------------- */
.note { font-size: 13px; color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.spacer { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.big-num { font-size: 44px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.drop-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 34px 16px;
  text-align: center; color: var(--text-3); font-size: 14px; cursor: pointer; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }

.preview-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.pv-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: 150px; }
.pv-card img, .pv-card canvas { width: 100%; height: 118px; object-fit: contain; background: #fff; display: block; }
.pv-card .meta { padding: 6px 9px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--border); }
.pv-card .meta b { display: block; color: var(--text-2); font-weight: 600; font-size: 12px; word-break: break-all; }

/* ---------------- Progress ---------------- */
.bar { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s ease; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.err > i { background: var(--danger); }

/* ---------------- Fullscreen stage (点名/弹幕) ---------------- */
.stage {
  position: relative; min-height: 300px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #1c2434, #3b82d6); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 30px 20px;
}
.stage .stage-word { font-size: clamp(32px, 8vw, 90px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; word-break: break-all; }
.stage.plain { background: #f8fafc; color: var(--text); border: 1px solid var(--border); }

/* ---------------- 轻量美化（更耐看） ---------------- */
html { scroll-behavior: smooth; }
.site-header { box-shadow: 0 1px 0 rgba(16, 24, 40, .04); }
.tcard { transition: box-shadow .18s, transform .18s, border-color .18s, background .18s; }
.tcard:hover { border-color: transparent; background: linear-gradient(180deg, #fff, #fbfcff); }
.tcard .ico { transition: transform .2s; }
.tcard:hover .ico { transform: scale(1.06) rotate(-2deg); }
.hero .tags .tag { transition: transform .15s, box-shadow .15s; }
.hero .tags .tag:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.btn-primary { box-shadow: 0 6px 16px rgba(59, 130, 214, .22); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(59, 130, 214, .32); }
.stat { transition: transform .15s; }
.stat:hover { transform: translateY(-2px); }
.logo-mark { box-shadow: 0 4px 12px rgba(59, 130, 214, .3); }

/* ---------------- Responsive ---------------- */
@media (max-width: 760px) {
  .tool-hero h1, .hero h1 { font-size: 22px; }
  .hero h1 { font-size: 26px; }
  .tool-hero .lead, .hero p { font-size: 14.5px; }
  .nav-main {
    flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px;
    margin: 12px auto 0;
  }
  .nav-main a { padding: 8px 11px; border-radius: var(--radius-sm); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .tcard { padding: 13px; }
  .tcard p, .tcard .kwline { display: none; }
  .card-body { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 8px 12px; font-size: 13.5px; }
}
