/*
  首页产品图（电脑端三栏 + 手机列表页），结构照真实界面重绘。
  设计画布固定 1180×760 px，内部全用 px；整体缩放由 site.js 写入 --fit。
  颜色全部引用 site.css 的变量，夜间自动跟随。
*/

/* ---------- 舞台与缩放 ---------- */
.hero-stage {
  margin-top: 64px;
  padding: 0 24px;
  animation: stage-in 1.4s var(--ease) 0.5s both;
}

.stage-fit {
  position: relative;
  width: min(1180px, 100%);
  height: calc(760px * var(--fit, 1));
  margin: 0 auto;
  perspective: 1800px;
}

.stage-inner {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1180px;
  height: 760px;
  margin-left: -590px;
  transform-style: preserve-3d;
  transform-origin: 50% 0;
  transform:
    scale(var(--fit, 1))
    rotateX(calc(var(--rx, 0deg) + var(--sx, 14deg)))
    rotateY(var(--ry, 0deg))
    scale(var(--ss, 0.94));
  transition: transform 0.6s var(--ease);
  will-change: transform;
}

.placeholder-note {
  margin: 18px 0 0;
  color: var(--meta);
  font-size: 12px;
}

.mk-win svg,
.mk-phone svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---------- 电脑窗口 ---------- */
.mk-win {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 660px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  overflow: hidden;
  /* 分层阴影：一圈发丝描边 + 贴地短影 + 远处柔影，比单层大阴影更「实」 */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent),
    0 2px 4px -1px rgba(23, 24, 27, 0.06),
    0 24px 48px -16px rgba(23, 24, 27, 0.16),
    0 80px 140px -40px rgba(23, 24, 27, 0.22);
  transition: opacity 0.6s var(--ease), filter 0.6s var(--ease), transform 0.6s var(--ease);
  animation: mk-rise 1s var(--ease) 0.7s both;
}

.mk-titlebar {
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 12px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
}

.mk-titlebar img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.mk-mac-dots {
  display: none;
  gap: 7px;
  margin-right: 8px;
}

.mk-mac-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.mk-mac-dots i:nth-child(1) { background: #ff5f57; }
.mk-mac-dots i:nth-child(2) { background: #febc2e; }
.mk-mac-dots i:nth-child(3) { background: #28c840; }

.mk-winctl {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: auto;
  color: var(--meta);
}

.mk-winctl svg {
  width: 14px;
  height: 14px;
  margin-right: 14px;
}

.mk-winctl b {
  position: relative;
  width: 44px;
  height: 100%;
}

.mk-winctl b::before,
.mk-winctl b::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
}

.c-min::before { width: 10px; height: 1px; margin: 0 0 0 -5px; background: currentColor; }
.c-max::before { width: 9px; height: 9px; margin: -5px 0 0 -5px; border: 1px solid currentColor; border-radius: 2px; }
.c-x::before,
.c-x::after { width: 12px; height: 1px; margin-left: -6px; background: currentColor; transform: rotate(45deg); }
.c-x::after { transform: rotate(-45deg); }

/* mac 外观 */
[data-os="mac"] .mk-mac-dots { display: flex; }
[data-os="mac"] .mk-winctl,
[data-os="mac"] .mk-titlebar img { display: none; }
[data-os="mac"] .mk-titlebar { justify-content: flex-start; }
[data-os="mac"] .mk-title { position: absolute; left: 50%; transform: translateX(-50%); }

.mk-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 268px 1fr;
}

/* ---------- 侧栏 ---------- */
.mk-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 8px 10px 10px;
  min-height: 0;
}

.mk-panel {
  border-radius: 12px;
  background: var(--paper);
}

.mk-profile {
  padding: 10px 12px 10px;
}

.mk-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}

.mk-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fd3a0, #3b9e6a);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.mk-uname {
  flex: 1;
  line-height: 1.3;
}

.mk-uname b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.mk-uname small {
  color: var(--meta);
  font-size: 11px;
}

.mk-heat {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  column-gap: 4px;
  margin-top: 10px;
}

.mk-heat-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 2px;
  color: var(--meta);
  font-size: 9px;
  line-height: 1;
}

