:root {
  --paper: #f4eee1;
  --ink: #2c1b18;
  --muted: #5f4a44;
  --hint: #6b544d;
  --faint: #644d46;
  --vermilion: #9e2e2b;
  --vermilion-dark: #6e1c1a;
  --jade: #88aa96;
  --jade-light: #d6e8dd;
  --jade-ink: #40604c;
  --line: rgba(74, 46, 40, 0.16);
  --panel: #fcf9f2;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #b8b0a2; }
body {
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "华文楷体", "楷体", serif;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* ── 把系统默认外观清干净 ──────────────────────
   安卓点一下会闪一片蓝灰、Chrome 自动填充盖黄底、搜索框和密码框带系统
   小图标、数字框带上下箭头 —— 这些都不是这套视觉的东西，逐个关掉。
   注意：这里是类型选择器，任何带类名的按钮（.btn / .list-item …）都能盖过它。 */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select {
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
/* 自动填充的黄底盖不住，用内阴影顶掉 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px rgba(255,253,248,.98) inset;
  transition: background-color 9999s ease-out;
}
/* 系统自带的小图标一律不要，要就自己画 */
input::-webkit-search-cancel-button,
input::-webkit-search-decoration,
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button,
input::-ms-reveal,
input::-ms-clear { -webkit-appearance: none; appearance: none; display: none; }

::selection { background: rgba(158,46,43,.16); color: var(--ink); }

/* 焦点环只在键盘操作时出现，点按不出现 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 2px;
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(74,46,40,.26) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(74,46,40,.22); border-radius: 999px; }
::-webkit-scrollbar-thumb:active { background: rgba(158,46,43,.48); }

/* 万一还有漏网的原生 select，至少弹出列表不是系统白底 */
select option { background: #fcf9f2; color: var(--ink); }

/* ── 手机外壳 (锦缎与宣纸纹理) ── */
.phone-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.6) 0%, transparent 60%),
    linear-gradient(180deg, #f9f5ec 0%, #f1e9da 100%);
  border-left: 1px solid rgba(74,46,40,.12);
  border-right: 1px solid rgba(74,46,40,.12);
  padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

/* ── 顶部古风状态条 ── */
.topbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--hint);
  flex: none;
  border-bottom: 1px dashed rgba(74,46,40,.15);
}
.topbar-mark {
  font-weight: 600;
  color: var(--vermilion);
  letter-spacing: .18em;
}
.topbar-signal {
  font-size: 11px;
  color: var(--jade-ink);
  background: rgba(136,170,150,.2);
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(136,170,150,.4);
}

.home-content { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 0 14px; }
.eyebrow {
  font-size: 12px;
  letter-spacing: .25em;
  color: var(--muted);
  text-align: center;
  margin: 0 0 10px;
}

/* ── 藏忆阁 ── */
.memory-card {
  position: relative;
  flex: none;
  min-height: 195px;
  width: 100%;
  border: 1.5px solid #669179;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 85% 15%, rgba(255,255,255,.65) 0%, transparent 45%),
    radial-gradient(circle at 15% 75%, rgba(182,214,195,.45) 0%, transparent 55%),
    linear-gradient(135deg, #e7f2ea 0%, #d8eae0 50%, #c4dfce 100%);
  color: var(--ink);
  padding: 22px 20px;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(74,46,40,.08), inset 0 0 0 1px rgba(255,255,255,.8);
  transition: transform .18s ease;
}
.memory-card:active { transform: scale(0.985); }
.memory-card::before {
  content: "";
  position: absolute;
  width: 170px; height: 170px;
  right: -40px; top: -65px;
  border: 1px solid rgba(75,122,93,.35);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(101,151,116,.1), 0 0 0 36px rgba(101,151,116,.06);
}
.memory-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--jade-ink);
  background: rgba(255,255,255,.6);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(75,122,93,.3);
  margin-bottom: 8px;
}
.memory-title {
  display: block;
  font-size: 34px;
  font-weight: normal;
  letter-spacing: .15em;
  color: var(--ink);
  margin-top: 2px;
}
.memory-line {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--jade-ink);
  letter-spacing: .06em;
}
.memory-seal-img {
  position: absolute;
  right: 18px; bottom: 14px;
  width: 38px; height: 38px;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.78;
  transform: rotate(-2deg);
  pointer-events: none;
  user-select: none;
  transition: transform .2s ease, opacity .2s ease;
}
.memory-card:active .memory-seal-img {
  transform: scale(0.92) rotate(-5deg);
  opacity: 0.95;
}

