/* ========================================
   lanhu199 API 开放平台 - 深色科技主题
   设计系统: 深色底 + 青色点缀 + 毛玻璃
   VARIANCE: 6 | MOTION: 5 | DENSITY: 5
   ======================================== */

:root {
  /* 基础色板 */
  --bg-primary: #0b0d17;
  --bg-secondary: #0f1221;
  --surface: #131729;
  --surface-elevated: #1a1f35;
  --surface-glass: rgba(15, 23, 42, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);

  /* 文本 */
  --text-primary: #e2e8f0;
  --text-secondary: #8892a8;
  --text-muted: #5a6378;
  --text-inverse: #0b0d17;

  /* 强调色 */
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  /* 方法色 */
  --method-get: #10b981;
  --method-post: #3b82f6;
  --method-put: #f59e0b;
  --method-delete: #ef4444;
  --method-patch: #8b5cf6;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 字体 */
  --font-display: 'Orbitron', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "JetBrains Mono", monospace;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);

  /* 动画 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;

  /* 布局 */
  --max-width: 960px;
  --nav-height: 64px;
  --bottom-nav-height: 68px;

  /* 渐变 */
  --bg-gradient: radial-gradient(ellipse at 50% 0%, #111827 0%, #0b0d17 70%);
  --gradient-cyan-violet: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

/* ========================================
   基础重置
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--text-primary);
}

body {
  background: var(--bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: var(--bg-gradient);
  background-attachment: fixed;
}

/* ========================================
   容器
   ======================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}

/* ========================================
   玻璃卡片
   ======================================== */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   顶部导航栏
   ======================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--gradient-cyan-violet);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1;
  display: none;
}

/* 导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.nav-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

@media (max-width: 640px) {
  .nav-link .nav-label {
    display: none;
  }
  .nav-link {
    padding: 8px 10px;
  }
}

/* ========================================
   运行状态条
   ======================================== */
.uptime-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 10px 0;
  margin: 0 auto;
  max-width: var(--max-width);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  flex-wrap: wrap;
}

.uptime-section.compact {
  padding: 6px 1.5rem;
  gap: 0.75rem;
}

.uptime-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.uptime-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.uptime-row svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  opacity: 0.6;
}

.uptime-label {
  font-weight: 400;
}

.uptime-value {
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2px;
}

@media (max-width: 640px) {
  .uptime-section { gap: 0.5rem; padding: 6px 1rem; font-size: 0.7rem; }
  .uptime-section.compact { padding: 4px 1rem; }
}

/* ========================================
   英雄区（首页）
   ======================================== */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: var(--gradient-cyan-violet);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

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

.hero-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .hero-section { padding: 2rem 0 1.5rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-desc { font-size: 0.95rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-number { font-size: 1.4rem; }
}

/* ========================================
   区域标题
   ======================================== */
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
  fill: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ========================================
   公告
   ======================================== */
.announcement-bar {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.announcement-bar svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-amber);
  flex-shrink: 0;
}

.announcement-bar .ann-date {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .announcement-bar { font-size: 0.82rem; flex-wrap: wrap; }
}

/* ========================================
   搜索
   ======================================== */
.search-section {
  margin-bottom: 1.5rem;
}

.search-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 11px 18px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

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

.search-input:focus {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.08);
  background: var(--surface-elevated);
}

/* 分类筛选 */
.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.category-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-sans);
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

.category-btn.active {
  background: var(--accent-cyan);
  color: var(--text-inverse);
  border-color: var(--accent-cyan);
  font-weight: 600;
}

