/* ==========================================================================
   沪上打工人 · 首页视觉系统 v3
   深色咖啡馆风格：咖啡黑底、焦糖金强调、奶油白文字
   零外部依赖 —— 全部图片为本地资源
   ========================================================================== */

:root {
  /* 底色：深炭灰 → 咖啡黑 */
  --h-bg: #12100e;
  --h-bg-2: #1a1613;
  --h-bg-3: #241e19;

  /* 主色：焦糖棕 / 暖琥珀 */
  --h-caramel: #d9a05b;
  --h-caramel-lt: #f0c088;
  --h-caramel-dk: #b87f3f;

  /* 辅助：奶油白 / 浅咖啡 */
  --h-cream: #f5ece0;
  --h-cream-2: #d9cbb8;
  --h-coffee: #9d8570;
  --h-muted: #7a6a5c;

  /* 卡片与描边 */
  --h-card: #1e1915;
  --h-card-2: #262019;
  --h-line: rgba(217, 160, 91, 0.16);
  --h-line-lt: rgba(217, 160, 91, 0.34);

  /* 情绪标签色 */
  --h-rose: #d97f6b;
  --h-teal: #5eb5a6;
  --h-violet: #9b8bd0;

  --h-r-lg: 22px;
  --h-r-md: 15px;
  --h-r-sm: 10px;

  --h-maxw: 1160px;
  --h-pad: 24px;

  --h-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--h-bg);
  color: var(--h-cream);
}

body.h-home {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* 背景质感：极淡的暖光晕，避免纯色死板 */
body.h-home::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(217, 160, 91, 0.10), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(155, 139, 208, 0.07), transparent 60%);
}

.h-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--h-maxw);
  margin: 0 auto;
  padding: 0 var(--h-pad);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ==========================================================================
   1. 顶部导航
   ========================================================================== */

.h-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 16, 14, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--h-line);
}

.h-nav-inner {
  max-width: var(--h-maxw);
  margin: 0 auto;
  padding: 13px var(--h-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.h-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--h-cream);
  white-space: nowrap;
}

.h-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--h-line-lt);
  flex: none;
}

.h-brand-emoji { font-size: 19px; line-height: 1; }

.h-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.h-nav-links a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--h-cream-2);
  transition: color 0.22s var(--h-ease), background-color 0.22s var(--h-ease);
}

.h-nav-links a:hover {
  color: var(--h-cream);
  background: rgba(217, 160, 91, 0.12);
}

.h-nav-links a:active { transform: translateY(1px); }

/* ==========================================================================
   2. 首屏主视觉
   ========================================================================== */

.h-hero {
  position: relative;
  margin: 20px auto 0;
  border-radius: var(--h-r-lg);
  overflow: hidden;
  border: 1px solid var(--h-line);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  isolation: isolate;
}

.h-hero-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--h-bg-3);
  overflow: hidden;
}

.h-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  /* 进入页面时缓慢淡入 */
  opacity: 0;
  transform: scale(1.015);
  animation: hFadeIn 1.15s var(--h-ease) 0.08s forwards;
  transition: transform 0.7s var(--h-ease);
}

/* 悬停时图片轻微放大 1.03 */
.h-hero:hover .h-hero-media img { transform: scale(1.03); }

/* 暗色渐变遮罩，保证标题清晰。
   下半部分压得比较实（文字压在上面），上半部分只做轻度压暗，保留木桌纹理。 */
.h-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 8, 7, 0.97) 0%, rgba(10, 8, 7, 0.86) 26%,
                            rgba(10, 8, 7, 0.46) 52%, rgba(10, 8, 7, 0.22) 100%),
    linear-gradient(to right, rgba(10, 8, 7, 0.52) 0%, rgba(10, 8, 7, 0.06) 52%);
  pointer-events: none;
}

@keyframes hFadeIn {
  from { opacity: 0; transform: scale(1.015); }
  to   { opacity: 1; transform: scale(1); }
}

.h-hero-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(24px, 4.2vw, 52px);
}

.h-hero-kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--h-line-lt);
  background: rgba(217, 160, 91, 0.13);
  color: var(--h-caramel-lt);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.h-hero-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 5.4vw, 58px);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
  text-wrap: balance;
}

.h-hero-sub {
  margin: 0 0 24px;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--h-cream-2);
  max-width: 30em;
}

/* 主按钮：全站最醒目的元素 */
.h-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 30px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--h-caramel-lt), var(--h-caramel));
  color: #241a0e;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(217, 160, 91, 0.75);
  transition: background-color 0.22s var(--h-ease), transform 0.22s var(--h-ease),
              box-shadow 0.22s var(--h-ease), filter 0.22s var(--h-ease);
}

.h-btn-primary:hover {
  filter: brightness(1.09);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(217, 160, 91, 0.85);
}

.h-btn-primary:active { transform: translateY(0); filter: brightness(0.97); }

.h-btn-primary:focus-visible {
  outline: 2px solid var(--h-caramel-lt);
  outline-offset: 3px;
}

