/*
 * common.css — OpenCareer user-side v1 共享设计系统
 *
 * 设计语言：暖白纸感（Anthropic Claude 风），由 index.html 抽出
 * 包含：design tokens / 基础重置 / nav / 通用按钮 / form / footer / responsive
 * 不包含：各页面独特组件（保留在各页 <style>）
 */

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

:root {
  /* 背景 / 线条 —— 暖石·低饱和暖（2026-07-15 用户选定，对比稿见 dev-theme.html；
     替换 A1 晨金：保留温度、抽掉黄相，Notion 系 elevated-neutral） */
  --bg-paper: #f6f4f0;
  --bg-card: #fffefc;
  --bg-soft: #efece5;
  --line: #e5e0d6;
  --line-soft: #edeae2;

  /* 文字（深→浅，暖灰墨）*/
  --ink-1: #2b2723;
  --ink-2: #5c554b;
  --ink-3: #948b7d;
  --ink-4: #b5ada0;

  /* 强调色 */
  --accent: #5b6cff;   /* 品牌蓝紫（动作色·A1） */
  --accent-2: #c89cff;
  --warm: #d07d18;   /* 朝阳金（强调词/情绪色） */
  --green: #2ea66c;
  --red: #d4503e;
  --orange: #d29922;

  --grad: linear-gradient(135deg, #5b6cff 0%, #c89cff 50%, #ff8a65 100%);
  --grad-warm: linear-gradient(135deg, #d29922 0%, #d4503e 100%);

  --font-disp: "Songti SC", "STSong", "Noto Serif SC", serif;   /* 衬线大标题（A 方向） */

  /* 圆角 */
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 6px;

  /* 阴影 */
  --shadow-card: 0 1px 2px rgba(70,62,50,0.05), 0 16px 36px -18px rgba(70,62,50,0.16);   /* 暖石：中性偏暖投影 */
  --shadow-card-h: 0 2px 3px rgba(70,62,50,0.06), 0 18px 42px -16px rgba(91,108,255,0.16);
}

/* ─── 基础 ─── */
html, body {
  background: var(--bg-paper);
  color: var(--ink-2);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* 全局柔和 radial 背景（fixed，不滚动）*/
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(70vw 50vh at 25% -10%, rgba(200,156,255,0.10), transparent 60%),
    radial-gradient(50vw 40vh at 90% 30%, rgba(91,108,255,0.07), transparent 70%),
    radial-gradient(40vw 30vh at 50% 80%, rgba(255,138,101,0.05), transparent 70%);
}
a { color: var(--ink-1); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── Nav（顶部导航）─── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,249,245,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 24px;
}
nav .inner, nav .nav-inner {
  display: flex; align-items: center; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15.5px; color: var(--ink-1);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--grad);
  border-radius: 8px;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 12px rgba(91,108,255,0.25);
}
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: 22px; font-size: 13.5px; flex-wrap: wrap; }
.nav-links a { color: var(--ink-3); white-space: nowrap; }
.nav-links a:hover { color: var(--ink-1); }
.nav-actions { display: flex; gap: 8px; }
.nav-actions button {
  padding: 6px 14px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--ink-2);
  border-radius: 7px; font-size: 13px;
  transition: all 150ms;
}
.nav-actions button:hover { border-color: var(--ink-2); color: var(--ink-1); }
.nav-actions button.primary {
  background: var(--ink-1); color: white; border-color: var(--ink-1);
}
.nav-actions button.primary:hover { background: var(--accent); border-color: var(--accent); }

/* 汉堡菜单按钮（site-nav.js 注入）——默认隐藏，仅窄屏出现 */
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: 4px 8px; font-size: 22px; line-height: 1; color: var(--ink-1); }

