/* wangdw.xyz personal portal — shared Apple-inspired chrome */
:root {
  --portal-bg: #f5f5f7;
  --portal-fg: #1d1d1f;
  --portal-muted: #6e6e73;
  --portal-card: #ffffff;
  --portal-radius: 28px;
  --portal-radius-sm: 20px;
  --learn: #0071e3;
  --life: #00a86b;
  --work: #bf4800;
  --flywheel: #1d1d1f;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
  background: var(--portal-bg);
  color: var(--portal-fg);
  line-height: 1.47;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid rgba(0,113,227,.45); outline-offset: 3px; border-radius: 12px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(245,245,247,.72);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding-top: var(--safe-t);
}
.topbar__inner {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 22px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #0071e3, #00c7be);
}
.nav-links {
  display: flex; gap: 4px; flex: 1; justify-content: center;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 8px 14px; border-radius: 980px;
  font-size: 14px; font-weight: 500; color: var(--portal-muted);
  white-space: nowrap; min-height: 36px;
  display: inline-flex; align-items: center;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--portal-fg); background: rgba(0,0,0,.04); }
.nav-links a.is-active { color: var(--portal-fg); background: rgba(0,0,0,.06); font-weight: 600; }
.topbar__ds {
  font-size: 13px; font-weight: 500; color: var(--learn);
  white-space: nowrap; padding: 8px 4px; min-height: 36px;
  display: inline-flex; align-items: center;
}
.topbar__ds:hover { text-decoration: underline; }

.cat-hero {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(40px, 8vw, 72px) 22px clamp(28px, 4vw, 40px);
}
.cat-hero__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 500; color: var(--learn);
  min-height: 44px; margin-bottom: 20px;
}
.cat-hero__back:hover { text-decoration: underline; }
.cat-hero__eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 12px;
}
.cat-hero__title {
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.05;
  margin-bottom: 14px;
}
.cat-hero__lead {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--portal-muted); max-width: 32em; letter-spacing: -.01em;
}
.cat-learn .cat-hero__eyebrow { color: var(--learn); }
.cat-life .cat-hero__eyebrow { color: var(--life); }
.cat-work .cat-hero__eyebrow { color: var(--work); }
.cat-flywheel .cat-hero__eyebrow { color: var(--portal-muted); }

