/* ============================================================
   《开发需求文档 FOR AI v2.0》§4.3 首页样式
   依赖 variables.css / global.css
   V5.7：Logo + 卡片升级 + 弹性进场 + 3D 悬停 + 波纹 + 粒子 + 滚动导航
   ============================================================ */

/* ---------- 顶栏 ---------- */
.dc-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(91, 127, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

/* 滚动超过 50px 后导航栏变实（home.js 加 .scrolled） */
.dc-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dc-header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

/* ---------- Logo（站长的新 logo 位图，V5.8 起不再用 CSS 拼） ---------- */
.dc-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.dc-logo-img {
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 84, 196, 0.28);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

.dc-logo:hover .dc-logo-img {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(37, 84, 196, 0.4);
}

/* 小引（精灵）：站在状态区右侧，与 logo 完全分开 */
.dc-spirit {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(214, 164, 74, 0.28));
  animation: dcSpiritFloat 5.6s ease-in-out infinite;
}

@keyframes dcSpiritFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* 开始页 / 背单词页的标题（这两页共用 home.css，之前没有对应样式） */
.dc-title {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1A1A2E;
  margin: 0 0 10px;
}
.dc-hello {
  font-size: 15px;
  color: #6B7180;
  margin: 0 0 22px;
}

.dc-logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1A1A2E;
}

.dc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dc-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.dc-nav a:hover {
  color: var(--color-primary-deep);
  background: rgba(91, 127, 255, 0.08);
}

.dc-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dc-auth .btn-primary {
  min-height: 40px;
  padding: 0 20px;
  font-size: 15px;
}

/* ---------- 主区 ---------- */
.dc-main {
  /* Soft UI 间距节奏：Section py-16 md:py-24 */
  padding: 64px 0 96px;
}

