/* ============================================================
   工具箱 · 公共设计系统
   白色为主、蓝色为辅，直角无圆角；不指定任何字体。
   工具页引入方式：
   <link rel="stylesheet" href="../assets/theme.css">
   ============================================================ */

:root {
  --bg: #f5f8fc;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --border: #d8e1ed;
  --border-strong: #bfcbdb;
  --text: #111827;
  --text-dim: #5b6675;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: rgba(29, 78, 216, 0.07);
  --accent-line: rgba(29, 78, 216, 0.24);
  --radius: 0px;
  --radius-lg: 0px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.09);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

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

::selection { background: rgba(29, 78, 216, 0.14); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1080px;
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.brand:hover { color: var(--accent); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.spacer { flex: 1; }

/* ---------- 页面容器 ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

/* ---------- 工具页标题区 ---------- */

.page-head { margin-bottom: 24px; }

.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.page-head .desc {
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- 面包屑 ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 12px;
}

.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: #c3cad6; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn:active { transform: translateY(1px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: #3f4a5c;
}

.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- 表单 ---------- */

.field {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field::placeholder { color: #98a2b3; }

textarea.field {
  min-height: 120px;
  resize: vertical;
}

/* ---------- 页脚 ---------- */

.site-footer { border-top: 1px solid var(--border); }

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  color: var(--text-dim);
  font-size: 12px;
}

.site-footer .sep { color: #c3cad6; }

/* ---------- 小屏适配 ---------- */

@media (max-width: 640px) {
  .site-header .inner { padding: 0 16px; }
  .page { padding: 26px 16px 56px; }
  .site-footer .inner { padding: 18px 16px; }
  .field { font-size: 16px; } /* 避免 iOS 聚焦时自动放大 */
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