.list {
  max-width: 1080px; margin: 0 auto;
  padding: 0 22px clamp(56px, 8vw, 88px);
  display: flex; flex-direction: column; gap: 14px;
}
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--portal-card);
  border-radius: var(--portal-radius-sm);
  padding: clamp(22px, 3vw, 28px) clamp(22px, 3vw, 32px);
  box-shadow: 0 2px 8px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.05);
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
  min-height: 88px;
}
.item:hover, .item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.08);
}
.item:active { transform: translateY(0); }
.item__text { flex: 1; min-width: 0; }
.item__name {
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.25;
  margin-bottom: 6px;
}
.item__desc {
  font-size: 15px; color: var(--portal-muted); letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.item__go {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; min-height: 44px; padding: 10px 18px;
  border-radius: 980px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: var(--accent, var(--learn));
}
.cat-learn .item__go { background: var(--learn); }
.cat-life .item__go { background: var(--life); }
.cat-work .item__go { background: var(--work); }
.cat-flywheel .item__go { background: var(--flywheel); }

.pans {
  max-width: 1080px; margin: 0 auto 28px;
  padding: 0 22px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (max-width: 720px) {
  .pans { grid-template-columns: 1fr; }
  .nav-links { justify-content: flex-start; }
  .item { flex-direction: column; align-items: flex-start; }
  .item__go { align-self: stretch; text-align: center; }
}
.pan {
  position: relative; overflow: hidden;
  border-radius: var(--portal-radius-sm);
  min-height: 180px;
  padding: 26px 24px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--portal-card);
  box-shadow: 0 2px 8px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.05);
  transition: transform .3s, box-shadow .3s;
}
.pan:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.08); }
.pan__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(100% 80% at 100% 0%, var(--glow) 0%, transparent 55%);
}
.pan--a { --glow: rgba(59,130,246,.2); --accent: #3b82f6; }
.pan--b { --glow: rgba(13,148,136,.2); --accent: #0d9488; }
.pan--c { --glow: rgba(217,119,6,.18); --accent: #d97706; }
.pan--d { --glow: rgba(220,38,38,.16); --accent: #dc2626; }
.pan__tag {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.pan__q {
  position: relative; z-index: 1;
  font-size: clamp(18px, 2.5vw, 22px); font-weight: 700;
  letter-spacing: -.02em; margin-bottom: 6px;
}
.pan__role {
  position: relative; z-index: 1;
  font-size: 14px; color: var(--portal-muted); margin-bottom: 12px;
}
.pan__subs {
  position: relative; z-index: 1;
  font-size: 13px; color: var(--portal-muted); margin-top: 8px;
}
.pan__subs a { color: var(--accent); font-weight: 500; }
.pan__subs a:hover { text-decoration: underline; }
.pan__cta {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px; min-height: 44px;
  font-size: 15px; font-weight: 600; color: var(--accent);
}
.pan__cta:hover { text-decoration: underline; }
.pan__cta::after { content: "→"; }

.section-label {
  max-width: 1080px; margin: 8px auto 14px;
  padding: 0 22px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--portal-muted);
}

.archive {
  max-width: 1080px; margin: 8px auto 0;
  padding: 0 22px clamp(56px, 8vw, 88px);
}
.archive details {
  background: var(--portal-card);
  border-radius: var(--portal-radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
}
.archive summary {
  cursor: pointer; list-style: none;
  padding: 22px 28px; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.archive summary::-webkit-details-marker { display: none; }
.archive summary .meta { font-size: 13px; font-weight: 500; color: var(--portal-muted); }
.archive .archive-body { padding: 0 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.archive .item { box-shadow: none; border: 1px solid rgba(0,0,0,.06); min-height: 72px; }


/* Category hero banner imagery */
.cat-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--portal-radius) var(--portal-radius);
  margin-bottom: 8px;
}
.cat-hero__banner {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .28;
  pointer-events: none;
}
.cat-learn .cat-hero__banner { background-image: url('/assets/portal/learn.jpg'); }
.cat-life .cat-hero__banner { background-image: url('/assets/portal/life.jpg'); }
.cat-work .cat-hero__banner { background-image: url('/assets/portal/work.jpg'); }
.cat-flywheel .cat-hero__banner { background-image: url('/assets/portal/flywheel.jpg'); }
.cat-hero > * { position: relative; z-index: 1; }

.footer {
  text-align: center;
  padding: 32px 22px calc(40px + var(--safe-b));
  font-size: 13px; color: var(--portal-muted);
}
.footer a { color: var(--learn); font-weight: 500; }
.footer a:hover { text-decoration: underline; }

/* Featured list card (e.g. novella) */
.item--feature {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-height: 160px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(0,168,107,.08), rgba(191,72,0,.06)),
    var(--portal-card);
}
.item--feature .item__banner {
  display: block;
  height: 120px;
  background:
    linear-gradient(120deg, rgba(28,25,23,.55), rgba(28,25,23,.15)),
    url("https://images.unsplash.com/photo-1508804185872-d7aad8140a9a?auto=format&fit=crop&w=1200&q=70") center/cover no-repeat;
}
.item--feature .item__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 3vw, 28px) 22px;
}
.item--feature .item__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--life);
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .item--feature .item__body { flex-direction: column; align-items: stretch; }
  .item--feature .item__go { align-self: stretch; text-align: center; }
}


/* Grouped list block (e.g. 诗经 under 生活) */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,.55);
  border-radius: var(--portal-radius-sm);
  padding: 14px 14px 14px;
  border: 1px solid rgba(0,0,0,.04);
}
.list-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px 6px;
}
.list-group__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--portal-fg);
}
.list-group__title:hover { text-decoration: underline; }
.list-group__more {
  font-size: 13px;
  font-weight: 500;
  color: var(--life);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.list-group__more:hover { text-decoration: underline; }
.list-group .item {
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  min-height: 76px;
}
.cat-learn .list-group__more { color: var(--learn); }
.cat-life .list-group__more { color: var(--life); }
.cat-work .list-group__more { color: var(--work); }