/* 珠帘只在上方这段挂绳区吃手势，卡片其余部分照常是整块按钮 */
.memory-curtain { position: absolute; z-index: 6; top: 0; right: 0; width: 100%; height: 100%; pointer-events: none; }
.curtain-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.curtain-hit {
  position: absolute; top: 0; right: 0;
  width: min(210px, 74%); height: 128px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.curtain-hit:active { cursor: grabbing; }

/* ── 首页双微件 ── */
.home-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.record-widget, .note-widget { position: relative; height: 215px; text-align: left; overflow: hidden; cursor: pointer; }
.record-widget { padding: 15px 0; border: 0; border-radius: 0; background: transparent; }
.record-label {
  position: absolute;
  left: 14px; bottom: 32px;
  margin: 0;
  color: var(--vermilion);
  font-size: 19px;
  letter-spacing: .18em;
  z-index: 4;
}
.record-caption {
  position: absolute;
  left: 14px; bottom: 13px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  z-index: 4;
}
.window-scene { position: absolute; width: 150px; height: 150px; left: 50%; top: 6px; transform: translateX(-50%); overflow: visible; border-radius: 50%; cursor: pointer; pointer-events: auto; }
.window-outside, .window-frame, .window-pendant { position: absolute; display: block; pointer-events: none; user-select: none; }
.window-outside { inset: 0; width: 100%; height: 94%; object-fit: cover; z-index: 1; border-radius: 50%; }
.window-frame { inset: -4%; width: 108%; height: 108%; object-fit: contain; z-index: 2; mix-blend-mode: multiply; }
/* 挂件的位置写成百分比，窗口缩小（矮屏）时它跟着缩，不会甩出圆窗 */
.window-pendant { width: 68.2%; height: 68.2%; left: calc(42% + 6.7%); top: calc(22% + 33.3%); object-fit: contain; z-index: 3; filter: drop-shadow(3px 5px 3px rgba(58,37,34,.2)); transform: rotate(3deg); transform-origin: 50% 8%; transition: transform .4s ease; }
.record-widget:hover .window-pendant { transform: rotate(-2deg) translateY(2px); }

/* ── 素笺微件 (古风信笺折子) ── */
.note-widget {
  padding: 16px 14px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.8) 0%, transparent 40%),
    linear-gradient(175deg, #fdfbf7 0%, #f6f0e4 100%);
  border: 1.5px solid rgba(158,46,43,.35);
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(74,46,40,.06), inset 0 0 0 1px rgba(255,255,255,.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .18s ease;
}
.note-widget:active { transform: scale(0.97); }
.note-header { display: flex; justify-content: space-between; align-items: center; }
.note-label {
  font-size: 19px;
  letter-spacing: .2em;
  color: var(--ink);
  font-weight: 500;
}
.note-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--vermilion);
  background: rgba(158,46,43,.08);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid rgba(158,46,43,.2);
}
.note-status i {
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--vermilion);
}
.note-body {
  margin: auto 0;
  padding: 6px 0;
  border-left: 2px solid rgba(158,46,43,.2);
  padding-left: 10px;
}
.note-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: #382420;
  letter-spacing: .08em;
}
.note-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.note-seal {
  font-size: 11px;
  color: var(--vermilion);
  border: 1px solid var(--vermilion);
  padding: 1px 4px;
  border-radius: 3px;
  transform: rotate(2deg);
}
.note-time {
  font-size: 11px;
  color: var(--hint);
  letter-spacing: .08em;
}

/* ── 静谧断纹 ── */
.quiet-lines { margin-top: auto; padding: 12px 4px 0; display: flex; flex-direction: column; gap: 5px; opacity: .5; }
.quiet-lines span { display: block; height: 1px; background: var(--line); }
.quiet-lines span:nth-child(1){width:20%}.quiet-lines span:nth-child(2){width:52%}.quiet-lines span:nth-child(3){width:32%}

