/* =========================================================
   共用 UI 特效库 (ui.css)
   在页面中通过 <link rel="stylesheet" href="/assets/lib/ui.css"> 引入
   配合 <script src="/assets/lib/ui.js"></script> 使用交互组件
   ========================================================= */

.ui-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ---------- 按钮 ---------- */
.ui-btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #1f2330;
  background: #eef0f7;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
  user-select: none;
}
.ui-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(31,35,48,.12); }
.ui-btn:active { transform: translateY(0); }
.ui-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.ui-btn-ghost { background: #fff; border-color: #d7dae6; color: #4b5066; }
.ui-btn-danger { background: #fee2e2; color: #dc2626; }
.ui-btn-block { display: block; width: 100%; text-align: center; }

/* ---------- 卡片 ---------- */
.ui-card {
  background: #fff;
  border: 1px solid #e6e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(31,35,48,.05);
}

/* ---------- 徽标 ---------- */
.ui-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #4f46e5;
}

/* ---------- 模态框 ---------- */
.ui-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,18,30,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.ui-modal.open { display: flex; animation: ui-fade .2s ease; }
.ui-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: ui-pop .22s ease;
}
.ui-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  border: none; background: transparent;
  font-size: 24px; line-height: 1; cursor: pointer; color: #9aa0b4;
}
.ui-modal-close:hover { color: #1f2330; }

/* ---------- 标签页 ---------- */
.ui-tabs .ui-tab-nav { display: flex; gap: 6px; border-bottom: 1px solid #e6e8f0; margin-bottom: 14px; }
.ui-tabs .ui-tab-nav button {
  border: none; background: transparent; padding: 10px 16px;
  cursor: pointer; font-size: 14px; color: #6b7280; border-bottom: 2px solid transparent;
}
.ui-tabs .ui-tab-nav button.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }
.ui-tabs .ui-tab-panel { display: none; animation: ui-fade .2s ease; }
.ui-tabs .ui-tab-panel.active { display: block; }

/* ---------- 手风琴 ---------- */
.ui-accordion { border: 1px solid #e6e8f0; border-radius: 12px; overflow: hidden; }
.ui-accordion-item + .ui-accordion-item { border-top: 1px solid #e6e8f0; }
.ui-accordion-head {
  width: 100%; text-align: left; border: none; background: #fafbff;
  padding: 14px 16px; cursor: pointer; font-size: 15px; font-weight: 600; color: #1f2330;
  display: flex; justify-content: space-between; align-items: center;
}
.ui-accordion-head::after { content: "+"; font-size: 20px; color: #9aa0b4; }
.ui-accordion-item.open .ui-accordion-head::after { content: "−"; }
.ui-accordion-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.ui-accordion-body > div { padding: 14px 16px; color: #4b5066; }

/* ---------- 回到顶部 ---------- */
.ui-totop {
  position: fixed; right: 22px; bottom: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; display: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 20px; box-shadow: 0 8px 20px rgba(99,102,241,.4); z-index: 80;
}
.ui-totop.show { display: block; animation: ui-fade .2s ease; }

/* ---------- Toast ---------- */
.ui-toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.ui-toast {
  background: #1f2330; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: ui-pop .2s ease;
}
.ui-toast.success { background: #16a34a; }
.ui-toast.error { background: #dc2626; }

/* ---------- 进场动画 ---------- */
.ui-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.ui-reveal.in { opacity: 1; transform: none; }

@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* ---------- 渐变文字 ---------- */
.ui-gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