/* 按钮旁边的次要说明 */
.h-hero-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--h-muted);
}

/* ==========================================================================
   3. 通用区块
   ========================================================================== */

.h-section {
  margin: clamp(52px, 7vw, 84px) 0 0;
}

.h-sec-head { margin-bottom: 26px; }

.h-sec-kicker {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--h-caramel);
  text-transform: uppercase;
}

.h-sec-title {
  margin: 0 0 8px;
  font-size: clamp(23px, 3.3vw, 36px);
  line-height: 1.24;
  font-weight: 800;
  letter-spacing: -0.012em;
  color: var(--h-cream);
  text-wrap: balance;
}

.h-sec-sub {
  margin: 0;
  font-size: 15.5px;
  color: var(--h-coffee);
}

/* 滚动淡入 */
.h-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--h-ease), transform 0.7s var(--h-ease);
}

.h-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   4. 今日咖啡 / 今日怨气（两个并列视觉入口）
   ========================================================================== */

.h-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.h-duo-card {
  position: relative;
  display: block;
  min-height: 330px;
  border-radius: var(--h-r-lg);
  overflow: hidden;
  border: 1px solid var(--h-line);
  background: var(--h-card);
  box-shadow: 0 16px 40px -26px rgba(0, 0, 0, 0.9);
  transition: border-color 0.35s var(--h-ease), transform 0.35s var(--h-ease),
              box-shadow 0.35s var(--h-ease);
}

.h-duo-card:hover {
  border-color: var(--h-line-lt);
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.95);
}

.h-duo-media {
  position: absolute;
  inset: 0;
  background: var(--h-bg-3);
}

.h-duo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--h-ease);
}

/* 悬停时图片缓慢放大 */
.h-duo-card:hover .h-duo-media img { transform: scale(1.05); }

.h-duo-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 10, 9, 0.95) 0%, rgba(12, 10, 9, 0.52) 42%,
                            rgba(12, 10, 9, 0.10) 78%);
}

.h-duo-body {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.h-duo-tag {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(217, 160, 91, 0.18);
  border: 1px solid var(--h-line-lt);
  color: var(--h-caramel-lt);
}

.h-duo-title {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 800;
  color: #fff;
  line-height: 1.28;
}

.h-duo-desc {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--h-cream-2);
}

.h-duo-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--h-line-lt);
  background: rgba(30, 25, 21, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--h-cream);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.22s var(--h-ease), transform 0.22s var(--h-ease),
              border-color 0.22s var(--h-ease);
}

.h-duo-card:hover .h-duo-go {
  background: var(--h-caramel);
  border-color: var(--h-caramel);
  color: #241a0e;
  transform: translateY(-2px);
}

.h-duo-go:active { transform: translateY(0); }

/* ==========================================================================
   5. 今日职场情绪（横向滚动标签）
   ========================================================================== */

.h-mood-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--h-line-lt) transparent;
}

.h-mood-rail::-webkit-scrollbar { height: 5px; }
.h-mood-rail::-webkit-scrollbar-track { background: transparent; }
.h-mood-rail::-webkit-scrollbar-thumb {
  background: var(--h-line-lt);
  border-radius: 999px;
}

.h-mood {
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--h-line);
  background: var(--h-card);
  color: var(--h-cream-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.22s var(--h-ease), color 0.22s var(--h-ease),
              border-color 0.22s var(--h-ease), transform 0.22s var(--h-ease);
}

.h-mood:hover {
  border-color: var(--h-line-lt);
  color: var(--h-cream);
  transform: translateY(-2px);
}

.h-mood:active { transform: translateY(0); }

/* 明确的选中状态 */
.h-mood.is-active {
  background: var(--h-caramel);
  border-color: var(--h-caramel);
  color: #241a0e;
}

.h-mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--h-caramel);
  transition: background-color 0.22s var(--h-ease);
}

.h-mood.is-active .h-mood-dot { background: #241a0e; }

.h-mood[data-mood="work"] .h-mood-dot { background: var(--h-rose); }
.h-mood[data-mood="money"] .h-mood-dot { background: var(--h-caramel); }
.h-mood[data-mood="life"] .h-mood-dot { background: var(--h-teal); }
.h-mood[data-mood="coffee"] .h-mood-dot { background: var(--h-violet); }

.h-mood.is-active[data-mood="work"] .h-mood-dot,
.h-mood.is-active[data-mood="money"] .h-mood-dot,
.h-mood.is-active[data-mood="life"] .h-mood-dot,
.h-mood.is-active[data-mood="coffee"] .h-mood-dot { background: #241a0e; }

/* 选中后显示的提示条 */
.h-mood-hint {
  margin-top: 12px;
  padding: 13px 17px;
  border-radius: var(--h-r-md);
  border: 1px dashed var(--h-line-lt);
  background: rgba(217, 160, 91, 0.06);
  font-size: 14px;
  color: var(--h-cream-2);
  min-height: 48px;
}

.h-mood-hint b { color: var(--h-caramel-lt); }

/* ==========================================================================
   6. 热门动态（图片优先卡片流）
   ========================================================================== */

.h-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.h-feed-card {
  position: relative;
  display: block;
  border-radius: var(--h-r-md);
  overflow: hidden;
  border: 1px solid var(--h-line);
  background: var(--h-card);
  box-shadow: 0 12px 30px -22px rgba(0, 0, 0, 0.85);
  transition: border-color 0.35s var(--h-ease), transform 0.35s var(--h-ease),
              box-shadow 0.35s var(--h-ease);
}

.h-feed-card:hover {
  border-color: var(--h-line-lt);
  transform: translateY(-3px);
  box-shadow: 0 20px 42px -24px rgba(0, 0, 0, 0.95);
}

.h-feed-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--h-bg-3);
  overflow: hidden;
}

