/* ============================================================
   推薪客 橙色主题统一响应式框架 v3.0 (增强版)
   Orange Theme Unified Responsive Framework v3.0
   自动适配 7 类设备 + 5 种使用场景
   ============================================================ */

/* ---------- CSS变量 ---------- */
:root {
  /* ===== 橙色系（主色） ===== */
  --primary-orange: #F97316;
  --primary-orange-rgb: 249,115,22;
  --primary-orange-light: #FB923C;
  --primary-orange-dark: #EA580C;
  --primary-orange-darker: #C2410C;
  --primary-orange-pale: #FFF7ED;
  --primary-orange-bg: #FFF7ED;
  
  /* ===== 辅助色 ===== */
  --accent-red: #E74C3C;
  --accent-green: #27AE60;
  --accent-blue: #3498DB;
  --accent-yellow: #F39C12;
  --accent-purple: #8B5CF6;
  
  /* ===== 中性色 ===== */
  --text-primary: #2D2D2D;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-inverse: #FFFFFF;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #FAFAFA;
  --border-color: #E0E0E0;
  --border-light: #F0F0F0;
  
  /* ===== 阴影 ===== */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 32px rgba(0,0,0,0.15);
  --shadow-orange: 0 4px 14px rgba(249,115,22,0.25);
  --shadow-orange-xl: 0 8px 24px rgba(249,115,22,0.3);
  
  /* ===== 圆角 ===== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 50%;
  --radius-pill: 999px;
  
  /* ===== 间距 ===== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* ===== 字体 ===== */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-family-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 28px;
  --font-size-5xl: 36px;
  --font-size-6xl: 48px;
  
  /* ===== 布局尺寸 ===== */
  --header-height: 56px;
  --tabbar-height: 50px;
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1400px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 60px;
  
  /* ===== 动画 ===== */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* ===== z-index 层级 ===== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-sidebar: 600;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 2000;
  --z-tooltip: 3000;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

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

a {
  color: var(--primary-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-orange-dark); }

img { max-width: 100%; height: auto; }
svg { vertical-align: middle; }

ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }

/* ════════════════════════════════════════════════════════
   按钮系统
   ════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  text-decoration: none;
  outline: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(249,115,22,0.3);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary-orange);
  color: var(--text-inverse);
  border-color: var(--primary-orange);
}
.btn-primary:hover {
  background: var(--primary-orange-dark);
  border-color: var(--primary-orange-dark);
  box-shadow: var(--shadow-orange);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--primary-orange);
  border-color: var(--primary-orange);
}
.btn-secondary:hover {
  background: var(--primary-orange-pale);
  color: var(--primary-orange-dark);
  border-color: var(--primary-orange-dark);
}

.btn-text {
  background: transparent;
  color: var(--primary-orange);
  border-color: transparent;
  padding-left: 12px;
  padding-right: 12px;
}
.btn-text:hover {
  background: var(--primary-orange-pale);
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}
.btn-danger:hover { background: #C0392B; border-color: #C0392B; color: #fff; }

.btn-success {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}
.btn-success:hover { background: #1E8449; border-color: #1E8449; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }

.btn-link {
  background: transparent;
  color: var(--primary-orange);
  border: none;
  padding: 0;
  font-weight: 500;
}
.btn-link:hover { color: var(--primary-orange-dark); transform: none; box-shadow: none; }

.btn-sm { padding: 4px 12px; font-size: var(--font-size-xs); }
.btn-lg { padding: 12px 28px; font-size: var(--font-size-lg); }
.btn-xl { padding: 14px 36px; font-size: var(--font-size-lg); border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 按钮图标 */
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }

/* 按钮组 */
.btn-group {
  display: inline-flex;
  gap: 0;
}
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn + .btn { border-left: 1px solid rgba(0,0,0,0.1); }

/* ════════════════════════════════════════════════════════
   表单元素
   ════════════════════════════════════════════════════════ */

.input, .select, textarea {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  min-height: 36px;
}

.input::placeholder, textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, textarea:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

.input-error { border-color: var(--accent-red) !important; }
.input-error:focus { box-shadow: 0 0 0 3px rgba(231,76,60,0.15) !important; }

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input { flex: 1; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-group .btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}
.form-label-required::after { content: ' *'; color: var(--accent-red); }
.form-help {
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.form-error {
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--accent-red);
}

.form-inline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* 复选框 & 单选钮 */
.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-base);
}
.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--primary-orange);
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════
   卡片
   ════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.card-body { padding: var(--space-lg); }
