@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500;1,9..144,600&family=Nunito:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ============================================================
   Relinker.ai — Global Design System
   默认：水彩纸感浅色主题（与品牌 logo 一致）
   ============================================================ */

/* ── 1. CSS 变量（水彩纸感主题）──────────────────────────── */
:root {
  /* 主品牌色 — 靛蓝 / 青绿 / 暖橙（呼应 logo 水彩环） */
  --primary:       #3d4f7a;
  --primary-dark:  #2d3a5c;
  --primary-light: #e8edf5;
  --secondary:     #2a9d8f;
  --accent:        #d97b62;
  --accent-soft:   #fceee8;

  /* 功能色 */
  --success:       #2a8f6f;
  --success-bg:    #e6f5ef;
  --success-text:  #1a5c45;
  --warning:       #c9a227;
  --warning-bg:    #fdf6e3;
  --warning-text:  #7a5f12;
  --danger:        #c94c4c;
  --danger-bg:     #fceaea;
  --danger-text:   #8b2e2e;

  /* 文字色 */
  --text:          #2a2826;
  --text-muted:    #6b6560;
  --text-light:    #9a928a;
  --text-inverse:  #fdfcfa;

  /* 背景 — 暖白画纸 */
  --bg:            #f4efe6;
  --bg-white:      #fdfcfa;
  --bg-light:      #ebe4d8;

  /* 边框 */
  --border:        #ddd4c8;
  --border-light:  #ece5db;

  /* 阴影（柔和、偏暖） */
  --shadow-sm:     0 2px 8px rgba(58, 48, 38, 0.06);
  --shadow:        0 4px 20px rgba(58, 48, 38, 0.08);
  --shadow-md:     0 8px 28px rgba(58, 48, 38, 0.10);
  --shadow-lg:     0 16px 48px rgba(58, 48, 38, 0.12);

  /* 圆角 — 略有机，非完全直角 */
  --radius-sm:     6px;
  --radius:        14px;
  --radius-md:     20px;
  --radius-lg:     28px;
  --radius-full:   9999px;

  /* 字体：正文 Nunito + 系统中文；英文大标题/字标用 Fraunces（柔和衬线、接近水彩墨迹感，又比纯手写体工整） */
  --font:          'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-display:  'Fraunces', 'Georgia', 'Times New Roman', 'Nunito', -apple-system, 'PingFang SC', 'Microsoft YaHei', serif;

  /* 过渡 */
  --transition:    all 0.2s ease;
  --transition-md: all 0.35s ease;

  /* 平台品牌色 */
  --xhs:     #ff2442;
  --douyin:  #00d4ff;
  --baidu:   #2932e1;
  --weibo:   #e6162d;
}

/* 深色变体（个别页面可挂 html.theme-dark） */
.theme-dark {
  --primary:       #8b9fe0;
  --primary-dark:  #6b7fd0;
  --primary-light: #252530;
  --secondary:     #5eead4;
  --accent:        #fb923c;
  --accent-soft:   #3a3028;

  --success:       #34d399;
  --success-bg:    #1a2e24;
  --success-text:  #a7f3d0;
  --warning:       #fbbf24;
  --warning-bg:    #2a2410;
  --warning-text:  #fde68a;
  --danger:        #f87171;
  --danger-bg:     #2a1515;
  --danger-text:   #fecaca;

  --text:          #ececf1;
  --text-muted:    #9ca3af;
  --text-light:    #6b7280;
  --text-inverse:  #1a1a2e;

  --bg:            #121014;
  --bg-white:      #1a1816;
  --bg-light:      #242220;

  --border:        #3d3834;
  --border-light:  #4a4540;

  --shadow-sm:     0 1px 4px rgba(0,0,0,0.35);
  --shadow:        0 4px 16px rgba(0,0,0,0.4);
  --shadow-md:     0 8px 28px rgba(0,0,0,0.45);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.5);
}

.page-light {
  /* 与默认浅色一致，保留类名兼容旧页面 */
}


/* ── 2. CSS Reset ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(217, 123, 98, 0.14), transparent 55%),
    radial-gradient(ellipse 90% 70% at 95% 15%, rgba(42, 157, 143, 0.10), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(61, 79, 122, 0.08), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img { max-width: 100%; display: block; }

button {
  font-family: var(--font);
  cursor: pointer;
}

input, select, textarea {
  font-family: var(--font);
}

/* 高于各页内联 <style> 中的 .language-selector，保证中文/西文字体栈一致 */
html body .language-selector select {
  font-family: var(--font);
  font-size: 0.875rem;
}


/* ── 3. 布局工具 ─────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}


/* ── 4. 通用标题 ─────────────────────────────────────────── */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}


/* ── 5. 卡片 ────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-flat {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
}

.card-hover {
  transition: var(--transition-md);
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon { font-size: 1.5rem; }

.card-content {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}


/* ── 6. 按钮 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

/* 主按钮 */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* 次按钮 */
.btn-secondary {
  background: var(--bg-white);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-light);
}

/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-light);
}

/* 文字按钮 */
.btn-text {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
  padding: 6px 12px;
}

.btn-text:hover:not(:disabled) {
  background: var(--primary-light);
}

/* 按钮尺寸 */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 12px;
}

.btn-full {
  width: 100%;
}


/* ── 7. 表单元素 ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-white);
  transition: var(--transition);
  outline: none;
}

.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 79, 122, 0.18);
}

.input::placeholder {
  color: var(--text-light);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── 8. 标签 & Badge ───────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(61, 79, 122, 0.2);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}


/* ── 9. 进度条 ───────────────────────────────────────────── */
.progress-bar {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  flex: 1;
  text-align: center;
}

.progress-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  transition: var(--transition);
}

.progress-step.active .progress-step-number {
  background: var(--primary);
  color: #fff;
}

.progress-step.completed .progress-step-number {
  background: var(--success);
  color: #fff;
}

.progress-step-label {
  font-size: 0.75rem;
  color: var(--text-light);
}


/* ── 10. 弹窗 Modal ─────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  margin: 20px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-sm { max-width: 360px; }
.modal-lg { max-width: 640px; }


/* ── 11. 辅助工具 ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: 0.875rem; }
.text-xs     { font-size: 0.8rem; }
.font-bold   { font-weight: 700; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }

.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mt-32       { margin-top: 32px; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.mb-32       { margin-bottom: 32px; }
.mb-0        { margin-bottom: 0; }

.pt-40       { padding-top: 40px; }
.pb-40       { padding-bottom: 40px; }
.py-40       { padding: 40px 0; }
.py-60       { padding: 60px 0; }
.px-20       { padding: 0 20px; }

.w-full      { width: 100%; }
.hidden      { display: none !important; }


/* ── 12. 响应式 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .section-title  { font-size: 1.5rem; }
  .page-title     { font-size: 1.4rem; }
  .card          { padding: 16px; }
  .modal         { padding: 20px; }
  .btn-group     { flex-direction: column; }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}
