/* ===== Vibe Lingan Base CSS — 全站设计 token + 壳层规范 =====
 * 版本: 1.0
 * 基于 UI/UX 审计文档 (2026-06-25)
 * 本文件为全站共用根基，不得被页面内联样式覆盖其规范
 */

/* ── 设计 Token ── */
:root {
  /* 字体 */
  --font-sans: "DM Sans", "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-heading: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;

  /* 字号层级 */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --text-5xl: 48px;

  /* 行高 */
  --leading-tight: 1.12;
  --leading-title: 1.22;
  --leading-heading: 1.28;
  --leading-subtitle: 1.35;
  --leading-body: 1.65;
  --leading-relaxed: 1.75;

  /* 颜色 — Monet 主题 */
  --color-bg: #f6efe4;
  --color-bg-soft: #fbf7ef;
  --color-surface: #ffffff;
  --color-surface-warm: #fffaf2;
  --color-text: #251f1a;
  --color-text-heading: #1a1510;
  --color-muted: #7a6e63;
  --color-border: rgba(44, 34, 26, 0.14);
  --color-border-light: rgba(44, 34, 26, 0.08);
  --color-accent: #df7656;
  --color-accent-hover: #ca6245;
  --color-ink: #17242e;
  --color-bluegreen: #8fb9b8;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(24, 18, 12, 0.06);
  --shadow-md: 0 8px 24px rgba(24, 18, 12, 0.10);
  --shadow-lg: 0 16px 40px rgba(24, 18, 12, 0.14);
}

/* ── 全局默认 ── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 标题规范 ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-heading);
}

h1 { font-size: var(--text-5xl); line-height: var(--leading-tight); }
h2 { font-size: var(--text-4xl); line-height: var(--leading-heading); }
h3 { font-size: var(--text-xl); line-height: var(--leading-subtitle); }
h4 { font-size: var(--text-lg); line-height: var(--leading-subtitle); }

/* 默认情况下标题不带 margin（由具体上下文决定） */
h1, h2, h3, h4, h5, h6 { margin: 0; }

/* ── 工具页 H1/H2 降级（32-38px 范围）── */
.page-tool h1 { font-size: var(--text-4xl); }  /* 36px */
.page-tool h2 { font-size: var(--text-2xl); }  /* 24px */

/* ── 页面壳层：site-header & tool-header ── */
.site-header,
.tool-header {
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  background: rgba(246, 239, 228, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
}

.site-logo,
.tool-logo {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  font-family: var(--font-heading);
}

.site-nav a,
.site-nav button,
.tool-nav a,
.tool-nav button {
  font-size: var(--text-sm);
  line-height: 1;
  padding: 10px 12px;
  font-family: var(--font-heading);
}

.header-login,
.menu-button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
}

@media (max-width: 768px) {
  .site-header,
  .tool-header {
    height: 56px;
    padding-inline: 16px;
  }

  .site-logo,
  .tool-logo {
    font-size: 18px;
  }

  .header-login,
  .menu-button {
    min-width: 40px;
    min-height: 40px;
    border-radius: var(--radius-md);
  }
}

/* ── 导航下拉菜单 ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 60;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-link {
  display: block;
  padding: 8px 14px;
  font-size: var(--text-sm);
  color: var(--color-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.nav-dropdown-link:hover {
  background: rgba(223, 118, 86, 0.08);
  color: var(--color-accent);
}

.nav-dropdown-btn {
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-heading);
}

/* ── 按钮规范 ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 23px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(223, 118, 86, 0.06);
  border-color: var(--color-accent);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}

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

@media (max-width: 768px) {
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    padding: 12px 20px;
  }
}

/* ── 卡片规范 ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-hover {
  transition: box-shadow 0.25s, transform 0.25s;
}

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

/* ── 表单输入规范 ── */
.form-input {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-surface);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(223, 118, 86, 0.12);
}

.form-input::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  display: block;
}

/* ── 辅助类 ── */
.text-muted { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
