﻿/* 来自妻子的折辱 · 主样式
   冷调暗色：深灰紫底 + 暗玫瑰点缀，和「模拟人生」的暖色调区分开 */
:root {
  --ink: #f3ece6;
  --ink-2: #cdbfb6;
  --dim: #8d7f78;
  --line: rgba(230, 200, 190, .14);
  --rose: #c9706e;
  --rose-2: #a04f52;
  --gold: #cfa77a;
  --bg-0: #14100f;
  --bg-1: #1c1514;
  --card: rgba(30, 22, 21, .82);
  --radius: 16px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(70% 45% at 50% -6%, rgba(201, 112, 110, .22) 0%, rgba(201, 112, 110, 0) 62%),
    radial-gradient(90% 60% at 50% 110%, rgba(160, 79, 82, .18) 0%, rgba(160, 79, 82, 0) 64%),
    linear-gradient(170deg, #171212 0%, #14100f 45%, #100c0c 100%);
  background-attachment: fixed;
}

[hidden] { display: none !important; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.05'/></svg>");
  z-index: 0;
}

/* ---------- 通用容器 ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 26px 18px calc(26px + env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
}

.kicker {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid rgba(201, 112, 110, .45);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--rose);
}

h1 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .16em;
  text-indent: .16em;
  font-weight: 600;
  color: var(--ink);
}

.note {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 2;
  color: var(--dim);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 24px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: .12em;
  color: #fff4f0;
  background: linear-gradient(180deg, #cf7b78, var(--rose) 52%, var(--rose-2));
  box-shadow: 0 14px 30px rgba(160, 79, 82, .38);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: none;
  margin-top: 12px;
}

/* ---------- 封面 ---------- */

.cover-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  gap: 14px;
}

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(230, 200, 190, .18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  background: #241b1a;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 34% at 50% 52%, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 76%),
    linear-gradient(to bottom, rgba(10, 6, 6, .18) 0%, rgba(10, 6, 6, 0) 38%, rgba(10, 6, 6, .55) 100%);
}

.cover-title {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(26px, 7.6vw, 36px);
  letter-spacing: .2em;
  text-indent: .2em;
  color: #fff2ea;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .9), 0 8px 40px rgba(0, 0, 0, .8);
}

/* ---------- 剧情页 ---------- */

.stage-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  gap: 10px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--dim);
}
.hud .tag {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}

#stagebox {
  position: relative;
  flex: 1 1 auto;
  min-height: 46dvh;
  max-height: 62dvh;
  border-radius: 16px;
  overflow: hidden;
  background: #100c0c;
  border: 1px solid var(--line);
}

#bgBlur,
.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#bgBlur {
  object-fit: cover;
  filter: blur(26px) brightness(.5);
  transform: scale(1.14);
}
.bg {
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity .45s ease;
  display: block;
}
.bg.show { opacity: 1; }

#textbox {
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  backdrop-filter: blur(6px);
}

#text {
  margin: 0;
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink);
  white-space: pre-line;
  letter-spacing: .02em;
}

#choices {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}
#choices.show { opacity: 1; transform: none; }
#choices.locked { pointer-events: none; opacity: .55; }

.choice {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: rgba(255, 240, 235, .05);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.choice:active {
  background: rgba(201, 112, 110, .18);
  border-color: rgba(201, 112, 110, .5);
}

/* 倒计时：图右上角一个小胶囊，不挡画面 */
#count {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(255, 217, 210, .85);
  background: rgba(18, 11, 11, .42);
  border: 1px solid rgba(201, 112, 110, .3);
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
#count.show { opacity: 1; }

#count .num {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

/* ---------- 结束页 ---------- */

.end-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
}

.end-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px 26px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.end-card .line-name {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .14em;
  color: var(--gold);
}

.end-card .body {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 2.1;
  color: var(--ink-2);
  white-space: pre-line;
  text-align: left;
}

@media (min-width: 720px) {
  .stage-wrap, .cover-wrap { padding-top: 24px; }
  #stagebox { max-height: 58dvh; }
}
