/* ============================================
   全站公共样式
   ============================================ */

:root {
  --color-bg: #f0f7ff;
  --color-surface: #ffffff;
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-accent: #06b6d4;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-card-shadow: 0 2px 12px rgba(59, 130, 246, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 50%, #f0f9ff 100%);
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== 顶栏 ===== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ===== 标语 ===== */
.hero-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* ===== 工具卡片网格 ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

/* ===== 工具卡片 ===== */
.tool-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--color-card-shadow);
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.tool-card-icon {
  font-size: 2.4rem;
  line-height: 1;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex: 1;
}

.tool-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease;
}

.tool-link:hover {
  background: linear-gradient(135deg, #dbeafe, #bae6fd);
}

.tool-link-arrow {
  font-size: 1rem;
  opacity: 0.6;
}

/* 更多工具占位卡片 */
.tool-card-more {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  box-shadow: none;
}

.tool-card-more:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-primary-light);
}

/* ===== 语言按钮 ===== */
.lang-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

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

/* ===== 底部 ===== */
.site-footer {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .container {
    padding: 24px 16px;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 28px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tool-card {
    padding: 20px 18px 18px;
  }
}

/* ===== 键盘测试页面的 header ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.header-left {
  text-align: left;
}

.header-right {
  display: flex;
  align-items: center;
}

h1#pageH1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #2c3e50;
}

/* ===== 通用 section ===== */
section {
  margin-bottom: 30px;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
}

ul {
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
}

.faq {
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
}

.q {
  font-weight: bold;
  margin-bottom: 5px;
}

.a {
  margin-bottom: 10px;
  color: #555;
}

.switch-layout {
  text-align: center;
  background-color: #e8f4f8;
  padding: 15px;
  border-radius: 8px;
}

.switch-layout a {
  font-size: 1.1rem;
  font-weight: bold;
  color: #0066cc;
  text-decoration: none;
}

.switch-layout a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  color: #999;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
