/* 白日梦想家 Hi Daydream —— 全站共用：顶部总导航、底部「其他作品」、总览页和新写的软件页。
   设计照苹果官网：系统字体、大留白、浅灰分区；动效 0.25 秒慢进慢出，悬停 0.15 秒。 */
:root {
  --hd-bg: #fff;
  --hd-bg-alt: #f5f5f7;
  --hd-card: #fff;
  --hd-text: #1d1d1f;
  --hd-text-2: #6e6e73;
  --hd-line: rgba(0, 0, 0, .1);
  --hd-link: #0066cc;
  --hd-btn: #0071e3;
  --hd-btn-hover: #0077ed;
  --hd-nav-bg: rgba(250, 250, 252, .8);
  --hd-nav-text: rgba(0, 0, 0, .8);
  --hd-ease: cubic-bezier(.42, 0, .58, 1);
  --hd-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --hd-font-hant: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif;
  --hd-wrap: 980px;
  --hd-gnav-h: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hd-bg: #000;
    --hd-bg-alt: #101012;
    --hd-card: #1c1c1e;
    --hd-text: #f5f5f7;
    --hd-text-2: #a1a1a6;
    --hd-line: rgba(255, 255, 255, .14);
    --hd-link: #2997ff;
    --hd-btn: #0071e3;
    --hd-btn-hover: #0077ed;
    --hd-nav-bg: rgba(22, 22, 23, .8);
    --hd-nav-text: rgba(255, 255, 255, .8);
  }
}
:root[data-theme="dark"] {
  --hd-bg: #000; --hd-bg-alt: #101012; --hd-card: #1c1c1e; --hd-text: #f5f5f7; --hd-text-2: #a1a1a6;
  --hd-line: rgba(255, 255, 255, .14); --hd-link: #2997ff; --hd-nav-bg: rgba(22, 22, 23, .8); --hd-nav-text: rgba(255, 255, 255, .8);
}

/* ---------- 顶部总导航（所有页面都有，随页面滚走；各软件自己的导航在它下面吸顶） ---------- */
.hd-gnav {
  position: relative; z-index: 60;
  height: var(--hd-gnav-h);
  background: var(--hd-nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font: 400 12px/1 var(--hd-font); letter-spacing: -.01em;
  color: var(--hd-nav-text);
}
html.hd-host .hd-gnav { position: absolute; top: 0; left: 0; right: 0; }
html.hd-host body { padding-top: var(--hd-gnav-h) !important; }
.hd-gnav-in {
  max-width: var(--hd-wrap); height: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.hd-gnav a {
  color: inherit; text-decoration: none; opacity: .88; white-space: nowrap;
  padding: 0 8px; line-height: var(--hd-gnav-h);
  transition: opacity .15s var(--hd-ease);
}
.hd-gnav a:hover, .hd-gnav a[aria-current="page"] { opacity: 1; }
.hd-gnav a[aria-current="page"] { font-weight: 600; }
.hd-gnav .hd-brand { font-weight: 600; font-size: 13px; padding-left: 0; opacity: 1; }
.hd-gnav-links { display: flex; align-items: center; gap: 22px; }
.hd-lang {
  appearance: none; -webkit-appearance: none;
  font: inherit; color: inherit; opacity: .88; cursor: pointer;
  background: transparent; border: 0; padding: 0 14px 0 4px; height: 28px; border-radius: 6px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 6px) 13px, calc(100% - 2px) 13px; background-size: 4px 4px; background-repeat: no-repeat;
  transition: opacity .15s var(--hd-ease);
}
.hd-lang:hover { opacity: 1; }
.hd-lang option { color: #1d1d1f; background: #fff; }
.hd-gnav :focus-visible, .hd-more :focus-visible, .hd-page :focus-visible { outline: 2px solid var(--hd-link); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 640px) {
  .hd-gnav-in { padding: 0 12px; gap: 2px; }
  .hd-gnav-links { gap: 2px; }
  .hd-gnav a { padding: 0 6px; }
  .hd-lang { padding-right: 12px; max-width: 86px; }
}

/* ---------- 底部「其他作品」 ---------- */
.hd-more {
  background: var(--hd-bg-alt); color: var(--hd-text);
  font: 400 14px/1.5 var(--hd-font);
  padding: 56px 22px 28px;
  border-top: 1px solid var(--hd-line);
}
.hd-more-in { max-width: var(--hd-wrap); margin: 0 auto; }
.hd-more h2 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: .01em; margin: 0 0 20px; }
.hd-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.hd-more-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  background: var(--hd-card); border-radius: 18px; color: var(--hd-text); text-decoration: none;
  box-shadow: 0 0 0 1px var(--hd-line) inset;
  transition: transform .15s var(--hd-ease), box-shadow .15s var(--hd-ease);
}
.hd-more-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--hd-line) inset, 0 8px 24px rgba(0, 0, 0, .08); }
.hd-more-card img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.hd-more-card b { display: block; font-size: 17px; font-weight: 600; }
.hd-more-card span { display: block; color: var(--hd-text-2); font-size: 14px; }
.hd-more-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--hd-line);
  color: var(--hd-text-2); font-size: 12px;
}
.hd-more-foot a { color: inherit; text-decoration: none; margin-left: 20px; transition: color .15s var(--hd-ease); }
.hd-more-foot a:first-child { margin-left: 0; }
.hd-more-foot a:hover { color: var(--hd-text); }

