/* ===== 工具箱公共样式（独立于主站主题，极简工具风） ===== */
:root {
  --t-bg: #f4f5f7;
  --t-card: #ffffff;
  --t-text: #1c1e21;
  --t-dim: #6b7280;
  --t-accent: #2563eb;
  --t-accent-h: #1d4ed8;
  --t-accent-weak: #dbeafe;
  --t-border: #d9dce1;
  --t-danger: #dc2626;
  --t-ok: #059669;
}
@media (prefers-color-scheme: dark) {
  :root {
    --t-bg: #14161a;
    --t-card: #1e2126;
    --t-text: #e7e9ec;
    --t-dim: #9aa1ab;
    --t-accent: #3b82f6;
    --t-accent-h: #60a5fa;
    --t-accent-weak: #1e2a3f;
    --t-border: #33383f;
    --t-danger: #ef4444;
    --t-ok: #34d399;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--t-bg); color: var(--t-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px; line-height: 1.6;
  min-height: 100vh;
}

/* 顶栏 */
.t-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--t-card);
  border-bottom: 1px solid var(--t-border);
  position: sticky; top: 0; z-index: 10;
}
.t-back {
  color: var(--t-accent); text-decoration: none; font-size: 14px;
  padding: 6px 10px; border-radius: 8px; flex-shrink: 0;
}
.t-back:active { background: var(--t-accent-weak); }
.t-head h1 { font-size: 17px; margin: 0; font-weight: 600; flex: 1; text-align: center; }
.t-head .t-head-right { width: 56px; flex-shrink: 0; }

/* 主体容器 */
.t-wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

/* 卡片 */
.t-card {
  background: var(--t-card); border: 1px solid var(--t-border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.t-card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.t-hint { font-size: 12.5px; color: var(--t-dim); margin: 8px 0 0; }

/* 按钮 */
.t-btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--t-accent); color: #fff;
  font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: 10px;
  text-decoration: none; text-align: center;
  transition: background .15s, opacity .15s;
}
.t-btn:active { background: var(--t-accent-h); opacity: .9; }
.t-btn:disabled { opacity: .45; cursor: not-allowed; }
.t-btn.ghost { background: transparent; color: var(--t-accent); border: 1px solid var(--t-accent); }
.t-btn.ghost:active { background: var(--t-accent-weak); }
.t-btn.danger { background: var(--t-danger); }
.t-btn.block { display: block; width: 100%; }

/* 表单 */
.t-label { display: block; font-size: 13px; color: var(--t-dim); margin: 12px 0 6px; }
.t-input, .t-select, textarea.t-input {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--t-border); border-radius: 10px;
  background: var(--t-bg); color: var(--t-text); outline: none;
}
.t-input:focus { border-color: var(--t-accent); }
textarea.t-input { resize: vertical; min-height: 90px; font-family: inherit; }
.t-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 结果区 */
.t-result {
  background: var(--t-accent-weak); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; word-break: break-all;
  min-height: 20px; white-space: pre-wrap;
}
.t-msg { font-size: 13px; color: var(--t-ok); min-height: 18px; margin-top: 8px; word-break: break-all; }
.t-err { color: var(--t-danger); }

/* 工具箱首页网格 */
.t-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 560px) { .t-grid { grid-template-columns: repeat(3, 1fr); } }
.t-tile {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--t-card); border: 1px solid var(--t-border); border-radius: 14px;
  padding: 18px 14px; color: var(--t-text);
  transition: transform .15s, border-color .15s;
}
.t-tile:active { transform: scale(.97); border-color: var(--t-accent); }
.t-tile .ic { font-size: 30px; }
.t-tile b { font-size: 15px; }
.t-tile i { font-style: normal; font-size: 12px; color: var(--t-dim); line-height: 1.5; }

/* 标签页 */
.t-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.t-tab {
  border: 1px solid var(--t-border); background: var(--t-card); color: var(--t-text);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.t-tab.active { background: var(--t-accent); border-color: var(--t-accent); color: #fff; }

/* 图片预览 */
.t-preview { max-width: 100%; border-radius: 10px; border: 1px solid var(--t-border); display: block; }

/* 底部说明 */
.t-foot { text-align: center; color: var(--t-dim); font-size: 12px; padding: 20px 0 28px; }
/* 数据来源注释（居中小字） */
.src-note { text-align: center; color: var(--t-dim); font-size: 12px; padding: 16px 0 8px; }
.src-note a { color: var(--t-dim); }