/* ========================================
   API 卡片网格
   ======================================== */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .api-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.api-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.api-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cyan-violet);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.api-card:hover {
  border-color: rgba(6, 182, 212, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.api-card:hover::before {
  opacity: 1;
}

.api-card.fade-in {
  animation: cardFadeIn 0.4s var(--ease-out) forwards;
  opacity: 0;
  transform: translateY(12px);
}

@keyframes cardFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.method-badge.get { background: rgba(16, 185, 129, 0.12); color: var(--method-get); }
.method-badge.post { background: rgba(59, 130, 246, 0.12); color: var(--method-post); }
.method-badge.put { background: rgba(245, 158, 11, 0.12); color: var(--method-put); }
.method-badge.delete { background: rgba(239, 68, 68, 0.12); color: var(--method-delete); }
.method-badge.patch { background: rgba(139, 92, 246, 0.12); color: var(--method-patch); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.status-dot.inactive {
  background: var(--text-muted);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-stat svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.card-stat-value {
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ========================================
   展开详情
   ======================================== */
.details-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  animation: slideDown 0.2s var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 65px;
  flex-shrink: 0;
  padding-top: 2px;
}

.url-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.url-box code {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  word-break: break-all;
  font-family: var(--font-mono);
  flex: 1;
  min-width: 0;
}

.params-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.param-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.param-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.required-badge {
  font-size: 0.7rem;
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.param-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.expand-btn:hover {
  color: var(--text-secondary);
}

.expand-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  transition: transform var(--duration-fast) var(--ease-out);
}

.expand-btn.expanded svg {
  transform: rotate(90deg);
}

/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--gradient-cyan-violet);
  color: white;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

/* 图标按钮 */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.icon-btn.copied {
  color: var(--accent-emerald);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

/* ========================================
   底部导航栏（替换FAB）
   ======================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(11, 13, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-out);
  text-decoration: none;
  min-width: 56px;
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
}

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

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
}

@media (min-width: 641px) {
  .bottom-nav {
    display: none;
  }
}

/* 给底部留空间（移动端） */
.bottom-spacer {
  height: calc(var(--bottom-nav-height) + 1rem);
}

/* ========================================
   页脚
   ======================================== */
.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
  font-size: 0.82rem;
}

.footer-link:hover {
  color: var(--text-secondary);
}

/* ========================================
   模态框
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 200;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  animation: modalSlideUp 0.25s var(--ease-out);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ========================================
   表单元素
   ======================================== */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.08);
  background: var(--surface-elevated);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  z-index: 300;
  display: none;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s var(--ease-out);
}

@media (min-width: 641px) {
  .toast {
    bottom: 2rem;
  }
}

.toast.show {
  display: block;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ========================================
   统计卡片（首页/统计页）
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-card.active .stat-number { color: var(--accent-emerald); }
.stat-card.total .stat-number { color: var(--accent-cyan); }

/* ========================================
   友情链接
   ======================================== */
.friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--duration-fast) var(--ease-out);
}

.friend-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(4px);
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.friend-content {
  flex: 1;
  min-width: 0;
}

.friend-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.friend-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.friend-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.friend-item:hover .friend-arrow {
  transform: translateX(3px);
  color: var(--text-secondary);
}

/* ========================================
   链接状态检测
   ======================================== */
.link-status-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  margin-left: 6px;
}

.status-online { color: var(--accent-emerald); }
.status-offline { color: var(--accent-red); }
.status-checking { color: var(--accent-amber); }

.link-response-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================
   TOP 10 API 列表
   ======================================== */
.top-apis-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-api-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}