/* ── 联系人信条 (传音与对影) ── */
.contact-strip {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
.contact-avatar {
  width: 44px; height: 44px;
  border: 1.5px solid var(--vermilion);
  border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, #ffffff, #eae2d6);
  box-shadow: 0 3px 8px rgba(74,46,40,.08);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--vermilion);
  cursor: pointer;
  transition: transform .15s ease;
}
.contact-avatar:active { transform: scale(0.94); }
.contact-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.contact-name {
  font-size: 18px;
  letter-spacing: .12em;
  color: var(--ink);
  font-weight: 600;
}
.contact-state {
  color: var(--hint);
  font-size: 11px;
  letter-spacing: .06em;
}
.round-action {
  width: 44px; height: 44px;
  border: 1.5px solid rgba(74,46,40,.25);
  border-radius: 50%;
  background: #fdfaf5;
  box-shadow: 0 3px 8px rgba(74,46,40,.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.round-action:active { transform: scale(0.92); }
.action-txt {
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--ink);
}
.video-action {
  background: linear-gradient(135deg, #e4f2ea 0%, #b8dac5 100%);
  border-color: #5d8c72;
}
.video-action .action-txt { color: #1e3f2d; }

/* ── 底部古风无框图样导航 ── */
.bottom-nav {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
}
.bottom-nav button {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--hint);
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
}
.bottom-nav button:active { transform: scale(0.92); }
.nav-symbol {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.nav-icon-svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(74,46,40,.12));
  transition: transform .2s cubic-bezier(.22,1,.36,1);
}
.bottom-nav button:hover .nav-icon-svg {
  transform: translateY(-2px);
}
.bottom-nav button:active .nav-icon-svg {
  transform: scale(0.88);
}
.seal-chat {
  width: 56px; height: 56px;
  margin-top: -14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.seal-chat .nav-icon-svg {
  filter: drop-shadow(0 3px 8px rgba(44,27,24,.24));
}
.nav-chat { color: var(--vermilion) !important; font-weight: 600; }

.home-indicator {
  width: 96px; height: 3.5px;
  border-radius: 6px;
  background: var(--ink);
  opacity: .35;
  margin: 0 auto 6px;
}

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 10px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(44,27,24,.92);
  color: #fdfaf5;
  font-size: 13px;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 481px) {
  body { padding: 20px 0; }
  .phone-shell {
    min-height: min(900px, calc(100dvh - 40px));
    border-radius: 34px;
    box-shadow: 0 16px 50px rgba(44,27,24,.25);
  }
}

/* 系统开了「减弱动态效果」：动效收掉，静态形状保留 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .disc.is-playing { animation: none; }
  .disc.is-playing .disc-center { animation: none; }
}

/* 矮屏：把首页的固定高度让出来给内容滚动，别把导航挤出去 */
@media (max-height: 700px) {
  .phone-shell { overflow-y: auto; }
  .home-content { padding: 8px 0 10px; }
  .eyebrow { margin-bottom: 6px; }
  .memory-card { min-height: 168px; }
  .record-widget, .note-widget { height: 190px; }
  .curtain-hit { height: 108px; }
  .quiet-lines { display: none; }
}

/* 更矮的机子（320×568 这类）：再收一档，导航必须一屏可见 */
@media (max-height: 620px) {
  .topbar { height: 38px; }
  .memory-card { min-height: 148px; }
  .memory-title { font-size: 28px; }
  .home-widgets { margin-top: 10px; gap: 12px; }
  .record-widget, .note-widget { height: 166px; }
  .window-scene { width: 118px; height: 118px; }
  .window-pendant { width: 68.2%; height: 68.2%; }
  .record-label { bottom: 26px; font-size: 17px; }
  .record-caption { display: none; }
  .note-text { font-size: 13px; line-height: 1.5; }
  .curtain-hit { height: 96px; }
  .contact-strip { min-height: 66px; }
  .bottom-nav { height: 64px; }
}