/* ---------- 新写的页面（总览、Lightable） ---------- */
html.hd-page-root { background: var(--hd-bg); }
.hd-page { margin: 0; background: var(--hd-bg); color: var(--hd-text); font: 400 17px/1.47 var(--hd-font); letter-spacing: -.022em; -webkit-font-smoothing: antialiased; }
html[lang="zh-Hant"] .hd-page, html[lang="zh-Hant"] .hd-gnav, html[lang="zh-Hant"] .hd-more { font-family: var(--hd-font-hant); }
.hd-page a { text-decoration: none; }
.hd-swap a { color: var(--hd-link); }
.hd-swap a:hover { text-decoration: underline; }
.hd-page img { max-width: 100%; display: block; }
.hd-wrap { max-width: var(--hd-wrap); margin: 0 auto; padding: 0 22px; }
.hd-eyebrow { font-size: 17px; font-weight: 600; color: var(--hd-text-2); margin: 0 0 8px; letter-spacing: 0; }
.hd-h1 { font-size: 64px; line-height: 1.06; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.hd-h2 { font-size: 48px; line-height: 1.08; font-weight: 600; letter-spacing: -.003em; margin: 0; }
.hd-h3 { font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: .007em; margin: 0; }
.hd-lead { font-size: 21px; line-height: 1.38; color: var(--hd-text-2); margin: 16px 0 0; letter-spacing: .011em; }
.hd-badge { display: inline-block; font-size: 12px; font-weight: 600; color: #b64400; background: rgba(255, 149, 0, .14); padding: 3px 9px; border-radius: 99px; letter-spacing: 0; vertical-align: middle; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hd-badge { color: #ffb340; background: rgba(255, 159, 10, .16); } }

.hd-btn {
  display: inline-block; background: var(--hd-btn); color: #fff !important; text-decoration: none !important;
  font-size: 17px; line-height: 1.18; font-weight: 400; padding: 12px 22px; border-radius: 980px;
  transition: background-color .15s var(--hd-ease);
}
.hd-btn:hover { background: var(--hd-btn-hover); }
.hd-btn-sm { font-size: 12px; padding: 4px 11px; }
.hd-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 32px; margin-top: 20px; font-size: 19px; }
.hd-chev::after { content: ""; display: inline-block; width: .42em; height: .42em; margin-left: .3em; border: solid currentColor; border-width: .1em .1em 0 0; transform: translateY(-.08em) rotate(45deg); }

/* 总览页 */
.hd-hero { text-align: center; padding: 96px 0 72px; }
.hd-hero .hd-lead { max-width: 640px; margin-left: auto; margin-right: auto; }
.hd-tiles { display: grid; gap: 12px; padding: 0 12px 12px; }
.hd-tile {
  background: var(--hd-bg-alt); border-radius: 0; text-align: center;
  padding: 64px 22px 72px; overflow: hidden;
}
.hd-tile img.hd-icon { width: 128px; height: 128px; margin: 0 auto 24px; border-radius: 28px; }
.hd-tile .hd-h2 { margin-bottom: 8px; }
.hd-tile .hd-tag { font-size: 28px; line-height: 1.14; font-weight: 400; margin: 0; }
.hd-tile .hd-desc { color: var(--hd-text-2); max-width: 560px; margin: 14px auto 0; font-size: 17px; }
.hd-tile .hd-plat { color: var(--hd-text-2); font-size: 14px; margin-top: 10px; }
@media (min-width: 900px) {
  .hd-tiles { grid-template-columns: 1fr 1fr; }
  .hd-tile:first-child { grid-column: 1 / -1; }
}

/* 软件页：本地导航（吸顶） */
.hd-local {
  position: sticky; top: 0; z-index: 50;
  background: var(--hd-nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hd-line);
}
.hd-local-in { max-width: var(--hd-wrap); margin: 0 auto; padding: 0 22px; height: 52px; display: flex; align-items: center; gap: 20px; }
.hd-local-name { font-size: 21px; font-weight: 600; color: var(--hd-text) !important; text-decoration: none !important; margin-right: auto; letter-spacing: .011em; }
.hd-local-in > a:not(.hd-btn):not(.hd-local-name) { font-size: 12px; color: var(--hd-text) !important; opacity: .8; transition: opacity .15s var(--hd-ease); }
.hd-local-in > a:not(.hd-btn):not(.hd-local-name):hover { opacity: 1; text-decoration: none; }
@media (max-width: 640px) { .hd-local-in > a:not(.hd-btn):not(.hd-local-name) { display: none; } }

/* 软件页：首屏 */
.hd-phero { text-align: center; padding: 72px 0 48px; }
.hd-phero img.hd-icon { width: 120px; height: 120px; margin: 0 auto 28px; }
.hd-phero .hd-lead { max-width: 700px; margin-left: auto; margin-right: auto; }
.hd-phero .hd-cta { margin-top: 32px; }
.hd-phero .hd-meta { margin-top: 14px; font-size: 14px; color: var(--hd-text-2); }
.hd-shot { margin: 56px auto 0; max-width: 936px; }
.hd-shot img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 24px 60px rgba(0, 0, 0, .22); background: #0e0e0e; }
.hd-shot figcaption { margin-top: 16px; font-size: 14px; color: var(--hd-text-2); }

/* 软件页：功能分区 */
.hd-sec { padding: 96px 0; }
.hd-sec.alt { background: var(--hd-bg-alt); }
.hd-sec .hd-kicker { font-size: 17px; font-weight: 600; color: var(--hd-text-2); margin: 0 0 10px; letter-spacing: 0; }
.hd-sec .hd-h2 { max-width: 760px; }
.hd-sec .hd-body { font-size: 21px; line-height: 1.38; color: var(--hd-text-2); max-width: 680px; margin: 18px 0 0; letter-spacing: .011em; }
.hd-sec .hd-body b { color: var(--hd-text); font-weight: 600; }
.hd-stats { display: flex; flex-wrap: wrap; gap: 24px 72px; margin-top: 48px; }
.hd-stat b { display: block; font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: -.01em; color: var(--hd-text); }
.hd-stat span { display: block; font-size: 17px; color: var(--hd-text-2); margin-top: 8px; }
.hd-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 64px 48px; margin-top: 0; }
.hd-grid2 .hd-h3 { margin-bottom: 12px; }
.hd-grid2 p { color: var(--hd-text-2); margin: 0; }

