/* ================================================
   温析 Wenxi — 全站公共样式
   ================================================ */

/* ─── 变量 ─── */
:root {
  --ink:      #0d0d0d;
  --paper:    #f5f0e8;
  --cream:    #ede8dc;
  --accent:   #e84c1e;
  --accent2:  #f5a623;
  --muted:    #7a7060;
  --border:   #d4cfc3;
  --card:     #faf7f2;
  --success:  #16a34a;
  --danger:   #dc2626;
  --warn:     #d97706;
  --radius:   12px;
  --shadow:   0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font:     'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-zh:  'PingFang SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* ─── 基础重置 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── 滚动条 ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── 布局容器 ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ─── 页面标题 ─── */
.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-header h1 {
  font-family: var(--font-zh);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.page-header .subtitle { color: var(--muted); margin-top: 4px; font-size: 0.9rem; }
.page-header .actions { margin-top: 12px; }

/* ─── 卡片 ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-zh);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── 按钮 ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #c73d14; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,76,30,0.3); }
.btn-secondary { background: var(--ink); color: var(--paper); }
.btn-secondary:hover:not(:disabled) { background: #333; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); background: var(--cream); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--cream); }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ─── 表单 ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,76,30,0.1);
}
.form-input::placeholder { color: var(--muted); opacity: 0.7; }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7060' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; display: none; }
.form-group.has-error .form-input,
.form-group.has-error .form-select { border-color: var(--danger); }
.form-group.has-error .form-error { display: block; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.form-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ─── 表格 ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--card); }
thead { background: var(--cream); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--cream); }
.table-empty { text-align: center; padding: 48px; color: var(--muted); font-size: 0.9rem; }

/* ─── 标签 ─── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag-default { background: var(--cream); color: var(--muted); border: 1px solid var(--border); }
.tag-primary { background: rgba(232,76,30,0.1); color: var(--accent); }
.tag-success { background: rgba(22,163,74,0.1); color: var(--success); }
.tag-danger { background: rgba(220,38,38,0.1); color: var(--danger); }
.tag-warn { background: rgba(217,119,6,0.1); color: var(--warn); }
.tag-info { background: rgba(59,130,246,0.1); color: #2563eb; }

/* ─── 徽章 ─── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}

/* ─── 分页 ─── */
.pagination { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 24px; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ─── 面包屑 ─── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { font-size: 0.7rem; opacity: 0.5; }

/* ─── 头像 ─── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--muted);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

/* ─── 统计数字 ─── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-num {
  font-family: var(--font-zh);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }

/* ─── 警告/提示 ─── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-info { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.2); color: #1d4ed8; }
.alert-success { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.2); color: #15803d; }
.alert-warn { background: rgba(217,119,6,0.08); border-color: rgba(217,119,6,0.2); color: #b45309; }
.alert-danger { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.2); color: #b91c1c; }

/* ─── Toast 提示 ─── */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}
.toast-success { background: #fff; border-left: 4px solid var(--success); color: var(--ink); }
.toast-error { background: #fff; border-left: 4px solid var(--danger); color: var(--ink); }
.toast-info { background: #fff; border-left: 4px solid #2563eb; color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }

/* ─── 模态框 ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--font-zh); font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: background 0.15s; }
.modal-close:hover { background: var(--cream); color: var(--ink); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ─── 加载动画 ─── */
.loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.875rem; }
.loading .spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--cream) 25%, var(--border) 50%, var(--cream) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── 空状态 ─── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; }

/* ─── 进度条 ─── */
.progress-bar { height: 8px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.4s ease; }

/* ─── 布局: 侧边栏 + 主内容 ─── */
.app-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 10px; margin-bottom: 8px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}
.sidebar-link:hover { background: var(--cream); color: var(--ink); }
.sidebar-link.active { background: var(--accent); color: #fff; }
.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.main-content { flex: 1; padding: 0 32px; overflow: hidden; }

/* ─── 顶部导航（内部页面） ─── */
.topnav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav-brand {
  font-family: var(--font-zh);
  font-weight: 900;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topnav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.topnav-right { display: flex; align-items: center; gap: 16px; }
.topnav-user { display: flex; align-items: center; gap: 10px; }
.topnav-points {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}
.points-icon { display: inline-block; }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 0 16px; }
  .topnav { padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .card { padding: 16px; }
  .modal { padding: 20px; }
}

/* ─── 工具类 ─── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.8rem; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── 定价卡片（全局复用） ─── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.pricing-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; position: relative; transition: transform .2s, box-shadow .2s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.1); }
.pricing-card.featured { border-color: var(--accent); background: var(--paper); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 4px 12px;
  border-radius: 100px; white-space: nowrap;
}
.pricing-tier { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.pricing-name { font-size: 1.2rem; font-weight: 900; margin-bottom: 4px; }
.pricing-desc { font-size: .8rem; color: var(--muted); margin-bottom: 20px; }
.pricing-price { font-size: 2rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.pricing-price span { font-size: .9rem; color: var(--muted); font-weight: 400; }
.pricing-mins { font-size: .8rem; color: var(--muted); margin-bottom: 20px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.pricing-features li { font-size: .85rem; color: var(--muted); display: flex; align-items: flex-start; gap: 8px; }
.pricing-features li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.pricing-btn {
  display: block; width: 100%; padding: 12px; border-radius: 8px; font-weight: 700;
  font-size: .9rem; text-align: center; border: 1.5px solid var(--border);
  background: transparent; color: var(--ink); transition: all .2s; cursor: pointer;
}
.pricing-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pricing-btn.featured-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.pricing-btn.featured-btn:hover { background: #c73d14; border-color: #c73d14; }

/* ─── 积分余额横幅 ─── */
.points-banner {
  display: flex; align-items: center; gap: 32px; padding: 32px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  margin-top: 24px; flex-wrap: wrap;
}
.points-big { text-align: center; }
.points-current { font-size: 3.5rem; font-weight: 900; color: var(--accent); line-height: 1; }
.points-label { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.points-divider { width: 1px; height: 60px; background: var(--border); }
.points-stats { display: flex; gap: 32px; }
.points-stat { text-align: center; }
.points-stat .num { font-size: 1.5rem; font-weight: 900; display: block; }
.points-stat .lbl { font-size: .75rem; color: var(--muted); }

/* ─── 动画 ─── */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.stagger > * { animation: fadeIn 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
