/* ===========================================================
   hero.css — 首页首屏（Hero Section）像素级重构
   所有选择器以 .hero- 为前缀，仅作用于首屏，不污染二三屏
   ===== 首屏样式区域 START =====
   =========================================================== */

/* --- 全局环境 --- */
.hero-app {
  position: relative;
  overflow: hidden;
  background: var(--bg-hero);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
}
.hero-app::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 156px;
  z-index: 1;
  pointer-events: none;
  background: var(--gradient-hero-after);
}
.hero-inner {
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================================================
   顶部导航
   =========================================================== */
.hero-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-header-hero, rgba(11,15,25,0.96));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-header);
}
.hero-header-inner {
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1;
}

.hero-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}
.hero-nav a {
  text-decoration: none;
  font-size: 15px;
  color: var(--text-nav);
  transition: color 0.2s ease;
}
.hero-nav a:hover { color: var(--accent); }

.hero-menu-btn {
  display: none;
  color: var(--text-primary);
  font-size: 21px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 46px;
  min-height: 46px;
}

@media (max-width: 768px) {
  .hero-nav { display: none; }
  .hero-menu-btn { display: flex; align-items: center; justify-content: center; }
}

/* ===========================================================
   移动端抽屉导航
   =========================================================== */
.hero-drawer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-overlay-hero);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.hero-drawer-overlay.active { opacity: 1; visibility: visible; }

.hero-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-hero);
  z-index: 2000;
  border-left: 1px solid var(--border-drawer);
  box-shadow: -4px 0 20px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.hero-drawer.active { transform: translateX(0); }

.hero-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 21px;
  border-bottom: 1px solid var(--border-header);
}
.hero-drawer-logo {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}
.hero-drawer-close {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-nav);
  font-size: 19px;
  cursor: pointer;
  transition: all 0.2s;
}
.hero-drawer-close:hover { background: rgba(59, 130, 246, 0.1); color: var(--accent); }

.hero-drawer-nav { flex: 1; padding: 8px 0; }
.hero-drawer-nav a {
  display: flex;
  align-items: center;
  padding: 15px 21px;
  font-size: 16px;
  color: var(--text-nav);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  min-height: 46px;
}
.hero-drawer-nav a:hover {
  background: var(--accent-bg-light);
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ===========================================================
   面包屑导航
   =========================================================== */
.hero-breadcrumb-area {
  padding-top: 87px;
}
.hero-breadcrumb {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 21px;
  line-height: 1;
}

/* ===========================================================
   搜索栏组件
   =========================================================== */
.hero-search-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  height: 56px;
  background: var(--bg-search);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.hero-search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--accent-shadow);
}

.hero-search-label {
  font-size: 14px;
  color: var(--text-nav);
  padding-left: 19px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-search-right {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.hero-search-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  padding: 0 40px 0 16px;
  min-height: 46px;
}
.hero-search-input::placeholder {
  color: var(--text-muted);
}

.hero-search-svg {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* ===========================================================
   搜索下拉结果面板
   =========================================================== */
.hero-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card-alt, #0f172a);
  border: 1px solid var(--border-card, #1e293b);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
  animation: heroDropdownFadeIn 0.15s ease;
}

@keyframes heroDropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-search-dropdown::-webkit-scrollbar {
  width: 5px;
}
.hero-search-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.hero-search-dropdown::-webkit-scrollbar-thumb {
  background: var(--border-light, #334155);
  border-radius: 3px;
}

.hero-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--text-primary, #f8fafc);
  transition: background 0.15s;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.hero-search-result:hover,
.hero-search-result.active {
  background: var(--accent-bg-light, rgba(59, 130, 246, 0.08));
  border-left-color: var(--accent, #3b82f6);
}

.hero-search-result-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent, #3b82f6);
  font-size: 14px;
}

.hero-search-result-name {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
}

.hero-search-result-desc {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-nav, #94a3b8);
}

.hero-search-result-cat {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-icon, rgba(59,130,246,0.12));
  color: var(--accent, #3b82f6);
  white-space: nowrap;
}

.hero-search-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-nav, #94a3b8);
}

/* ===========================================================
   核心功能区 Grid（4 Cards）
   =========================================================== */
.hero-core-functions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 21px;
  margin-top: 29px;
}

.hero-function-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 25px 21px;
  min-height: 156px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-card);
  border-radius: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.hero-function-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card-glow);
}

.hero-card-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.hero-card-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.3;
}

.hero-card-desc {
  font-size: 14px;
  color: var(--text-nav);
  line-height: 1.4;
  margin: 0;
}

/* ===========================================================
   快捷工具栏（Quick Access - Row 2）
   =========================================================== */
.hero-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 114px;
  margin-top: 29px;
  padding: 0 29px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-card);
  border-radius: 15px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-toolbar::-webkit-scrollbar { display: none; }

.hero-tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 100px;
  padding: 6px 4px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.hero-tool-item:hover {
  transform: translateY(-3px);
}

.hero-tool-icon-bg {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-icon);
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}
.hero-tool-item:hover .hero-tool-icon-bg {
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.hero-tool-icon {
  font-size: 20px;
  color: var(--accent);
}

.hero-tool-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1.3;
  text-align: center;
}

/* ===========================================================
   响应式适配
   =========================================================== */

/* 移动端 ≤768px */
@media (max-width: 768px) {
  .hero-inner { padding: 0 16px; }
  .hero-header-inner { padding: 0 16px; }

  .hero-breadcrumb-area { padding-top: 75px; }
  .hero-breadcrumb { font-size: 14px; margin-bottom: 17px; }

  .hero-search-bar { height: auto; min-height: 50px; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .hero-search-label { font-size: 12px; padding-left: 15px; width: 100%; flex-shrink: 0; }
  .hero-search-right { max-width: 100%; padding: 0 16px; }
  .hero-search-input { font-size: 14px; padding: 0 40px 0 14px; }
  .hero-search-dropdown {
    left: 16px;
    right: 16px;
    top: calc(100% + 4px);
    max-height: 320px;
  }
  .hero-search-result {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .hero-search-result-desc { display: none; }
  .hero-search-result-cat { font-size: 10px; padding: 1px 6px; }

  .hero-core-functions {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 21px;
  }
  .hero-function-card { min-height: 135px; padding: 21px 15px; }
  .hero-card-icon { width: 44px; height: 44px; margin-bottom: 10px; }
  .hero-card-title { font-size: 16px; }
  .hero-card-desc { font-size: 12px; }

  .hero-toolbar {
    height: 104px;
    padding: 0 16px;
    margin-top: 21px;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 12px;
  }
  .hero-tool-item { min-width: 76px; padding: 4px 2px; }
  .hero-tool-icon-bg { width: 40px; height: 40px; border-radius: 8px; }
  .hero-tool-icon { font-size: 17px; }
  .hero-tool-text { font-size: 12px; }
}

/* 平板端 769px-1023px */
@media (min-width: 769px) and (max-width: 1023px) {
  .hero-core-functions { grid-template-columns: repeat(2, 1fr); gap: 17px; }
  .hero-toolbar { gap: 6px; padding: 0 21px; }
}

/* ===========================================================
   ===== 首屏样式区域 END =====
   =========================================================== */