.hd-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 48px; margin-top: 40px; }
.hd-key { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hd-line); }
.hd-key span { color: var(--hd-text); }
.hd-key kbd { font: 500 14px/1 var(--hd-font); color: var(--hd-text); background: var(--hd-card); border: 1px solid var(--hd-line); border-bottom-width: 2px; border-radius: 6px; padding: 5px 8px; white-space: nowrap; }

.hd-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px; margin-top: 40px; }
.hd-spec ul { list-style: none; padding: 0; margin: 0; }
.hd-spec li { padding: 12px 0; border-bottom: 1px solid var(--hd-line); }
.hd-spec h3 { font-size: 19px; font-weight: 600; margin: 0 0 10px; }
.hd-spec p { color: var(--hd-text-2); margin: 0; }
.hd-log { margin-top: 32px; padding: 24px 28px; background: var(--hd-card); border-radius: 18px; box-shadow: 0 0 0 1px var(--hd-line) inset; max-width: 680px; }
.hd-log b { font-size: 19px; }
.hd-log p { margin: 6px 0 0; color: var(--hd-text-2); }

@media (max-width: 734px) {
  .hd-h1 { font-size: 44px; }
  .hd-h2 { font-size: 34px; }
  .hd-h3 { font-size: 24px; }
  .hd-lead, .hd-sec .hd-body { font-size: 19px; }
  .hd-tile .hd-tag { font-size: 22px; }
  .hd-hero { padding: 64px 0 48px; }
  .hd-sec { padding: 64px 0; }
  .hd-stat b { font-size: 44px; }
  .hd-tiles { padding: 0 0 12px; }
  .hd-tile img.hd-icon { width: 104px; height: 104px; }
}