.mk-heat-grid {
  display: grid;
  grid-template-rows: repeat(7, 9px);
  grid-auto-flow: column;
  grid-auto-columns: 9px;
  gap: 2.5px;
}

.mk-heat-grid i {
  border-radius: 2px;
  background: var(--container);
  transform: scale(0);
  animation: mk-pop 0.5s var(--spring) forwards;
  animation-delay: calc(0.9s + var(--k) * 5ms);
}

/* 热力图绿阶：照安卓/电脑端小组件 */
.mk-heat-grid i[data-l="1"] { background: #c6e9cf; }
.mk-heat-grid i[data-l="2"] { background: #8fd3a0; }
.mk-heat-grid i[data-l="3"] { background: #4cb96a; }
.mk-heat-grid i[data-l="4"] { background: #2f9e52; }
.mk-heat-grid i.today { outline: 1.5px solid var(--ink); outline-offset: -1.5px; background: transparent; }

.mk-heat-months {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  padding-right: 18px;
  margin-top: 4px;
  color: var(--meta);
  font-size: 9px;
}

.mk-nav,
.mk-folders {
  padding: 6px;
}

.mk-nav p,
.mk-folders p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink);
}

.mk-nav p em,
.mk-folders p em {
  margin-left: auto;
  color: var(--meta);
  font-style: normal;
  font-size: 11px;
}

.mk-nav p.on {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
}

.mk-nav p.on em {
  color: inherit;
  opacity: 0.75;
}

.mk-folders {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mk-fhead {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 4px 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.mk-fhead span {
  display: flex;
  gap: 10px;
  margin-left: auto;
  color: var(--ink-soft);
}

.mk-fhead svg {
  width: 14px;
  height: 14px;
}

.mk-folders p {
  height: 32px;
  font-size: 12.5px;
}

.mk-folders p svg {
  color: var(--ink-soft);
}

.mk-folders p .chev {
  width: 12px;
  height: 12px;
  margin: 0 -6px 0 -8px;
}

.mk-folders p.sub {
  padding-left: 34px;
}

/* ---------- 列表 ---------- */
.mk-list {
  padding: 4px 8px 0;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
}

.mk-lhead {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 2px 0 6px;
}

.mk-lhead b {
  flex: 1;
  font-size: 16px;
}

.mk-rbtn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
}

.mk-rbtn.dark {
  background: var(--primary);
  color: var(--on-primary);
}

.mk-card {
  margin-bottom: 8px;
  padding: 12px 14px 8px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--paper);
  animation: mk-rise 0.8s var(--ease) both;
}

.mk-list .mk-card:nth-of-type(1) { animation-delay: 0.9s; }
.mk-list .mk-card:nth-of-type(2) { animation-delay: 1s; }
.mk-list .mk-card:nth-of-type(3) { animation-delay: 1.1s; }
.mk-list .mk-card:nth-of-type(4) { animation-delay: 1.2s; }

.mk-card.on {
  border-color: var(--primary);
}

.mk-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
}

.mk-card footer {
  font-variant-numeric: tabular-nums;
}

.mk-src {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--meta);
  font-size: 11px;
}

.mk-src svg {
  width: 12px !important;
  height: 12px !important;
}

.mk-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mk-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--meta);
  font-size: 11px;
}

.mk-card footer svg {
  width: 14px;
  height: 14px;
}

.mk-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.mk-tags b {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

/* 录音条：照真实界面的黑底波形 */
.mk-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: #17181b;
  color: #fff;
}

.mk-audio em {
  font-style: normal;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.mk-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
}

.mk-wave i {
  flex: 1;
  height: calc(var(--h) * 100%);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: 50% 50%;
  animation: mk-wave 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--k) * -90ms);
}

.mk-wave i.played {
  background: #fff;
}

.mk-trans {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  color: var(--meta);
}

/* ---------- 编辑器 ---------- */
.mk-editor {
  position: relative;
  min-height: 0;
  padding: 10px 22px 0;
  background: var(--paper);
  border-top-left-radius: 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 86%, transparent);
  mask-image: linear-gradient(#000 86%, transparent);
}

.mk-etop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mk-seg {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
}

.mk-seg b {
  padding: 3px 12px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
}

.mk-seg b.on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(23, 24, 27, 0.08);
}

