/*
 * 首页专用样式（M6a）：Hero + 搜索卡片、特性卡、统计、CTA。仅首页加载。
 * 结构与数值对齐旧 hidns 主题（nodeloc/DaisyUI 风格）；颜色全部来自 tokens.css。
 * 不使用内联样式；动画在 base.css 的 prefers-reduced-motion 下会被全局关闭。
 */

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; width: 100%; min-height: 80vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(to bottom, var(--hero-from), var(--hero-via), var(--hero-from)); }
.hero-blobs { position: absolute; inset: 0; opacity: var(--blob-opacity); pointer-events: none; }
.hero-blob { position: absolute; width: 288px; height: 288px; border-radius: 50%; filter: blur(48px); }
.hero-blob-1 { top: 80px; left: 40px; background: var(--primary); animation: blob 7s infinite; }
.hero-blob-2 { top: 160px; right: 40px; background: var(--secondary); animation: blob 7s infinite 2s; }
.hero-blob-3 { bottom: -80px; left: 50%; background: var(--accent); animation: blob3 7s infinite 4s; }
@keyframes blob {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes blob3 {
  0% { transform: translateX(-50%) translate(0, 0) scale(1); }
  33% { transform: translateX(-50%) translate(30px, -50px) scale(1.1); }
  66% { transform: translateX(-50%) translate(-20px, 20px) scale(0.9); }
  100% { transform: translateX(-50%) translate(0, 0) scale(1); }
}

.hero-wrap { position: relative; z-index: 10; width: 100%; padding: 80px 0; text-align: center; }
.hero-inner { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
.hero-text { margin-bottom: 40px; animation: fadeInUp 0.8s ease-out; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-title { margin: 0 0 8px; font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 800; line-height: 1.1; color: var(--text); }
.hero-title-gradient { display: block; margin-top: 8px; background: var(--grad); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradientShift 3s ease infinite; }
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-desc { max-width: 768px; margin: 16px auto 0; font-size: clamp(1rem, 2.5vw, 1.25rem); line-height: 1.6; opacity: 0.7; color: var(--text); }
.hero-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; opacity: 0.6; }
.hero-badge { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.hero-badge svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--success); }

/* ===== 搜索卡片（静态展示） ===== */
.search-card { padding: 24px 40px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: box-shadow 0.3s ease; animation: slideUp 0.8s ease-out 0.2s both; }
.search-card:hover { box-shadow: var(--shadow-lg-hover); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-row { display: flex; align-items: stretch; gap: 12px; }
.search-input-wrap { position: relative; flex: 1; }
.search-input, .search-select { height: 56px; font: inherit; font-size: 16px; color: var(--text); background-color: var(--input-bg); border: 1px solid var(--border-strong); border-radius: var(--radius); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.search-input { width: 100%; padding: 0 48px 0 16px; }
.search-input::placeholder { color: var(--text-faint); opacity: 1; }
.search-input:focus, .search-select:focus { border-color: var(--primary); box-shadow: var(--focus-ring); transform: scale(1.01); }
.search-input-icon { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); opacity: 0.4; color: var(--text); pointer-events: none; transition: opacity 0.2s ease; }
.search-input-wrap:focus-within .search-input-icon { opacity: 0.7; }
.search-input-icon svg { display: block; width: 24px; height: 24px; }
.search-select { width: 210px; padding: 0 36px 0 16px; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search-btn { flex-shrink: 0; width: 160px; height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius); background: var(--primary); color: var(--primary-text); font: inherit; font-size: 16px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.search-btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px var(--primary-ring); }
.search-btn:active { transform: scale(0.95); }
.search-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.search-btn svg { width: 20px; height: 20px; }
.search-input.is-empty { outline: 2px solid var(--danger); }

/* 加载中：按钮里放大镜换成转圈（M6a.1） */
.search-btn-spinner { display: none; animation: spin 0.8s linear infinite; }
.search-btn.is-loading .search-btn-icon, .search-btn.is-loading .search-btn-text { display: none; }
.search-btn.is-loading .search-btn-spinner { display: block; }
.search-btn:disabled { cursor: wait; opacity: 0.85; transform: none; box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.search-unavailable { margin: 0; padding: 12px 0; text-align: center; color: var(--text-muted); }
#home-search-result:empty { display: none; }
#home-search-result .search-result { animation: fadeInUp 0.4s ease-out both; }

/* 搜索结果提示条（对齐旧版：文字继承居中；图标继承正文色；颜色在明暗主题下相同） */
.search-result { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-top: 16px; padding: 16px 20px; border: 1px solid; border-radius: 12px; }
.search-result.is-success { background: rgba(54, 211, 153, 0.12); border-color: rgba(54, 211, 153, 0.4); }
.search-result.is-warning { background: rgba(251, 189, 35, 0.12); border-color: rgba(251, 189, 35, 0.4); }
.sr-icon { flex-shrink: 0; color: var(--text); }
.sr-icon svg { display: block; width: 28px; height: 28px; }
.sr-body { flex: 1; min-width: 0; }
.sr-title { display: block; margin-bottom: 4px; font-size: 16px; font-weight: 700; color: var(--text); }
.sr-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.sr-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.sr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.sr-btn:hover { transform: scale(1.03); }
.sr-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.sr-btn-success { background: #36d399; color: #fff; }
.sr-btn-success:hover { background: #2bb87f; color: #fff; }
.sr-btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.sr-btn-outline:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 640px) {
  .search-result { flex-wrap: nowrap; align-items: center; }
  .sr-actions { flex-direction: row; width: auto; margin-top: 0; }
}

@media (max-width: 768px) {
  .search-row { flex-direction: column; }
  .search-select, .search-btn { width: 100%; }
}
@media (max-width: 640px) { .search-card { padding: 20px 16px 24px; } }

/* ===== 分区通用 ===== */
.section { width: 100%; padding: 80px 0; }
.section-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.section-header { margin-bottom: 64px; text-align: center; }
.section-title { margin: 0 0 16px; font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; color: var(--text); }
.section-subtitle { max-width: 512px; margin: 0 auto; font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.5; opacity: 0.6; color: var(--text); }

/* ===== 特性卡 ===== */
.features { background: var(--bg); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 1024px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; gap: 24px; } }
.feature-card { display: flex; flex-direction: column; align-items: center; padding: 32px 24px; text-align: center; background: var(--tint-faint); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: box-shadow 0.3s ease, transform 0.3s ease; }
.feature-card:hover { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2); transform: scale(1.05); }
.feature-icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; margin-bottom: 16px; border-radius: 50%; transition: transform 0.3s ease; }
.feature-card:hover .feature-icon { transform: scale(1.1); }
.feature-icon svg { width: 40px; height: 40px; }
.feature-icon.is-primary { background: var(--primary-tint); color: var(--icon-primary); }
.feature-icon.is-secondary { background: var(--secondary-tint); color: var(--icon-secondary); }
.feature-icon.is-accent { background: var(--accent-tint); color: var(--icon-accent); }
.feature-name { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.feature-desc { margin: 0; font-size: 14px; line-height: 1.6; opacity: 0.7; color: var(--text); }

/* ===== 统计 ===== */
.stats { background: var(--tint-faint); }
.stats-box { display: flex; flex-direction: row; width: 100%; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15); }
.stat-item { position: relative; flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 24px 32px; border-right: 1px solid var(--border); transition: background 0.3s ease; }
.stat-item:last-child { border-right: 0; }
.stat-item:hover { background: var(--surface-2); }
.stat-figure { position: absolute; top: 24px; right: 24px; }
.stat-figure svg { display: block; width: 40px; height: 40px; }
.stat-label { margin: 0; font-size: 1rem; color: var(--text-muted); }
.stat-value { margin: 4px 0; font-size: clamp(2.5rem, 5vw, 3rem); font-weight: 700; line-height: 1; }
.stat-note { margin: 0; font-size: 0.875rem; opacity: 0.6; color: var(--text); }
.is-primary { color: var(--primary); }
.is-secondary { color: var(--secondary); }
.is-accent { color: var(--accent); }
@media (max-width: 1024px) {
  .stats-box { flex-direction: column; }
  .stat-item { border-right: 0; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: 0; }
}

/* ===== CTA ===== */
.cta { position: relative; overflow: hidden; background: var(--grad); }
.cta-blobs { position: absolute; inset: 0; opacity: 0.1; pointer-events: none; }
.cta-blob { position: absolute; width: 384px; height: 384px; border-radius: 50%; background: #fff; filter: blur(48px); }
.cta-blob-1 { top: 0; left: 0; animation: blob 7s infinite; }
.cta-blob-2 { right: 0; bottom: 0; animation: blob 7s infinite 2s; }
.cta-inner { position: relative; z-index: 10; max-width: 768px; margin: 0 auto; padding: 0 16px; text-align: center; }
.cta-title { margin: 0 0 24px; font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 700; color: #fff; }
.cta-desc { max-width: 512px; margin: 0 auto 40px; font-size: clamp(1rem, 2.5vw, 1.25rem); color: rgba(255, 255, 255, 0.9); }
.cta-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius); font-size: 16px; text-decoration: none; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease; }
.cta-btn:hover { transform: scale(1.05); text-decoration: none; }
.cta-btn-white { border: 0; background: #fff; color: #570df8; font-weight: 700; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.cta-btn-white:hover { background: #f3f4f6; color: #570df8; }
.cta-btn-white svg { width: 24px; height: 24px; }
.cta-btn-outline { border: 2px solid rgba(255, 255, 255, 0.8); background: transparent; color: #fff; font-weight: 600; }
.cta-btn-outline:hover { background: #fff; color: #570df8; }