/* ---------- 动效：滚动到时淡入（0.25 秒慢进慢出）；系统开了“减少动态效果”就不动 ---------- */
.hd-js .hd-reveal { opacity: 0; transform: translateY(12px); transition: opacity .25s var(--hd-ease), transform .25s var(--hd-ease); }
.hd-js .hd-reveal.in { opacity: 1; transform: none; }
.hd-fade { transition: opacity .25s var(--hd-ease); }
.hd-fade.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .hd-js .hd-reveal { opacity: 1; transform: none; transition: none; }
  .hd-gnav *, .hd-more *, .hd-page * { transition: none !important; }
}
.hd-more.slim { padding-top: 0; }
.hd-more.slim .hd-more-foot { margin-top: 0; }

/* ---------- 请我喝杯咖啡（和写作网站同样的微信赞赏、爱发电） ---------- */
.hd-support { text-align: center; padding: 80px 22px 96px; }
.hd-support p { color: var(--hd-text-2); max-width: 520px; margin: 12px auto 24px; }
.hd-btn-ghost { background: transparent; color: var(--hd-link) !important; border: 1px solid currentColor; cursor: pointer; font-family: inherit; transition: background-color .15s var(--hd-ease), color .15s var(--hd-ease); }
.hd-btn-ghost:hover { background: var(--hd-link); color: #fff !important; }
.hd-coffee {
  border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: var(--hd-card); color: var(--hd-text); font: 400 15px/1.5 var(--hd-font); letter-spacing: -.01em;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  opacity: 0; transform: scale(.97); transition: opacity .25s var(--hd-ease), transform .25s var(--hd-ease);
}
.hd-coffee.in { opacity: 1; transform: none; }
.hd-coffee::backdrop { background: rgba(0, 0, 0, 0); transition: background-color .25s var(--hd-ease); }
.hd-coffee.in::backdrop { background: rgba(0, 0, 0, .45); }
.hd-coffee-in { position: relative; padding: 32px 28px 24px; text-align: center; }
.hd-coffee h2 { font-size: 24px; font-weight: 600; margin: 0 0 6px; letter-spacing: .005em; }
.hd-coffee-note { color: var(--hd-text-2); font-size: 13px; margin: 0; }
.hd-coffee-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--hd-bg-alt); color: var(--hd-text-2); display: grid; place-items: center; cursor: pointer; transition: color .15s var(--hd-ease); }
.hd-coffee-x:hover { color: var(--hd-text); }
.hd-coffee-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 16px; }
.hd-coffee-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px 16px; border-radius: 16px; background: var(--hd-bg-alt); color: var(--hd-text) !important; text-decoration: none !important; }
.hd-coffee-choice h3 { font-size: 16px; font-weight: 600; margin: 0; }
.hd-coffee-qr { width: 100%; max-width: 190px; height: auto; border-radius: 10px; }
.hd-coffee-art { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--hd-link); min-height: 150px; }
.hd-coffee-art span { font-size: 13px; color: var(--hd-text-2); }
.hd-coffee-act { font-size: 14px; color: var(--hd-link) !important; text-decoration: none !important; }
a.hd-coffee-afdian { transition: transform .15s var(--hd-ease), box-shadow .15s var(--hd-ease); }
a.hd-coffee-afdian:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
@media (max-width: 480px) { .hd-coffee-choices { grid-template-columns: 1fr; } .hd-coffee-art { min-height: 90px; } }
@media (prefers-reduced-motion: reduce) { .hd-coffee, .hd-coffee::backdrop { transition: none; } }