.mk-eacts {
  display: flex;
  gap: 16px;
  color: var(--ink-soft);
}

.mk-eacts .dim {
  opacity: 0.35;
}

/* 元信息与工具条同一行：左边是文件夹 · 时间 · 字数，右边是插入工具 */
.mk-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mk-tools {
  display: flex;
  gap: 4px;
  color: var(--ink-soft);
}

.mk-tools svg {
  width: 28px !important;
  height: 28px !important;
  padding: 6px;
  border-radius: 8px;
}

.mk-tools svg:first-child {
  background: var(--surface);
  color: var(--ink);
}

.mk-tools .ai {
  color: var(--accent);
  animation: mk-spark 2.4s ease-in-out infinite;
}

.mk-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--meta);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.mk-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--hint);
}

.mk-meta svg {
  width: 13px !important;
  height: 13px !important;
  margin-right: -2px;
}

.mk-doc {
  padding: 0 6px;
}

.mk-doc h3 {
  margin: 20px 0 14px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.mk-cover {
  position: relative;
  margin: 0 0 4px;
  height: 118px;
  border-radius: 12px;
  overflow: hidden;
}

.mk-cover svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.mk-cover figcaption {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

.mk-doc h4 {
  margin: 18px 0 6px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.mk-doc p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
  min-height: 1.8em;
}

.mk-doc p.cont {
  min-height: 0;
}

.mk-doc p[data-type]:not(.typed)::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--info);
  animation: caret 1s steps(1) infinite;
}

.mk-doc p.cont {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.mk-doc p.typed + p.cont {
  opacity: 1;
}

.mk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}

.mk-table th,
.mk-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mk-table th + th,
.mk-table td + td {
  border-left: 1px solid var(--line);
}

.mk-table th {
  background: var(--surface);
  font-weight: 600;
}

.mk-table tr:last-child td {
  border-bottom: 0;
}

.mk-todo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  font-size: 13px;
}

.mk-todo i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--hint);
  border-radius: 5px;
  color: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s;
}

.mk-todo i svg {
  width: 11px !important;
  height: 11px !important;
}

.mk-todo.done {
  color: var(--meta);
  text-decoration: line-through;
}

.mk-todo.done i {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* ---------- 手机 ---------- */
.mk-phone {
  position: absolute;
  left: 878px;
  top: 128px;
  width: 296px;
  height: 610px;
  padding: 7px;
  border-radius: 48px;
  /* 金属中框：深色渐变 + 内侧高光 + 外侧发丝线（固定深色设备外壳，不随主题） */
  background: linear-gradient(145deg, #2c2d32, #111214 45%, #26272b);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 0 3px #0b0c0d,
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 30px 60px -20px rgba(23, 24, 27, 0.35),
    0 70px 120px -40px rgba(23, 24, 27, 0.4);
  transform: translateZ(60px);
  transition: transform 0.7s var(--spring), opacity 0.6s var(--ease);
  animation: mk-slide 1.1s var(--ease) 1s both;
}

/* 侧键 */
.mk-phone::before,
.mk-phone::after {
  content: "";
  position: absolute;
  right: -2.5px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #2a2b30;
}

.mk-phone::before { top: 120px; height: 56px; }
.mk-phone::after { top: 196px; height: 36px; }

/* 屏幕玻璃的一道斜向反光 */
.mk-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 32%);
}

.mk-screen {
  position: relative;
  height: 100%;
  border-radius: 41px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.55;
}

.mk-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 4px 22px 0 26px;
  font-size: 12px;
}

.mk-island {
  display: none;
  position: absolute;
  left: 50%;
  top: 9px;
  width: 78px;
  height: 22px;
  margin-left: -39px;
  border-radius: 12px;
  background: #000;
}

/* 安卓/鸿蒙用打孔摄像头，iOS 用灵动岛 */
.mk-status::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #000;
}

[data-os="ios"] .mk-island { display: block; }
[data-os="ios"] .mk-status::after { display: none; }

