/* ============================================
   项目全生命周期管理系统 - 全局基础样式
   暗黑科技风 · 移动端优先
   ============================================ */

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

/* ---- body 基础 ---- */
body {
  background: var(--bg-deep);
  font-family: var(--font-body);
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* ============================================
   通用组件样式
   ============================================ */

/* ---- 玻璃拟态卡片 ---- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-lg);
}

.card-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* ---- 标签 Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.badge-info {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--neon-cyan);
  color: #0a0a0f;
}

.btn-primary:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.btn-secondary {
  background: var(--neon-purple);
  color: #fff;
}

.btn-secondary:hover {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* ---- 输入框 ---- */
.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

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

.input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

/* ---- 搜索栏 ---- */
.search-bar {
  position: relative;
}

.search-bar .input {
  padding-left: 36px;
}

.search-bar::before {
  content: "\1F50D";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
  pointer-events: none;
}

/* ---- Tab 切换栏 ---- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab-item.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

/* ---- 骨架屏 ---- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ---- 进度条 ---- */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  transition: width 0.3s ease;
}

/* ---- 头像 ---- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--neon-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---- 弹窗遮罩 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

/* ---- 弹窗 ---- */
.modal {
  width: 100%;
  max-height: 80vh;
  background: #1a1a2e;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

/* ---- 底部弹出面板 ---- */
.bottom-sheet {
  width: 100%;
  max-height: 85vh;
  background: #1a1a2e;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.bottom-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto var(--space-lg);
}

/* ---- 浮动按钮 ---- */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 30;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab:active {
  transform: scale(0.92);
}

.fab:hover {
  box-shadow: 0 4px 30px rgba(0, 240, 255, 0.5);
}

/* ---- 分割线 ---- */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: var(--space-md) 0;
}

/* ---- 标签 Tag ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

/* ---- 列表项 ---- */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s;
}

.list-item:active {
  background: rgba(255, 255, 255, 0.04);
}

/* ---- 统计卡片 ---- */
.stat-card {
  text-align: center;
  padding: var(--space-lg);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ---- 时间轴 ---- */
.timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* ============================================
   动画
   ============================================ */

/* 骨架屏闪烁 */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 淡入 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 底部滑入 */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* 脉冲 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   工具类
   ============================================ */

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.p-sm {
  padding: var(--space-sm);
}

.p-md {
  padding: var(--space-md);
}

.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   滚动条美化
   ============================================ */

::-webkit-scrollbar {
  width: 4px;
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 2px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================
   底部 Tab 导航
   ============================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--safe-bottom);
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.nav-item.active {
  color: var(--neon-cyan);
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.nav-item .nav-label {
  font-size: 0.65rem;
}

.nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ============================================
   页面容器
   ============================================ */

.page {
  display: none;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 24px);
}

.page.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ============================================
   页面头部
   ============================================ */

.page-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.page-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.page-back:active {
  background: rgba(255, 255, 255, 0.08);
}
