/* ===================================================================
 * TKX Base — 推薪客共享基础样式
 * =================================================================== */

/* ------------------------------ Colors ------------------------------ */
:root {
  --tkx-blue:   #F97316;    /* 品牌橙（兼容旧名 blue） */
  --tkx-green:  #00B578;
  --tkx-red:    #F5222D;
  --tkx-gray:   #6B7280;
  --tkx-yellow: #FA8C16;
  --tkx-purple: #722ED1;

  --tkx-primary:   var(--tkx-blue);
  --tkx-success:   var(--tkx-green);
  --tkx-danger:    var(--tkx-red);
  --tkx-warning:   var(--tkx-yellow);
  --tkx-info:      var(--tkx-gray);

  --tkx-bg: var(--bg-secondary);
  --tkx-bg-card:   #FFFFFF;
  --tkx-text:      #1F2937;
  --tkx-text-secondary: #6B7280;
  --tkx-border:    #E5E7EB;
  --tkx-radius:    8px;
  --tkx-radius-lg: 12px;
}

/* ------------------------------ Fonts ------------------------------ */
body, input, textarea, select, button {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------ Button Variants -------------------- */
.tkx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--tkx-radius);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
  white-space: nowrap;
  user-select: none;
}
.tkx-btn:hover { opacity: .88; }
.tkx-btn:active { opacity: .75; }
.tkx-btn:disabled { opacity: .5; cursor: not-allowed; }

.tkx-btn--primary { background: var(--tkx-primary);  color: #fff; }
.tkx-btn--success { background: var(--tkx-success);  color: #fff; }
.tkx-btn--danger  { background: var(--tkx-danger);   color: #fff; }
.tkx-btn--warning { background: var(--tkx-warning);  color: #fff; }
.tkx-btn--default { background: #fff; color: var(--tkx-text); border: 1px solid var(--tkx-border); }
.tkx-btn--ghost   { background: transparent; color: var(--tkx-primary); border: 1px solid var(--tkx-primary); }

.tkx-btn--sm { padding: 6px 12px; font-size: 12px; }
.tkx-btn--lg { padding: 14px 28px; font-size: 16px; }
.tkx-btn--block { width: 100%; }

/* ------------------------------ Card 卡片 --------------------------- */
.tkx-card {
  background: var(--tkx-bg-card);
  border-radius: var(--tkx-radius-lg);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tkx-card + .tkx-card { margin-top: 12px; }

.tkx-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--tkx-text);
  margin-bottom: 12px;
}

/* ------------------------------ Loading Spinner -------------------- */
.tkx-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--tkx-border);
  border-top-color: var(--tkx-primary);
  border-radius: 50%;
  animation: tkx-spin .6s linear infinite;
}
@keyframes tkx-spin { to { transform: rotate(360deg); } }

/* 全屏 loading */
.tkx-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.85);
}
.tkx-loading-overlay .tkx-spinner { width: 40px; height: 40px; border-width: 4px; }
.tkx-loading-overlay .tkx-loading-text {
  margin-top: 12px;
  font-size: 14px;
  color: var(--tkx-text-secondary);
}

/* ------------------------------ Toast (备用) ------------------------ */
/* tkx-error-handler.js 已经包含了 toast，这里仅作为 fallback class */
.tkx-toast-fallback {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ------------------------------ 表单常用样式 ------------------------ */
.tkx-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--tkx-border);
  border-radius: var(--tkx-radius);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.tkx-input:focus { border-color: var(--tkx-primary); }
.tkx-input--error { border-color: var(--tkx-danger); }

.tkx-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--tkx-text);
  margin-bottom: 4px;
}

/* ------------------------------ 响应式容器 -------------------------- */
.tkx-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ------------------------------ 工具类 ------------------------------ */
.tkx-text-center { text-align: center; }
.tkx-text-right  { text-align: right; }
.tkx-mt-8  { margin-top: 8px; }
.tkx-mt-16 { margin-top: 16px; }
.tkx-mt-24 { margin-top: 24px; }
.tkx-mb-8  { margin-bottom: 8px; }
.tkx-mb-16 { margin-bottom: 16px; }
.tkx-mb-24 { margin-bottom: 24px; }
.tkx-flex  { display: flex; }
.tkx-flex-center { display: flex; align-items: center; justify-content: center; }
.tkx-flex-between { display: flex; align-items: center; justify-content: space-between; }
.tkx-gap-8  { gap: 8px; }
.tkx-gap-12 { gap: 12px; }
.tkx-gap-16 { gap: 16px; }
.tkx-hidden { display: none !important; }
