/* ============ 集AI帮 · 全局样式 ============ */
:root {
  --bg: #fafaf9;
  --text: #1c1917;
  --text-2: #78716c;
  --text-3: #a8a29e;
  --line: #e7e5e4;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(231, 229, 228, 0.7);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --card-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.10);
  --header-bg: rgba(250, 250, 249, 0.82);
  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-border: rgba(231, 229, 228, 0.8);
  --brand-grad: linear-gradient(135deg, #fbbf24, #f97316);
}

html.dark {
  --bg: #0c0a09;
  --text: #fafaf9;
  --text-2: #a8a29e;
  --text-3: #57534e;
  --line: #292524;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --card-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(12, 10, 9, 0.82);
  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ 背景装饰 ============ */
.bg-glow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.glow { position: absolute; border-radius: 50%; filter: blur(100px); }
.glow-1 { width: 420px; height: 420px; background: #fbbf24; top: -160px; right: -120px; opacity: .16; }
.glow-2 { width: 380px; height: 380px; background: #fb923c; bottom: -140px; left: -120px; opacity: .12; }
html.dark .glow-1 { opacity: .10; }
html.dark .glow-2 { opacity: .08; }

.site-header, .main, .site-footer { position: relative; z-index: 1; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.header-inner {
  max-width: 32rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-logo {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: #fff; font-weight: 900; font-size: 16px;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
  flex-shrink: 0;
}

.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }

.theme-btn {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--card-bg); }
.theme-btn:active { transform: scale(0.94); }

/* ============ 主内容 ============ */
.main {
  max-width: 32rem; margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.welcome { margin-bottom: 1.5rem; animation: fade-in .5s ease both; }

.welcome-small {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-3);
}

.welcome-title { margin-top: 2px; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }

.brand-text {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 60%, #ef4444 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ 分隔线 ============ */
.section-line { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); flex-shrink: 0;
}

.section-rule {
  height: 1px; flex: 1;
  background: linear-gradient(to right, var(--line), transparent);
}

/* ============ 功能卡片 ============ */
.apps {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.apps--single { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 单卡片缩小为整行九分之一面积（边长 1/3），内部元素同步缩小 */
.apps--single .app-card { padding: 10px; border-radius: 20px; }
.apps--single .app-icon { width: 36px; height: 36px; border-radius: 12px; font-size: 20px; }
.apps--single .app-name { font-size: 14px; }
.apps--single .app-desc { font-size: 11px; margin-top: 3px; }

.app-card {
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1rem;
  overflow: hidden;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px transparent, var(--card-shadow);
  animation: fade-in-up .5s ease backwards;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px var(--ring-hover), var(--card-shadow-lg);
}
.app-card:active { transform: scale(0.97); }
html.dark .app-card:hover { background: rgba(255, 255, 255, 0.06); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; }

.app-icon {
  width: 44px; height: 44px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  background: var(--icon-grad);
  box-shadow: inset 0 0 0 1px var(--ring);
  flex-shrink: 0;
}

.card-arrow {
  font-size: 16px; line-height: 1;
  color: var(--text-3);
  opacity: 0; transform: translateX(-3px);
  transition: opacity .2s, transform .2s, color .2s;
}
.app-card:hover .card-arrow { opacity: 1; transform: translateX(0); color: var(--text-2); }

.card-info { min-width: 0; }

.app-name {
  font-size: 16px; font-weight: 800; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.app-desc {
  margin-top: 4px; font-size: 12px; line-height: 1.4;
  color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ 卡片配色 ============ */
.app-card {
  --icon-grad: linear-gradient(135deg, rgba(251, 191, 36, 0.30), rgba(251, 146, 60, 0.06));
  --ring: rgba(245, 158, 11, 0.35);
  --ring-hover: rgba(245, 158, 11, 0.55);
}
.c-pink    { --icon-grad: linear-gradient(135deg, rgba(244, 114, 182, 0.30), rgba(236, 72, 153, 0.06)); --ring: rgba(244, 114, 182, 0.35); --ring-hover: rgba(244, 114, 182, 0.55); }
.c-rose    { --icon-grad: linear-gradient(135deg, rgba(251, 113, 133, 0.30), rgba(244, 63, 94, 0.06));  --ring: rgba(251, 113, 133, 0.35); --ring-hover: rgba(251, 113, 133, 0.55); }
.c-indigo  { --icon-grad: linear-gradient(135deg, rgba(129, 140, 248, 0.30), rgba(99, 102, 241, 0.06));  --ring: rgba(129, 140, 248, 0.35); --ring-hover: rgba(129, 140, 248, 0.55); }
.c-violet  { --icon-grad: linear-gradient(135deg, rgba(167, 139, 250, 0.30), rgba(139, 92, 246, 0.06));  --ring: rgba(167, 139, 250, 0.35); --ring-hover: rgba(167, 139, 250, 0.55); }
.c-blue    { --icon-grad: linear-gradient(135deg, rgba(96, 165, 250, 0.30), rgba(59, 130, 246, 0.06));   --ring: rgba(96, 165, 250, 0.35);   --ring-hover: rgba(96, 165, 250, 0.55); }
.c-cyan    { --icon-grad: linear-gradient(135deg, rgba(34, 211, 238, 0.30), rgba(6, 182, 212, 0.06));    --ring: rgba(34, 211, 238, 0.35);    --ring-hover: rgba(34, 211, 238, 0.55); }
.c-emerald { --icon-grad: linear-gradient(135deg, rgba(52, 211, 153, 0.30), rgba(16, 185, 129, 0.06));   --ring: rgba(52, 211, 153, 0.35);   --ring-hover: rgba(52, 211, 153, 0.55); }
.c-amber   { --icon-grad: linear-gradient(135deg, rgba(251, 191, 36, 0.30), rgba(251, 146, 60, 0.06));  --ring: rgba(245, 158, 11, 0.35);    --ring-hover: rgba(245, 158, 11, 0.55); }
.c-orange  { --icon-grad: linear-gradient(135deg, rgba(251, 146, 60, 0.30), rgba(234, 88, 12, 0.06));    --ring: rgba(251, 146, 60, 0.35);   --ring-hover: rgba(251, 146, 60, 0.55); }
.c-fuchsia { --icon-grad: linear-gradient(135deg, rgba(232, 121, 249, 0.30), rgba(217, 70, 239, 0.06));  --ring: rgba(232, 121, 249, 0.35);  --ring-hover: rgba(232, 121, 249, 0.55); }

/* ============ 页脚 ============ */
.site-footer { text-align: center; padding: 0 1rem 2rem; }

.site-footer p { font-size: 11px; color: var(--text-3); }

/* ============ 空状态 ============ */
.empty-tip { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ============ 动画 ============ */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .app-card, .welcome { animation: none; opacity: 1; }
}
