/* ============ ByByCode 站点样式 ============ */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --ink: #1f2437;
  --ink-2: #5b6275;
  --ink-3: #8b90a3;
  --line: #e5e7f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --warn: #d97706;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(31, 36, 55, .05), 0 10px 28px -18px rgba(31, 36, 55, .35);
  --mono: ui-monospace, "SF Mono", Consolas, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 页头 ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, .92);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .18);
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 16.5px; color: var(--ink); }
.brand-slogan { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; }
.site-nav { position: relative; }
.site-nav a, .nav-bookmark {
  color: var(--brand); font-size: 14px; padding: 8px 14px; border-radius: 8px;
  background: var(--brand-soft); font-weight: 600;
  border: 0; cursor: pointer; font-family: inherit; line-height: 1.4;
}
.site-nav a:hover, .nav-bookmark:hover {
  text-decoration: none; background: #e0e7ff; color: var(--brand-dark);
}
.nav-tip {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  background: #1f2437; color: #fff; font-size: 12.5px; line-height: 1.5;
  padding: 8px 13px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translateY(-5px);
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}
.nav-tip.show { opacity: 1; transform: translateY(0); }
.nav-tip::before {
  content: ''; position: absolute; top: -5px; right: 30px;
  width: 10px; height: 10px; background: #1f2437; transform: rotate(45deg);
}

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 52px 0 26px; }
.hero-title {
  font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 10px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 .3em;
}
.hero-bar { color: var(--brand); }
.hero-sub { color: var(--ink-2); font-size: 15px; margin: 0; }
.tool-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding: 18px 0 8px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  color: var(--ink);
}
.tool-card:hover { text-decoration: none; transform: translateY(-3px); border-color: #c7d2fe; box-shadow: 0 6px 26px -12px rgba(79, 70, 229, .45); }
.tool-card-icon { flex: none; }
.tool-card-icon span {
  width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 23px;
}
.tool-card-name { margin: 0 0 4px; font-size: 16.5px; font-weight: 700; }
.tool-card-summary { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.tool-card-cat {
  font-size: 11.5px; color: var(--brand); background: var(--brand-soft);
  padding: 2px 9px; border-radius: 999px; font-weight: 600;
}

/* ---------- 工具详情页 ---------- */
.page-tool-main { padding-bottom: 40px; }
.breadcrumb { padding: 16px 0 6px; font-size: 13px; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.crumb-sep { margin: 0 7px; opacity: .6; }
.tool-head { display: flex; gap: 16px; align-items: center; padding: 8px 0 16px; }
.tool-head-icon span {
  width: 56px; height: 56px; border-radius: 14px; background: var(--brand-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 28px;
}
.tool-title { margin: 0; font-size: clamp(20px, 3vw, 26px); line-height: 1.3; }
.tool-subtitle { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

.tool-stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tool-iframe { width: 100%; min-height: 560px; border: 0; display: block; }

/* ---------- 正文区（SEO 说明） ---------- */
.doc-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin: 26px 0 10px;
}
.doc-content h2 { font-size: 18px; margin: 1.4em 0 .6em; padding-bottom: .35em; border-bottom: 1px dashed var(--line); }
.doc-content h2:first-child { margin-top: 0; }
.doc-content p { margin: .6em 0; color: #3a4055; }
.doc-content ul { padding-left: 1.2em; color: #3a4055; }
.doc-content li { margin: .3em 0; }
.doc-content code {
  background: var(--brand-soft); color: var(--brand-dark);
  padding: .1em .45em; border-radius: 6px;
  font-family: var(--mono); font-size: .92em;
}
.doc-content strong { color: var(--ink); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 40px; }
.footer-inner { padding: 22px 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.footer-brand strong { color: var(--ink-2); margin-right: 8px; }
.footer-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-meta a { color: var(--ink-3); }

/* ---------- 404 ---------- */
.error-wrap { padding: 80px 20px; text-align: center; }
.error-card .error-code { font-size: 72px; font-weight: 800; color: var(--brand); line-height: 1; }
.error-msg { color: var(--ink-2); font-weight: 400; font-size: 18px; margin: 10px 0 22px; }

/* ================= 工具交互区通用类（tw-*） ================= */
.tw-mount { min-height: 240px; }
.tw-panel { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tw-panel .tw-row:last-child { margin-bottom: 0; }
.tw-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px; margin: 0; }
.tw-tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 7px 16px; border-radius: 999px 999px 0 0; cursor: pointer;
  font-size: 13.5px; font-weight: 600; margin-top: 10px;
}
.tw-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tw-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tw-grid { display: grid; gap: 14px; }
.tw-grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .tw-grid.cols-2 { grid-template-columns: 1fr; } }
.tw-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; display: block; margin-bottom: 5px; }
.tw-input, .tw-textarea, .tw-select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; background: #fff; color: var(--ink);
  font-family: var(--mono);
}
.tw-input:focus, .tw-textarea:focus, .tw-select:focus {
  outline: 2px solid #c7d2fe; border-color: var(--brand);
}
.tw-textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.tw-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 8px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 600; transition: all .12s ease;
}
.tw-btn:hover { border-color: #c7d2fe; color: var(--brand); background: var(--brand-soft); }
.tw-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.tw-btn.primary:hover { background: var(--brand-dark); color: #fff; }
.tw-btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.tw-btn.success:hover { background: #15803d; color: #fff; }
.tw-btn.danger { color: var(--err); }
.tw-btn.danger:hover { background: var(--err-soft); border-color: #fecaca; color: var(--err); }
.tw-btn:disabled { opacity: .55; cursor: not-allowed; }
.tw-out {
  background: #0f172a; color: #d1e4ff; border-radius: var(--radius-sm);
  padding: 12px 14px; min-height: 46px; font-family: var(--mono);
  font-size: 13.5px; overflow: auto; white-space: pre-wrap; word-break: break-all; line-height: 1.55;
  margin: 0;
}
.tw-out .k { color: #7dd3fc; }
.tw-out .s { color: #bbf7d0; }
.tw-out .n { color: #fca5a5; }
.tw-out .b { color: #fcd34d; }
.tw-msg { font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); display: none; }
.tw-msg.show { display: block; }
.tw-msg.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.tw-msg.err { background: var(--err-soft); color: var(--err); border: 1px solid #fecaca; }
.tw-muted { color: var(--ink-3); font-size: 12.5px; }
.tw-stat { font-size: 12.5px; color: var(--ink-2); background: #f1f3fa; border-radius: 8px; padding: 3px 10px; }
.tw-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .tw-kv { grid-template-columns: 1fr; } }
.tw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tw-table th, .tw-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; word-break: break-all; }
.tw-table th { color: var(--ink-3); font-weight: 600; background: #fafbff; }
.tw-mono-cell { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.tw-card-divider { height: 1px; background: var(--line); margin: 4px 0 14px; }
.tw-card-block { min-width: 0; }
.tw-copy-result { font-size: 12px; color: var(--ok); font-weight: 600; visibility: hidden; }
.tw-copy-result.show { visibility: visible; }

/* ---------- 留言求工具 ---------- */
.wish-section { margin: 30px 0 4px; }
.wish-card {
  background: linear-gradient(135deg, #eef2ff, #f9faff);
  border: 1px solid #dce2fb;
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.wish-card h2 { margin: 0 0 6px; font-size: 19px; }
.wish-card > p { margin: 0 0 18px; color: var(--ink-2); font-size: 13.5px; }
.wish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .wish-grid { grid-template-columns: 1fr; } }
.wish-grid label, .wish-desc {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.wish-grid input, .wish-desc textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; background: #fff; color: var(--ink);
  font-family: inherit;
}
.wish-grid input:focus, .wish-desc textarea:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }
.wish-desc { margin-top: 12px; }
.wish-desc textarea { resize: vertical; line-height: 1.6; }
.wish-desc em { color: var(--err); font-style: normal; }
.wish-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.wish-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.wish-actions button {
  background: var(--brand); color: #fff; border: 0;
  padding: 9px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.wish-actions button:hover { background: var(--brand-dark); }
.wish-actions button:disabled { opacity: .6; cursor: not-allowed; }
/* 状态栏：独立块级元素，显示时自动占用下方空间，不会遮挡任何输入框 */
.wish-msg {
  display: none; margin: 12px 0 0; padding: 9px 13px;
  font-size: 13.5px; line-height: 1.6; border-radius: var(--radius-sm);
  background: var(--err-soft); color: var(--err); border: 1px solid #fecaca;
}
.wish-msg.show { display: block; }
.wish-msg.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }

/* ---------- 给我留言（独立页） ---------- */
.page-feedback { max-width: 860px; padding-bottom: 40px; }
.feedback-head { margin: 34px 0 6px; }
.feedback-head h1 { margin: 0 0 6px; font-size: 26px; }
.feedback-head p { margin: 0 0 6px; color: var(--ink-2); font-size: 14px; }