.h-feed-media img {
  width: 100%;
  height: 100%;
  /* 完整显示主体，不裁掉咖啡杯 */
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s var(--h-ease);
}

.h-feed-card:hover .h-feed-media img { transform: scale(1.05); }

.h-feed-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--h-line-lt);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--h-caramel-lt);
}

.h-feed-body { padding: 14px 15px 16px; }

.h-feed-text {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--h-cream);
}

.h-feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.h-feed-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(217, 160, 91, 0.14);
  color: var(--h-caramel-lt);
}

.h-feed-time {
  font-size: 12px;
  color: var(--h-muted);
}

/* 未开放状态：明确说明是入口，不冒充真实用户内容 */
.h-feed-soon {
  grid-column: 1 / -1;
  padding: 26px 24px;
  border-radius: var(--h-r-md);
  border: 1px dashed var(--h-line-lt);
  background: rgba(217, 160, 91, 0.055);
  text-align: center;
}

.h-feed-soon p { margin: 0 0 6px; color: var(--h-cream-2); font-size: 14.5px; }
.h-feed-soon .fine { color: var(--h-muted); font-size: 13px; }

/* ==========================================================================
   7. 页脚
   ========================================================================== */

.h-foot {
  margin-top: clamp(60px, 8vw, 96px);
  padding: 26px 0 40px;
  border-top: 1px solid var(--h-line);
}

.h-foot-inner {
  max-width: var(--h-maxw);
  margin: 0 auto;
  padding: 0 var(--h-pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--h-muted);
}

.h-foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.h-foot a { color: var(--h-coffee); transition: color 0.2s var(--h-ease); }
.h-foot a:hover { color: var(--h-caramel-lt); }

/* ==========================================================================
   8. 响应式
   ========================================================================== */

@media (max-width: 900px) {
  .h-feed { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --h-pad: 18px; }

  .h-hero { margin-top: 14px; border-radius: 18px; }

  /* 窄屏改成竖向裁切 */
  .h-hero-media { aspect-ratio: 4 / 5; }
  /* 竖裁时把咖啡杯留在画面上半部分，给下方标题留出干净的暗色区域 */
  .h-hero-media img { object-position: 42% 34%; }

  .h-duo {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .h-duo-card,
  .h-duo-body { min-height: 260px; }

  /* 窄屏收紧主视觉内边距 */
  .h-hero-body { padding: 22px 20px 26px; }

  .h-feed { grid-template-columns: 1fr; }

  .h-btn-primary {
    /* 用 max-width 而不是 width:100% —— 后者按内容盒计算，
       加上 .h-hero-body 的 padding 会横向溢出屏幕 */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    padding: 16px 20px;
    font-size: 16.5px;
  }

  .h-nav-inner { padding: 11px var(--h-pad); }
  .h-brand { font-size: 15.5px; }
  .h-brand-mark { width: 27px; height: 27px; }
  .h-nav-links a { padding: 6px 10px; font-size: 13.5px; }
}

@media (max-width: 380px) {
  .h-nav-links a { padding: 6px 8px; font-size: 13px; }
  .h-brand-emoji { display: none; }
}

/* 关闭不必要的悬停效果（触屏设备） */
@media (hover: none) {
  .h-hero:hover .h-hero-media img { transform: scale(1); }
  .h-duo-card:hover .h-duo-media img { transform: none; }
  .h-feed-card:hover .h-feed-media img { transform: none; }
  .h-duo-card:hover,
  .h-feed-card:hover,
  .h-btn-primary:hover,
  .h-mood:hover { transform: none; }
  .h-btn-primary:active { transform: translateY(1px); filter: brightness(0.97); }
  .h-duo-card:active .h-duo-media img,
  .h-feed-card:active .h-feed-media img { transform: scale(1.02); }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .h-hero-media img {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .h-reveal { opacity: 1; transform: none; }
  .h-hero:hover .h-hero-media img,
  .h-duo-card:hover .h-duo-media img,
  .h-feed-card:hover .h-feed-media img { transform: none; }
}