/* ---------- 顶部状态区 ---------- */
.dc-status-block {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeInScale {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.dc-greeting {
  font-size: clamp(22px, 3.4vw, 36px);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--color-text);
}

.dc-hl {
  color: var(--color-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dc-sub-text {
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- 状态行 ---------- */
.dc-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-line);
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.dc-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: dc-pulse 2.4s var(--ease-out) infinite;
}

@keyframes dc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- 场景卡 ---------- */
.dc-scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.dc-scene {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 36px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(250, 251, 255, 0.8) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 8px 32px rgba(91, 127, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-decoration: none;
  color: inherit;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* 弹性进场：延迟由内联 style 给出 */
  animation: fadeInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes fadeInBounce {
  0%   { opacity: 0; transform: translateY(40px) scale(0.9); }
  60%  { opacity: 1; transform: translateY(-8px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 卡片背景光斑 */
.dc-scene::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
    rgba(91, 127, 255, 0.1) 0%,
    transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.dc-scene:hover::before {
  opacity: 1;
}

.dc-scene:hover {
  transform: translateY(-12px) rotateX(2deg) scale(1.02);
  box-shadow:
    0 20px 60px rgba(91, 127, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(91, 127, 255, 0.3);
}

.dc-scene:active {
  transform: translateY(-2px) scale(0.99);
}

.dc-scene-ico {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  font-size: 30px;
  line-height: 1;
  background: linear-gradient(135deg, rgba(91, 127, 255, 0.14), rgba(255, 107, 157, 0.12));
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* V5.9：场景卡图标由 emoji 换成 arr_icon() 描边图标，统一 30px 笔触 */
.dc-scene-ico svg {
  width: 30px;
  height: 30px;
  stroke: var(--color-primary-deep);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dc-scene:hover .dc-scene-ico {
  transform: scale(1.1) translateY(-4px);
}

.dc-scene-name {
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #1A1A2E 0%, #5B7FFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #1A1A2E;
}

.dc-scene-desc {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-faint);
}

.dc-scene-meta {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 500;
  color: #6B7280;
  margin-bottom: 24px;
}

.dc-scene-join {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #5B7FFF;
  background: rgba(91, 127, 255, 0.08);
  transition: background 0.3s ease, transform 0.3s ease;
}

.dc-scene:hover .dc-scene-join {
  background: rgba(91, 127, 255, 0.15);
  transform: translateX(4px);
}

/* ---------- 主行动区 ---------- */
.dc-actions {
  text-align: center;
  margin-bottom: 40px;
}

.dc-cta-btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 18px 48px;
  font-size: 18px;
  border-radius: var(--radius-md);
  animation: fadeInPulse 1s ease-out both;
}

@keyframes fadeInPulse {
  0%   { opacity: 0; transform: translateY(20px) scale(0.95); }
  50%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 悬停波纹 */
.dc-cta-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: width 0.6s ease, height 0.6s ease;
}

.dc-cta-btn:hover::before {
  width: 300px;
  height: 300px;
}

.dc-tip {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.dc-tip a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.dc-tip a:hover {
  text-decoration: underline;
}

/* ---------- slogan ---------- */
.dc-slogan {
  text-align: center;
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-text-muted);
  margin: 0;
  padding: 32px 0;
  border-top: 1px solid var(--color-line);
}

/* ---------- 页脚备案 ---------- */
.dc-footer {
  padding: 24px 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dc-footer a {
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.dc-footer a:hover {
  color: var(--color-text);
}

/* ---------- 背景粒子 ---------- */
.dc-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.dc-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(91, 127, 255, 0.4);
  animation: dc-float 20s infinite ease-in-out;
}

.dc-particle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s;  animation-duration: 18s; }
.dc-particle:nth-child(2) { top: 60%; left: 80%; animation-delay: 3s;  animation-duration: 22s; }
.dc-particle:nth-child(3) { top: 80%; left: 30%; animation-delay: 6s;  animation-duration: 20s; }
.dc-particle:nth-child(4) { top: 40%; left: 60%; animation-delay: 9s;  animation-duration: 24s; }
.dc-particle:nth-child(5) { top: 10%; left: 90%; animation-delay: 12s; animation-duration: 19s; }

@keyframes dc-float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  50%      { transform: translateY(-100px) translateX(50px); opacity: 0.8; }
}

/* 内容层压在粒子之上 */
.dc-header,
.dc-main,
.dc-footer,
.dc-tabbar {
  position: relative;
  z-index: 2;
}

/* ---------- 移动端底栏 ---------- */
.dc-tabbar {
  display: none;
}

/* ---------- 平板：两列 ---------- */
@media (max-width: 1024px) {
  .dc-scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .dc-status-block { margin-bottom: 44px; }
}

/* ---------- 手机：单列 + 底部导航 ---------- */
@media (max-width: 768px) {
  .dc-nav { display: none; }
  .dc-main { padding: 28px 0 88px; }
  .dc-scenes { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .dc-scene { padding: 24px 20px; }
  .dc-scene-ico { width: 48px; height: 48px; font-size: 26px; }
  .dc-scene-ico svg { width: 26px; height: 26px; }
  .dc-scene-name { font-size: 20px; }
  .dc-scene-meta { margin-bottom: 16px; }
  .dc-status-block { margin-bottom: 40px; }
  .dc-cta-btn { width: 100%; padding: 14px 36px; font-size: 16px; }
  .dc-footer { padding-bottom: calc(24px + 64px + env(safe-area-inset-bottom, 0px)); }
  .dc-logo-text { font-size: 20px; }
  .dc-logo-img { width: 34px; height: 34px; border-radius: 10px; }
  .dc-spirit { width: 76px; height: 76px; margin-bottom: 10px; }

  .dc-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .dc-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 0 8px;
    font-size: 11px;
    color: var(--color-text-faint);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
  }

  .dc-tabbar a.on,
  .dc-tabbar a:hover {
    color: var(--color-primary);
  }

  .dc-tabbar i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
  }

  /* V5.9：底栏图标从 emoji 换成 arr_icon() 的 24 网格描边图标，
     跨设备字形一致；尺寸与原来的 emoji 对齐。 */
  .dc-tabbar i svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* ---------- 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .dc-pulse,
  .dc-spirit,
  .dc-particle,
  .dc-status-block,
  .dc-scene,
  .dc-cta-btn { animation: none; }
  .dc-scene,
  .dc-nav a,
  .dc-tabbar a,
  .dc-header,
  .dc-scene-ico,
  .dc-scene-join,
  .dc-logo-img { transition: none; }
  .dc-scene:hover { transform: none; }
  .dc-scene:hover .dc-scene-ico { transform: none; }
  .dc-cta-btn::before { display: none; }
}

html[data-motion="off"] .dc-pulse,
html[data-motion="off"] .dc-spirit,
html[data-motion="off"] .dc-particle,
html[data-motion="off"] .dc-status-block,
html[data-motion="off"] .dc-scene,
html[data-motion="off"] .dc-cta-btn { animation: none; }
html[data-motion="off"] .dc-scene,
html[data-motion="off"] .dc-nav a,
html[data-motion="off"] .dc-tabbar a,
html[data-motion="off"] .dc-header,
html[data-motion="off"] .dc-scene-ico,
html[data-motion="off"] .dc-scene-join,
html[data-motion="off"] .dc-logo-img { transition: none; }
html[data-motion="off"] .dc-scene:hover { transform: none; }
html[data-motion="off"] .dc-scene:hover .dc-scene-ico { transform: none; }
html[data-motion="off"] .dc-cta-btn::before { display: none; }