.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* 卡片变体 */
.card-orange { border-top: 3px solid var(--primary-orange); }
.card-flat { box-shadow: none; border-color: var(--border-color); }
.card-clickable { cursor: pointer; }
.card-clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-orange-light);
}

/* ════════════════════════════════════════════════════════
   标签/徽章
   ════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-orange { background: var(--primary-orange-pale); color: var(--primary-orange-dark); }
.badge-red { background: #FDEDEC; color: var(--accent-red); }
.badge-green { background: #E8F8F0; color: var(--accent-green); }
.badge-blue { background: #EBF5FB; color: var(--accent-blue); }
.badge-yellow { background: #FEF9E7; color: #B7950B; }
.badge-purple { background: #F4ECF7; color: var(--accent-purple); }
.badge-gray { background: var(--bg-secondary); color: var(--text-secondary); }
.badge-white { background: #fff; color: var(--text-primary); border: 1px solid var(--border-color); }

/* 圆点 */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  margin-right: 4px;
}
.dot-orange { background: var(--primary-orange); }
.dot-red { background: var(--accent-red); }
.dot-green { background: var(--accent-green); }
.dot-gray { background: var(--text-muted); }

/* ════════════════════════════════════════════════════════
   标签页/导航
   ════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 20px;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
  flex-shrink: 0;
}
.tab-item:hover { color: var(--primary-orange); }
.tab-item.active {
  color: var(--primary-orange);
  border-bottom-color: var(--primary-orange);
  font-weight: 600;
}

/* 胶囊标签 */
.tabs-pill {
  border-bottom: none;
  gap: 4px;
  padding: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}
.tabs-pill .tab-item {
  border-bottom: none;
  padding: 6px 16px;
  border-radius: var(--radius-md);
}
.tabs-pill .tab-item.active {
  background: var(--text-inverse);
  color: var(--primary-orange);
  box-shadow: var(--shadow-sm);
}

/* ════════════════════════════════════════════════════════
   表格
   ════════════════════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-md) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.table th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.table tr:hover td { background: var(--primary-orange-pale); }
.table-striped tr:nth-child(even) td { background: var(--bg-tertiary); }
.table-striped tr:nth-child(even):hover td { background: var(--primary-orange-pale); }

.table-sm th, .table-sm td { padding: 6px 10px; }
.table-compact th, .table-compact td { padding: 8px 12px; }

/* ════════════════════════════════════════════════════════
   弹窗/模态框
   ════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-md);
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalFadeIn 0.25s ease;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-full { max-width: 100%; min-height: 100vh; border-radius: 0; }

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 1;
}
.modal-title { font-size: var(--font-size-xl); font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  font-size: 20px; color: var(--text-muted);
  cursor: pointer; border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.modal-body { padding: var(--space-lg); }
.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
}

/* ════════════════════════════════════════════════════════
   Toast通知
   ════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 280px;
  max-width: 420px;
  animation: toastSlideIn 0.3s ease;
  border-left: 4px solid var(--primary-orange);
  pointer-events: auto;
}
.toast-success { border-left-color: var(--accent-green); }
.toast-error { border-left-color: var(--accent-red); }
.toast-warning { border-left-color: var(--accent-yellow); }
.toast-info { border-left-color: var(--accent-blue); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ════════════════════════════════════════════════════════
   加载动画
   ════════════════════════════════════════════════════════ */

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary-orange);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, #E0E0E0 37%, var(--bg-secondary) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 加载覆盖层 */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* ════════════════════════════════════════════════════════
   布局系统
   ════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.container-narrow { max-width: var(--max-width-narrow); }
.container-wide { max-width: var(--max-width-wide); }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Grid 系统 */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* 两栏布局 */
.layout-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-lg);
}
.layout-sidebar-right {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-lg);
}

/* ════════════════════════════════════════════════════════
   间距工具
   ════════════════════════════════════════════════════════ */

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.ml-sm { margin-left: var(--space-sm); }
.ml-md { margin-left: var(--space-md); }
.mr-sm { margin-right: var(--space-sm); }
.mr-md { margin-right: var(--space-md); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }

/* ════════════════════════════════════════════════════════
   文本工具
   ════════════════════════════════════════════════════════ */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--primary-orange); }