/* 移动底部 tab bar（site-nav.js 全站注入；默认隐藏，仅窄屏显示）*/
.m-tabbar { display: none; position: fixed; bottom: 0; top: auto; left: 0; right: 0; z-index: 60; background: rgba(255,255,255,0.97); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.m-tabbar a { flex: 1; text-align: center; padding: 8px 0 7px; text-decoration: none; color: var(--ink-4); font-size: 10.5px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.m-tabbar a .i { font-size: 21px; line-height: 1; }
.m-tabbar a.on { color: var(--accent); }

@media (max-width: 480px) {
  nav { padding: 12px 14px; }
}

/* 移动端导航：副标题隐藏 + nav-links 收进汉堡下拉（全站通病收口点）*/
@media (max-width: 640px) {
  .nav-burger { display: block; }
  nav .inner, nav .nav-inner { gap: 12px; }
  .logo + span { display: none; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 6px 0;
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 20px; font-size: 15px; }
  .nav-links a + a { border-top: 1px solid var(--line-soft); }

  /* 底部 tab bar 显示 + 给它留出滚动空间 */
  .m-tabbar { display: flex; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ─── Hero（页面顶部标题区）─── */
.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  position: relative; z-index: 1;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 600;
  color: var(--ink-1);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero h1 .accent,
.hero h1 .ask {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.hero h1 .badge {
  display: inline-block;
  padding: 2px 12px; margin: 0 2px;
  border-radius: 999px;
  background: rgba(212,80,62,0.10);
  color: var(--red);
  font-size: 0.78em;
  vertical-align: middle;
  border: 1px solid rgba(212,80,62,0.18);
}
.hero p.lead, .hero .lead {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 620px;
}
.hero .lead b { color: var(--ink-1); font-weight: 500; }

/* ─── Card / 通用卡片容器 ─── */
.form-card, .card, .section-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 26px;
  box-shadow: var(--shadow-card);
  position: relative; z-index: 1;
}
.form-card { max-width: 760px; margin: 0 auto 32px; }
.form-card h2, .section-card h2, .section-card h3 {
  margin: 0 0 16px;
  font-size: 17px; font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

/* ─── Form fields ─── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px;
  color: var(--ink-3); margin-bottom: 6px;
  font-weight: 500;
}
.field label .hint { color: var(--ink-4); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-1);
  font-size: 14px;
  transition: border-color 150ms, background 150ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  background: var(--bg-card);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.field-row {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* skills chip input */
.skills-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-height: 42px;
}
.skills-wrap input {
  flex: 1; min-width: 140px;
  border: 0; outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink-1);
  padding: 4px;
}
.skill-tag {
  background: rgba(91,108,255,0.08);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(91,108,255,0.16);
}
.skill-tag button {
  background: transparent; border: 0;
  color: var(--accent); opacity: 0.7;
  cursor: pointer; font-size: 13px;
  padding: 0; line-height: 1;
}
.skill-tag button:hover { opacity: 1; }

/* ─── Buttons ─── */
.btn-primary, .submit-btn {
  padding: 12px 22px;
  background: var(--ink-1);
  color: white;
  border: 0; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 180ms;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover, .submit-btn:hover:not(:disabled) {
  background: var(--accent); color: white;
  transform: translateY(-2px);
}
.btn-primary:disabled, .submit-btn:disabled {
  opacity: 0.55; cursor: wait; transform: none;
}
.btn-secondary {
  padding: 12px 20px;
  background: transparent;
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 180ms;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--ink-2); }

/* arrow 微动 */
.btn-primary .arrow, .submit-btn .arrow { transition: transform 150ms; }
.btn-primary:hover .arrow, .submit-btn:hover .arrow { transform: translateX(3px); }

/* ─── Result wrap（API 结果展示容器）─── */
.result-wrap {
  max-width: 760px; margin: 24px auto 60px;
  padding: 0 8px;
  position: relative; z-index: 1;
}
.result-wrap:empty { display: none; }

/* ─── Footer ─── */
footer {
  max-width: 1240px; margin: 96px auto 0;
  padding: 28px 24px 50px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-4); font-size: 12.5px;
  position: relative; z-index: 1;
  text-align: center;
}
footer .links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
footer .links a { color: var(--ink-3); }
footer .links a:hover { color: var(--ink-1); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .hero { padding: 36px 16px 20px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead, .hero .lead { font-size: 14.5px; }
  .form-card, .card, .section-card { padding: 20px 18px; }
}

/* ── 图标系统（assets/icons.js sprite）：1em 方块随字号字色，统一 1.7 细线圆角 ── */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