/* ---------- 原有页面的配色：总导航、底部、咖啡框跟着各自页面走 ----------
   选择器写成 :root.hd-host.hd-skin-x，优先级高过上面的深色模式规则 */
:root.hd-host.hd-skin-ruxget {
  --hd-bg: var(--bg); --hd-bg-alt: #EDE8D8; --hd-card: var(--panel); --hd-text: var(--text); --hd-text-2: var(--muted);
  --hd-line: var(--line); --hd-link: var(--accent); --hd-btn: var(--btn); --hd-btn-hover: var(--btn-hover);
  --hd-nav-bg: rgba(244, 240, 228, .82); --hd-nav-text: var(--text);
  --hd-font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
:root.hd-host.hd-skin-tapaste {
  --hd-bg: var(--bg); --hd-bg-alt: var(--s2); --hd-card: var(--s1); --hd-text: var(--fg); --hd-text-2: var(--muted);
  --hd-line: var(--line); --hd-link: var(--accent); --hd-btn: var(--btn); --hd-btn-hover: var(--btn-hover);
  --hd-nav-bg: var(--nav); --hd-nav-text: var(--fg); --hd-font: var(--font);
}
:root.hd-host.hd-skin-tapaste-doc {
  --hd-bg: var(--bg); --hd-bg-alt: var(--glass); --hd-card: var(--glass); --hd-text: var(--fg); --hd-text-2: var(--muted);
  --hd-line: var(--line); --hd-link: var(--blue); --hd-btn: var(--blue); --hd-btn-hover: var(--blue);
  --hd-nav-bg: var(--glass); --hd-nav-text: var(--fg); --hd-font: var(--font, system-ui, sans-serif);
}
:root.hd-host .hd-gnav, :root.hd-host .hd-more { font-family: var(--hd-font); }
:root.hd-skin-tapaste .hd-more-card, :root.hd-skin-tapaste .hd-coffee, :root.hd-skin-ruxget .hd-more-card, :root.hd-skin-ruxget .hd-coffee { border-radius: 16px; }
.hd-story .hd-body + .hd-body { margin-top: 14px; }
.hd-story .hd-h2 { max-width: 820px; }
.hd-sec .hd-body.hd-fmt { font-size: 17px; margin-top: 40px; }