.top-api-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.top-api-rank {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-badge {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.rank-badge.top {
  background: var(--gradient-cyan-violet);
  color: white;
}

.top-api-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.top-api-calls {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ========================================
   图表（统计页）
   ======================================== */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ========================================
   测试页 - 响应区域
   ======================================== */
.response-area {
  min-height: 200px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

.response-area pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.response-time {
  font-size: 0.78rem;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

/* ========================================
   管理后台表格
   ======================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  padding: 10px 8px;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
}

.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* ========================================
   工具类
   ======================================== */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.small { font-size: 0.78rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

/* ========================================
   赞助页
   ======================================== */
.sponsor-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.sponsor-card img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

/* ========================================
   API申请说明代码块
   ======================================== */
pre.url-box {
  display: block;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  line-height: 1.6;
}

code.url-box {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

/* ========================================
   增强动画
   ======================================== */

/* 卡片发光悬停增强 */
.api-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--gradient-cyan-violet);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration-normal) var(--ease-out);
  filter: blur(2px);
}

.api-card:hover::after {
  opacity: 0.15;
}

/* 按钮增强微交互 */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  pointer-events: none;
}

.btn:hover::after {
  opacity: 1;
}

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

/* 底部导航活跃指示器动画 */
.bottom-nav-item {
  position: relative;
}

.bottom-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 0 0 2px 2px;
  transition: transform var(--duration-normal) var(--ease-out);
}

.bottom-nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* 状态点增强脉冲 */
@keyframes pulse-dot-enhanced {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.status-dot.active {
  animation: pulse-dot-enhanced 2s ease-in-out infinite;
}

/* ========================================
   噪点纹理覆盖层
   ======================================== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

@media (prefers-reduced-transparency: reduce) {
  body::after { display: none; }
}

/* ========================================
   自定义滚动条
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-elevated);
  border-radius: 3px;
  transition: background var(--duration-fast) var(--ease-out);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-elevated) var(--bg-primary);
}

/* ========================================
   发光工具类
   ======================================== */
.glow-cyan {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15), 0 0 40px rgba(6, 182, 212, 0.05);
}

.glow-violet {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15), 0 0 40px rgba(139, 92, 246, 0.05);
}

.glow-emerald {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15), 0 0 40px rgba(16, 185, 129, 0.05);
}

/* ========================================
   英雄区增强
   ======================================== */
.hero-section::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.04) 0%, rgba(139, 92, 246, 0.02) 30%, transparent 60%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-40%) scale(1.1); opacity: 1; }
  100% { transform: translateX(-60%) scale(0.95); opacity: 0.7; }
}

.hero-title {
  position: relative;
  z-index: 1;
}

/* ========================================
   方法徽章增强
   ======================================== */
.method-badge {
  position: relative;
  isolation: isolate;
}

.method-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  z-index: -1;
}

.method-badge.get::before { background: rgba(16, 185, 129, 0.2); }
.method-badge.post::before { background: rgba(59, 130, 246, 0.2); }
.method-badge.put::before { background: rgba(245, 158, 11, 0.2); }
.method-badge.delete::before { background: rgba(239, 68, 68, 0.2); }
.method-badge.patch::before { background: rgba(139, 92, 246, 0.2); }

.api-card:hover .method-badge::before {
  opacity: 1;
}

/* ========================================
   页脚增强
   ======================================== */
.app-footer {
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: var(--gradient-cyan-violet);
  opacity: 0.3;
}

/* ========================================
   玻璃卡片增强
   ======================================== */
.glass-card {
  position: relative;
  isolation: isolate;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

/* ========================================
   玻璃卡片悬停效果
   ======================================== */
.glass-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--gradient-cyan-violet);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration-normal) var(--ease-out);
  filter: blur(4px);
}

.glass-card:hover::after {
  opacity: 0.08;
}

/* ========================================
   空状态增强
   ======================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  opacity: 0.3;
}

/* ========================================
   模态框背景增强
   ======================================== */
.modal-overlay {
  animation: overlayIn 0.2s var(--ease-out);
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================================
   分类按钮增强
   ======================================== */
.category-btn {
  position: relative;
  overflow: hidden;
}

.category-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-cyan-violet);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.category-btn:hover::after {
  opacity: 0.05;
}

.category-btn.active {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.category-btn.active::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-full);
  background: var(--gradient-cyan-violet);
  opacity: 0.3;
  z-index: -1;
  filter: blur(4px);
}

/* ========================================
   Toast 增强
   ======================================== */
.toast.show {
  animation: toastSlideUp 0.3s var(--ease-out);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 640px) {
  :root {
    --nav-height: 56px;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .app-title {
    font-size: 0.95rem;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }

  .hero-section::before {
    width: 400px;
    height: 400px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .api-card.fade-in {
    opacity: 1;
    animation: none;
  }

  body::after { display: none; }
  .hero-section::before { animation: none !important; }
  .status-dot.active { animation: none; }
}
