/* ===== 工具工坊 全局样式 ===== */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --text: #1a1b2e;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --primary: #5b50e8;
  --primary-hover: #4a3fd4;
  --primary-soft: #eeedfe;
  --border: #e5e7f0;
  --success: #0f9d70;
  --success-soft: #e1f5ee;
  --danger: #dc4444;
  --danger-soft: #fcebeb;
  --code-bg: #f7f8fc;
  --shadow: 0 1px 3px rgba(20, 21, 43, 0.05);
  --shadow-lg: 0 8px 24px rgba(20, 21, 43, 0.1);
}

[data-theme="dark"] {
  --bg: #12132a;
  --surface: #1c1d3a;
  --surface-2: #25264a;
  --text: #e6e6f2;
  --text-2: #9fa0c0;
  --text-3: #6a6b8f;
  --primary: #8b80f5;
  --primary-hover: #a39afa;
  --primary-soft: #2a2b55;
  --border: #2c2d52;
  --success: #4fc796;
  --success-soft: #12362b;
  --danger: #ef8f8f;
  --danger-soft: #472130;
  --code-bg: #141530;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.25s;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}

.logo-mark {
  font-family: "SF Mono", Consolas, monospace;
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.nav-links a.nav-cta {
  color: var(--primary);
  font-weight: 500;
  border: 0.5px solid var(--primary);
}

.nav-links a.nav-cta:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.theme-toggle {
  margin-left: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== 首页 Hero ===== */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.hero-search {
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}

.hero-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ===== 工具卡片 ===== */
.tools-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

.section-title h2 { font-size: 20px; font-weight: 600; }

.tool-count {
  font-size: 13px;
  color: var(--text-3);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--icon-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tool-info p { font-size: 13px; color: var(--text-2); }

.tool-card.hidden-by-search { display: none; }

/* ===== 首页接单 CTA ===== */
.hire-cta {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.hire-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 40px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  flex-wrap: wrap;
}

.hire-cta-text h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.hire-cta-text p { font-size: 15px; opacity: 0.85; }

/* ===== 通用按钮 ===== */
.btn {
  padding: 9px 18px;
  border-radius: 9px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover { background: var(--surface-2); border-color: var(--text-3); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

[data-theme="dark"] .btn-primary { color: #12132a; }

.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 11px; }

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn:active { transform: scale(0.97); }

/* ===== 工具页通用 ===== */
.tool-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tool-page-header { margin-bottom: 24px; }
.tool-page-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.tool-page-header p { font-size: 14px; color: var(--text-2); }

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.indent-select {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.indent-select select {
  padding: 7px 10px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 720px) {
  .io-grid { grid-template-columns: 1fr; }
}

.io-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.io-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.io-hint { font-weight: 400; color: var(--text-3); font-size: 12px; }

.code-area {
  width: 100%;
  min-height: 380px;
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--text);
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.code-area:focus { border-color: var(--primary); }

.io-status {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
}

.io-status.ok {
  display: block;
  background: var(--success-soft);
  color: var(--success);
}

.io-status.err {
  display: block;
  background: var(--danger-soft);
  color: var(--danger);
}

/* ===== Base64 模式切换 ===== */
.mode-tabs {
  display: inline-flex;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface);
}

.mode-tab {
  padding: 9px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.mode-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

[data-theme="dark"] .mode-tab.active { color: #12132a; }

/* ===== 颜色转换 ===== */
.color-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 720px) {
  .color-layout { grid-template-columns: 1fr; }
}

.color-preview {
  border-radius: 16px;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: #5b50e8;
  transition: background 0.2s;
  border: 0.5px solid var(--border);
}

.color-name {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.color-inputs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.color-row-label {
  width: 72px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.color-row input[type="color"] {
  width: 60px;
  height: 38px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  padding: 4px;
}

.color-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
  align-items: center;
}

.color-input-group input[type="text"],
.color-input-group input[type="number"] {
  padding: 8px 12px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: "SF Mono", Consolas, monospace;
  min-width: 0;
}

.color-input-group input[type="text"] { flex: 1; }

.rgb-group input[type="number"] { width: 76px; }

.color-input-group input:focus { border-color: var(--primary); }

.luminance-badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
}

.color-swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.12s;
}

.swatch:hover { transform: scale(1.12); }

/* ===== 正则 ===== */
.regex-pattern-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--code-bg);
  font-family: "SF Mono", Consolas, monospace;
}

.regex-slash {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.regex-pattern-row input {
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 15px;
}

#regexPattern { flex: 1; }

.flags-input {
  width: 72px;
  text-align: center;
  border-left: 0.5px solid var(--border) !important;
  padding-left: 10px !important;
}

.regex-grid { align-items: start; }

.highlight-area {
  min-height: 330px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}

.match-highlight {
  background: rgba(245, 196, 66, 0.45);
  border-radius: 3px;
  padding: 1px 0;
  box-shadow: inset 0 -2px 0 rgba(212, 140, 20, 0.5);
}

[data-theme="dark"] .match-highlight {
  background: rgba(186, 117, 23, 0.45);
  box-shadow: inset 0 -2px 0 rgba(239, 159, 39, 0.6);
}

.match-count {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.groups-area {
  font-size: 13px;
  color: var(--text-2);
  font-family: "SF Mono", Consolas, monospace;
}

.regex-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== 密码生成 ===== */
.pwd-result-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pwd-output {
  flex: 1;
  min-width: 220px;
  padding: 13px 16px;
  border: 0.5px solid var(--border);
  border-radius: 11px;
  background: var(--code-bg);
  color: var(--text);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 17px;
  letter-spacing: 0.03em;
  outline: none;
}

.pwd-strength {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.strength-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--danger);
  transition: width 0.3s, background 0.3s;
}

.strength-text { font-size: 13px; color: var(--text-2); width: 72px; }

.pwd-options {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 560px;
}

.pwd-length-row label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.pwd-length-row strong { color: var(--text); font-size: 16px; }

input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) var(--fill, 20%), var(--surface-2) var(--fill, 20%));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}

.pwd-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.toggle input { display: none; }

.toggle-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ===== 接单页 ===== */
.hire-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.hire-hero { text-align: center; margin-bottom: 56px; }
.hire-hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.hire-hero p { font-size: 16px; color: var(--text-2); }

.hire-section { margin-bottom: 56px; }
.hire-section > h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.service-card {
  padding: 24px;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.15s, box-shadow 0.15s;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.service-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.service-card p { font-size: 13px; color: var(--text-2); }

.process-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.process-step {
  text-align: center;
  padding: 24px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
}

.step-num {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
}

[data-theme="dark"] .step-num { color: #12132a; }

.process-step h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.process-step p { font-size: 13px; color: var(--text-2); }

.price-table {
  border: 0.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.7fr;
  gap: 12px;
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 0.5px solid var(--border);
  align-items: center;
}

.price-row:last-child { border-bottom: none; }

.price-head {
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.price-row span:first-child { font-weight: 500; }
.price-row span:nth-child(2) { color: var(--text-2); font-size: 13px; }
.price-row span:last-child { text-align: right; color: var(--primary); font-weight: 600; }

.price-note {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

.hire-contact {
  text-align: center;
  padding: 48px 32px;
  border-radius: 18px;
  background: var(--surface);
  border: 0.5px solid var(--border);
}

.hire-contact h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.hire-contact > p { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }

.contact-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  min-width: 260px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.contact-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transform: translateY(-2px);
}

.contact-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.contact-card--wechat .contact-icon { color: #07C160; background: rgba(7,193,96,.1); }
.contact-card--email .contact-icon { color: #EA4335; background: rgba(234,67,53,.1); }

.contact-body { text-align: left; }
.contact-label { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.contact-value {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-1);
}
.contact-action {
  font-size: 12px;
  color: var(--brand);
  margin-top: 4px;
}

.contact-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: 14px;
  background: var(--bg);
  border: 0.5px dashed var(--border);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.contact-qr-text { text-align: right; }
.contact-qr-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.contact-qr-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.contact-qr-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}
.contact-qr-placeholder img {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

/* ===== Footer ===== */
.footer {
  border-top: 0.5px solid var(--border);
  background: var(--surface);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.footer-brand .logo-mark { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }

.footer-links { display: flex; gap: 16px; }

.footer-links a {
  font-size: 13px;
  color: var(--text-2);
}

.footer-links a:hover { color: var(--primary); }

.footer-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 响应式微调 ===== */
@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .logo-text { display: none; }
  .hero { padding: 48px 16px 24px; }
  .tool-page { padding: 28px 16px 64px; }
  .hire-page { padding: 32px 16px 64px; }
  .code-area { min-height: 260px; }
  .price-row { grid-template-columns: 1.2fr 1fr 0.8fr; font-size: 13px; padding: 12px 14px; }
  .footer-note { margin-left: 0; width: 100%; }
}

/* ===== 分类隐藏 ===== */
.tools-section.hidden-by-search { display: none; }

/* ===== 二维码生成 ===== */
.qrcode-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 720px) {
  .qrcode-layout { grid-template-columns: 1fr; }
}

.qrcode-controls { display: flex; flex-direction: column; gap: 16px; }

.qrcode-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.qrcode-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qrcode-option label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.qrcode-option select {
  padding: 8px 12px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.qrcode-option select:focus { border-color: var(--primary); }

.qrcode-option input[type="color"] {
  width: 60px;
  height: 38px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  padding: 4px;
}

.qrcode-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

#qrCanvas { display: none; max-width: 100%; height: auto; border-radius: 8px; }

.qrcode-hint {
  color: var(--text-3);
  font-size: 14px;
}

.qr-tip {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.qr-tip-ok {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.qr-tip-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ===== 字数统计 ===== */
.wc-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.wc-dropzone:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
}
.wc-dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.01);
}
.wc-dropzone span {
  font-size: 14px;
  color: var(--text-2);
}
.wc-dropzone a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.wc-dropzone a:hover {
  text-decoration: underline;
}
.wc-dropzone-hint {
  font-size: 12px !important;
  color: var(--text-3);
  opacity: 0.7;
}

.wc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.wc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wc-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.wc-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  font-family: "SF Mono", Consolas, monospace;
}

.wc-label {
  font-size: 13px;
  color: var(--text-2);
}

/* ===== 时间戳转换 ===== */
.ts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 720px) {
  .ts-layout { grid-template-columns: 1fr; }
}

.ts-card {
  padding: 24px;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ts-card h3 { font-size: 16px; font-weight: 600; }

.ts-input-row {
  display: flex;
  gap: 8px;
}

.ts-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--text);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 14px;
  outline: none;
}

.ts-input-row select {
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.ts-input-row input:focus,
.ts-card input[type="datetime-local"]:focus { border-color: var(--primary); }

.ts-card input[type="datetime-local"] {
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.ts-card .btn { align-self: flex-start; }

.ts-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.ts-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.ts-label {
  font-size: 13px;
  color: var(--text-2);
  width: 72px;
  flex-shrink: 0;
}

.ts-value {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 14px;
  color: var(--text);
}

.ts-now {
  margin-top: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-now strong {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 16px;
}

/* ===== 图片压缩 ===== */
.imgcompress-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 24px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.imgcompress-dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.imgcompress-dropzone.drag-over { border-color: var(--primary); background: var(--primary-soft); }

.imgcompress-dropzone p { font-size: 15px; color: var(--text-2); }
.imgcompress-hint { font-size: 13px !important; color: var(--text-3) !important; }

.imgcompress-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .imgcompress-compare { grid-template-columns: 1fr; }
}

.imgcompress-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.imgcompress-panel img {
  max-width: 100%;
  border-radius: 12px;
  border: 0.5px solid var(--border);
  background: var(--code-bg);
}

.imgcompress-info {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  font-family: "SF Mono", Consolas, monospace;
}

.imgcompress-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.imgcompress-quality {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.imgcompress-quality label {
  font-size: 14px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
}

.imgcompress-quality strong { color: var(--text); }

.imgcompress-savings {
  font-size: 14px;
  font-weight: 600;
  font-family: "SF Mono", Consolas, monospace;
}

/* ===== 个税计算 ===== */
.tax-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 720px) {
  .tax-layout { grid-template-columns: 1fr; }
}

.tax-inputs {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tax-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tax-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

.tax-input-wrap {
  display: flex;
  align-items: center;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.tax-input-wrap span {
  padding: 0 12px;
  color: var(--text-3);
  font-size: 15px;
}

.tax-input-wrap input {
  flex: 1;
  padding: 11px 14px 11px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
  font-family: "SF Mono", Consolas, monospace;
}

.tax-input-wrap:focus-within { border-color: var(--primary); }

.tax-field-hint {
  font-size: 12px;
  color: var(--text-3);
}

.tax-inputs .btn-lg { margin-top: 8px; }

.tax-result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .tax-result-cards { grid-template-columns: 1fr; }
}

.tax-result-card {
  padding: 24px;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.tax-result-card.tax-result-highlight {
  background: var(--primary);
  border-color: var(--primary);
}

.tax-result-label {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.tax-result-highlight .tax-result-label { color: rgba(255,255,255,0.85); }

.tax-result-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: "SF Mono", Consolas, monospace;
}

.tax-result-highlight .tax-result-value { color: #fff; }

.tax-detail {
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.tax-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 0.5px solid var(--border);
}

.tax-detail-row:last-child { border-bottom: none; }

.tax-detail-row span:first-child { color: var(--text-2); }
.tax-detail-row span:last-child {
  font-family: "SF Mono", Consolas, monospace;
  font-weight: 500;
  color: var(--text);
}

/* ===== 新工具页响应式 ===== */
@media (max-width: 640px) {
  .qrcode-options { gap: 12px; }
  .wc-stats { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .wc-stat { padding: 16px 12px; }
  .wc-num { font-size: 22px; }
  .ts-card { padding: 16px; }
  .imgcompress-controls { flex-direction: column; align-items: stretch; }
  .tax-result-value { font-size: 22px; }
}
