/* ══════════════════════════════════════════════════════════════
   悦舍堂官网 · 公共样式（配合 site.js）
   只放两个组件：右上角「马上下载」下拉、下载页「为你推荐」卡片。
   页面自身的样式仍在各 HTML 的 <style> 里，不要往这里塞。

   依赖的设计令牌（各页面 :root 已定义）：
   --primary --ink --charcoal --slate --steel --muted
   --canvas --surface --hairline --hairline-soft
   --brand-green --brand-green-deep --brand-green-soft
   --radius-md --radius-lg --radius-xl
   --shadow-card --shadow-mockup --shadow-subtle
   ══════════════════════════════════════════════════════════════ */

/* ─────────────── 右上角「马上下载」下拉 ─────────────── */
.nav-dl { position: relative; }

.nav-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  padding: 10px 18px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  background: var(--primary);
  color: var(--on-primary);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.nav-dl-btn:hover { background: var(--charcoal); box-shadow: var(--shadow-card); }
.nav-dl-btn:active { transform: translateY(1px); }

.nav-dl-caret {
  font-size: 10px;
  line-height: 1;
  opacity: .75;
  transition: transform .18s ease;
}
.nav-dl.open .nav-dl-caret { transform: rotate(180deg); }

.nav-dl-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 330px;
  max-width: calc(100vw - 32px);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-mockup);
  padding: 8px;
  z-index: 200;

  /* 默认收起：用 visibility 而不是 display，才能做过渡且不影响无障碍焦点 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-dl.open .nav-dl-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* 有 hover 能力的设备（桌面）额外支持悬停展开 */
@media (hover: hover) and (pointer: fine) {
  .nav-dl:hover .nav-dl-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.nav-dl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.nav-dl-head .nav-dl-os {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-align: right;
  line-height: 1.3;
}

.nav-dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  transition: background .14s ease;
}
.nav-dl-item:hover { background: var(--surface); }

/* 系统检测命中的那一档：淡绿底 + 左侧绿条，一眼能看到「推荐」 */
.nav-dl-item.is-rec {
  background: var(--brand-green-soft);
}
.nav-dl-item.is-rec:hover { background: rgba(0, 212, 164, 0.2); }

.nav-dl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-dl-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.nav-dl-badge {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 9999px;
  background: var(--brand-green);
  color: var(--primary);
}
.nav-dl-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dl-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-dl-meta {
  font-size: 11px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}
.nav-dl-ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.nav-dl-item.is-rec .nav-dl-ico {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: var(--primary);
}

.nav-dl-all {
  display: block;
  margin-top: 4px;
  padding: 10px 12px 6px;
  border-top: 1px solid var(--hairline-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-green-deep);
}
.nav-dl-all:hover { color: var(--brand-green); }

/* ─────────────── 下载页「为你推荐」卡片 ─────────────── */
.reco {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid rgba(0, 212, 164, 0.35);
  background: linear-gradient(180deg, rgba(0, 212, 164, 0.07), rgba(0, 212, 164, 0.02));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-featured, rgba(0, 212, 164, 0.08) 0px 8px 24px);
}
.reco-ico {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.reco-body { flex: 1; min-width: 0; }
.reco-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--brand-green-deep);
  background: var(--canvas);
  border: 1px solid rgba(0, 212, 164, 0.3);
  padding: 3px 9px;
  border-radius: 9999px;
  margin-bottom: 8px;
}
.reco-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.2px;
  color: var(--ink);
}
.reco-desc {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}
.reco-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.reco-alt {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.reco-alt a {
  color: var(--brand-green-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 0 2px;
}

/* 被推荐的那张下载卡加一圈绿边 + 「你的系统」角标 */
.dl-card.is-rec {
  border-color: rgba(0, 212, 164, 0.5);
  box-shadow: var(--shadow-featured, rgba(0, 212, 164, 0.08) 0px 8px 24px);
}
.dl-card-flag {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 9999px;
  background: var(--brand-green);
  color: var(--primary);
}
.dl-card { position: relative; }

@media (max-width: 780px) {
  .reco { flex-direction: column; align-items: stretch; text-align: left; }
  .reco-actions { flex-wrap: wrap; }
  .nav-dl-menu { width: 300px; }
}