.text-danger { color: var(--accent-red); }
.text-success { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }
.text-yellow { color: var(--accent-yellow); }
.text-white { color: #fff; }

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.font-bold { font-weight: 600; }
.font-normal { font-weight: 400; }
.font-light { font-weight: 300; }
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.word-break { word-break: break-all; }

/* ════════════════════════════════════════════════════════
   其他工具类
   ════════════════════════════════════════════════════════ */

.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-md) 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.empty-state-title {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-secondary);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 72px; height: 72px; }

/* 阴影变量 */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-orange { box-shadow: var(--shadow-orange); }

/* 圆角 */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* 显示/隐藏 */
.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* 浮动 */
.float-right { float: right; }
.float-left { float: left; }
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* 光标 */
.pointer { cursor: pointer; }
.not-allowed { cursor: not-allowed; }

/* 边框 */
.border { border: 1px solid var(--border-color); }
.border-light { border: 1px solid var(--border-light); }
.border-orange { border: 1px solid var(--primary-orange); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border-light); }
.border-b { border-bottom: 1px solid var(--border-light); }

/* 背景 */
.bg-white { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-orange-pale { background: var(--primary-orange-pale); }
.bg-orange { background: var(--primary-orange); color: #fff; }
.bg-gradient-orange {
  background: linear-gradient(135deg, #FB923C, #F97316);
  color: #fff;
}

/* 宽度 */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }

/* ════════════════════════════════════════════════════════
   橙色主题专用组件
   ════════════════════════════════════════════════════════ */

/* 橙色头部 */
.header-orange {
  background: linear-gradient(135deg, var(--primary-orange-light), var(--primary-orange), var(--primary-orange-dark));
  color: #fff;
  padding: var(--space-lg) 0;
}

/* 橙色统计卡片 */
.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition-base);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
}
.stat-card .stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--primary-orange);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--primary-orange-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary-orange);
}

/* 橙色进度条 */
.progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-orange);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}
.progress-bar-sm { height: 4px; }
.progress-bar-lg { height: 12px; }

/* 橙色分割线 */
.divider-orange {
  height: 3px;
  background: var(--gradient-orange);
  border: none;
  border-radius: var(--radius-pill);
  margin: var(--space-lg) 0;
}

/* 橙色标签页指示器 */
.tab-indicator {
  width: 40px;
  height: 3px;
  background: var(--primary-orange);
  border-radius: var(--radius-pill);
  transition: transform var(--transition-base);
}

/* 橙色提示框 */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.alert-info {
  background: #EBF5FB;
  border-left: 4px solid var(--accent-blue);
  color: #1A5276;
}
.alert-success {
  background: #E8F8F0;
  border-left: 4px solid var(--accent-green);
  color: #1E8449;
}
.alert-warning {
  background: #FEF9E7;
  border-left: 4px solid var(--accent-yellow);
  color: #7D6608;
}
.alert-danger {
  background: #FDEDEC;
  border-left: 4px solid var(--accent-red);
  color: #922B21;
}

/* ════════════════════════════════════════════════════════
   导航栏系统
   ════════════════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-navbar);
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: height var(--transition-base), box-shadow var(--transition-base);
}
.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--font-size-lg);
}
.navbar-brand img {
  transition: height var(--transition-base);
  border-radius: 6px;
}
.navbar-links {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}
.navbar-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--primary-orange);
  background: rgba(249,115,22,0.08);
}
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}
.navbar-toggle:hover {
  background: rgba(0,0,0,0.05);
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  z-index: var(--z-sidebar);
  transition: transform var(--transition-base);
}
.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.sidebar-menu-item:hover {
  background: var(--primary-orange-pale);
  color: var(--primary-orange);
}
.sidebar-menu-item.active {
  background: rgba(249,115,22,0.1);
  color: var(--primary-orange);
  font-weight: 600;
  border-right: 3px solid var(--primary-orange);
}

/* ════════════════════════════════════════════════════════
   底部 Footer
   ════════════════════════════════════════════════════════ */

.footer {
  background: var(--text-primary);
  color: var(--text-muted);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: auto;
}
.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--primary-orange-light);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}
.footer-title {
  color: var(--text-inverse);
  font-weight: 600;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: var(--space-sm);
}
.footer-links a {
  font-size: var(--font-size-sm);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
  margin-top: var(--space-xl);
  text-align: center;
  font-size: var(--font-size-xs);
}

/* ════════════════════════════════════════════════════════
   响应式断点
   ════════════════════════════════════════════════════════ */