.mk-sig {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.mk-sig i {
  width: 3px;
  border-radius: 1px;
  background: var(--ink);
}

.mk-sig i:nth-child(1) { height: 4px; }
.mk-sig i:nth-child(2) { height: 6px; }
.mk-sig i:nth-child(3) { height: 8px; }
.mk-sig i:nth-child(4) { height: 10px; }

.mk-sig u {
  margin: 0 4px 0 3px;
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
  line-height: 10px;
}

.mk-sig s {
  min-width: 22px;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  font-size: 9px;
  font-weight: 600;
  line-height: 11px;
  text-align: center;
  text-decoration: none;
}

.mk-phead {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px 0 16px;
}

.mk-phead > svg {
  width: 20px !important;
  height: 20px !important;
}

.mk-phead b {
  flex: 1;
  font-size: 17px;
}

.mk-phead .mk-rbtn {
  width: 34px;
  height: 34px;
}

.mk-chips {
  display: flex;
  gap: 6px;
  padding: 2px 14px 10px;
  white-space: nowrap;
  overflow: hidden;
}

.mk-chips b {
  padding: 4px 12px;
  border-radius: 9px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 400;
}

.mk-chips b.on {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
}

.mk-pscroll {
  padding: 0 10px;
  animation: mk-scroll 9s var(--ease) 2.6s infinite;
}

.mk-pscroll .mk-card {
  border-radius: 16px;
  padding: 12px 14px 6px;
}

.mk-pscroll .mk-card:nth-child(1) { animation-delay: 1.3s; }
.mk-pscroll .mk-card:nth-child(2) { animation-delay: 1.4s; }
.mk-pscroll .mk-card:nth-child(3) { animation-delay: 1.5s; }
.mk-pscroll .mk-card:nth-child(4) { animation-delay: 1.6s; }

.mk-art {
  display: block;
  width: 100% !important;
  height: 96px !important;
  margin: 10px 0 2px;
  border-radius: 10px;
}

.mk-card p.clamp {
  -webkit-line-clamp: 1;
  color: var(--meta);
}

.mk-more {
  display: block;
  margin-top: 4px;
  color: var(--info);
  font-size: 12px;
}

.mk-fab {
  position: absolute;
  right: 16px;
  bottom: 30px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 10px 24px -6px rgba(23, 24, 27, 0.4);
}

.mk-fab svg {
  width: 22px !important;
  height: 22px !important;
}

.mk-home {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 100px;
  height: 4px;
  margin-left: -50px;
  border-radius: 4px;
  background: var(--ink);
  opacity: 0.5;
}

/* ---------- 平台聚焦 ---------- */
[data-os="android"] .mk-win,
[data-os="ios"] .mk-win,
[data-os="harmony"] .mk-win {
  opacity: 0.55;
  filter: saturate(0.6);
  transform: translateZ(-40px);
}

[data-os="android"] .mk-phone,
[data-os="ios"] .mk-phone,
[data-os="harmony"] .mk-phone {
  transform: translateZ(120px) translateX(-80px) scale(1.04);
}

/* ---------- 关键帧 ---------- */
/* 入场用独立的 translate 属性，不占 transform：平台聚焦还要改 transform */
@keyframes mk-rise {
  from { opacity: 0; translate: 0 24px; }
}

@keyframes mk-slide {
  from { opacity: 0; translate: 80px 40px; }
}

@keyframes mk-pop {
  to { transform: scale(1); }
}

@keyframes mk-wave {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

@keyframes mk-spark {
  0%, 100% { transform: none; }
  50% { transform: scale(1.18) rotate(12deg); }
}

/* 手机里的列表缓缓上滑一段再回来，像有人在翻 */
@keyframes mk-scroll {
  0%, 30% { transform: translateY(0); }
  50%, 75% { transform: translateY(-150px); }
  95%, 100% { transform: translateY(0); }
}

/* 窄屏：整张三栏缩到 1/3 已经看不清，只留手机，按 320×630 的画布缩放（site.js 同步切换） */
@media (max-width: 720px) {
  .hero-stage {
    padding: 0 12px;
    margin-top: 48px;
  }

  .stage-fit {
    width: min(320px, 100%);
    height: calc(630px * var(--fit, 1));
  }

  .stage-inner {
    width: 320px;
    height: 630px;
    margin-left: -160px;
  }

  .mk-win {
    display: none;
  }

  .mk-phone,
  [data-os] .mk-phone {
    left: 12px;
    top: 10px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-heat-grid i {
    transform: none;
  }
}