/* ===== 宽屏/超大屏 (1441px+) ===== */
@media (min-width: 1441px) {
  .hide-wide { display: none !important; }
  .show-wide { display: block !important; }
  .container { max-width: 1400px; }
  :root { font-size: 15px; }
}

/* ===== 桌面端 (1025~1440px) ===== */
@media (min-width: 1025px) and (max-width: 1440px) {
  .hide-desktop { display: none !important; }
  .show-desktop { display: block !important; }
}

/* ===== 平板 (768~1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  .hide-tablet { display: none !important; }
  .show-tablet { display: block !important; }
  
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout-sidebar { grid-template-columns: 200px 1fr; }
  .layout-sidebar-right { grid-template-columns: 1fr 200px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  
  :root { --sidebar-width: 200px; }
}

/* ===== 手机端 (<=767px) ===== */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
  
  :root {
    --header-height: 48px;
    --tabbar-height: 48px;
    --sidebar-width: 100%;
    --font-size-xl: 16px;
    --font-size-2xl: 18px;
    --font-size-3xl: 20px;
    --font-size-4xl: 24px;
  }
  
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .layout-sidebar, .layout-sidebar-right { grid-template-columns: 1fr; }
  
  .card-body { padding: var(--space-md); }
  .table td, .table th { padding: 6px 8px; font-size: 12px; }
  .btn { padding: 6px 14px; font-size: 13px; }
  .modal { margin: var(--space-sm); max-width: 100%; border-radius: var(--radius-lg); }
  .container { padding: 0 var(--space-sm); }
  
  /* 导航栏汉堡菜单 */
  .navbar-links {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-sm);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-light);
    z-index: var(--z-dropdown);
  }
  .navbar-links.active { display: flex; }
  .navbar-links a {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-base);
  }
  .navbar-toggle { display: block; }
  
  /* 底部 footer */
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
}

/* ===== 小屏手机 (<=359px) ===== */
@media (max-width: 359px) {
  .hide-small { display: none !important; }
  :root { font-size: 12px; }
  .btn { font-size: 12px; padding: 6px 10px; }
  .input, .select, textarea { font-size: 12px; padding: 6px 10px; }
}

/* ===== 横屏模式 ===== */
@media (orientation: landscape) and (max-height: 500px) {
  .hide-landscape { display: none !important; }
  :root { --header-height: 40px; }
}

/* ===== 竖屏模式 ===== */
@media (orientation: portrait) {
  .hide-portrait { display: none !important; }
}

/* ===== 触摸设备 ===== */
@media (hover: none) and (pointer: coarse) {
  .touch-friendly { min-height: 44px; }
  .touch-friendly-btn { min-height: 44px; min-width: 44px; }
}

/* ===== 深色模式 (仅 admin) ===== */
@media (prefers-color-scheme: dark) {
  /* 默认不启用深色，使用JS控制 */
}

/* ===== 打印 ===== */
@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .navbar, .sidebar, .footer { display: none; }
  .btn-primary { background: #333 !important; color: white !important; }
}

/* ════════════════════════════════════════════════════════
   图片自适应
   ════════════════════════════════════════════════════════ */

.img-responsive {
  max-width: 100%;
  height: auto;
}
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.img-rounded { border-radius: var(--radius-md); }
.img-circle { border-radius: var(--radius-full); }

/* ════════════════════════════════════════════════════════
   动画
   ════════════════════════════════════════════════════════ */

.fade-in {
  animation: fadeIn var(--transition-base) ease;
}
.fade-in-up {
  animation: fadeInUp var(--transition-slow) ease;
}
.slide-in-left {
  animation: slideInLeft var(--transition-base) ease;
}
.slide-in-right {
  animation: slideInRight var(--transition-base) ease;
}
.scale-in {
  animation: scaleIn var(--transition-base) ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ════════════════════════════════════════════════════════
   三端页面切换适配
   ════════════════════════════════════════════════════════ */

/* 主站版本 (PC) */
body.device-desktop .page-h5-only,
body.device-desktop .page-admin-only { display: none; }

/* H5版本 (手机/微信内) */
body.env-wechat .page-desktop-only,
body.env-wechat .page-admin-only { display: none; }

/* Admin版本 */
body.device-wide .page-h5-only,
body.device-wide .page-desktop-only { display: none; }

/* ════════════════════════════════════════════════════════
   End of 推薪客 橙色主题统一响应式框架 v3.0
   ════════════════════════════════════════════════════════ */
