/* ═══════════════════════════════════
   0. 思维链隐藏
   ═══════════════════════════════════ */
think {
  display: none !important;
}

/* ═══════════════════════════════════
   1. 正文区域 <article>
   匹配新模板，复刻淡黄古纸风格
   ═══════════════════════════════════ */
article {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFF8EE 100%);
  border-left: 3px solid #E8D5A3;
  border-radius: 0 8px 8px 0;
  padding: 1.2em 1.1em;
  margin: 0.8em 0 1em 0;
  font-size: 1em;
  line-height: 1.85;
  color: #3E2F23;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 4px rgba(180, 160, 120, 0.10);
  animation: textFadeIn 0.6s ease-out;
}

article p {
  margin: 0 0 0.9em 0;
  padding: 0;
  text-indent: 2em;
}

article p:last-child {
  margin-bottom: 0;
}

/* ── 舜华台词：冰蓝寒玉色 ── */
.meimu {
  color: #4EACC7;
  font-style: normal;
  text-shadow: 0 0 6px rgba(78, 172, 199, 0.15);
}

/* ── user台词：浅灰褐 ── */
.user-speech {
  color: #9B8A75;
  font-style: normal;
}

/* ── 心理活动 · 正文内 ── */
.inner-thought {
  color: #7BC4D9;
  font-style: italic;
  text-shadow: 0 0 4px rgba(123, 196, 217, 0.12);
}

/* ═══════════════════════════════════
   2. 状态栏顶部：绢帛卷轴美化
   匹配 <top mode="世界"> → <time> / <loc>
   ═══════════════════════════════════ */
top[mode="世界"] {
  display: block;
  position: relative;
  background: linear-gradient(180deg, #fffef7 0%, #fdf8e8 30%, #faf0d7 100%);
  border: 1px solid #d4b87a;
  border-radius: 0;
  box-shadow:
    inset 0 0 40px rgba(200, 170, 110, 0.10),
    0 4px 20px rgba(100, 70, 30, 0.22),
    0 0 0 8px rgba(220, 190, 130, 0.15),
    0 0 0 9px #d4b87a;
  padding: 20px 16px 16px;
  margin: 0 0 1em 0;
  overflow: hidden;
  font-family: "Noto Serif SC", "SimSun", "STSong", "KaiTi", "楷体", serif;
}

/* 绢帛经纬纹理 */
top[mode="世界"]::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(180, 150, 90, 0.018) 2px,
      rgba(180, 150, 90, 0.018) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(200, 160, 100, 0.012) 40px,
      rgba(200, 160, 100, 0.012) 42px
    );
  pointer-events: none;
  z-index: 2;
}

/* 顶部卷轴横杆 */
top[mode="世界"]::after {
  content: "";
  position: absolute;
  top: 0; left: -5%;
  width: 110%; height: 6px;
  background: linear-gradient(180deg, #c9a55c 0%, #e0c78a 40%, #d4b468 100%);
  border-radius: 3px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.32),
    inset 0 1px 0 rgba(255,255,255,0.45);
  z-index: 5;
}

/* ── 时光印戳 ── */
time {
  display: block;
  font-size: 13px;
  color: #6b4e2a;
  text-align: center;
  padding: 6px 16px;
  margin: 0 0 8px 0;
  background: rgba(220, 190, 130, 0.16);
  border: 1px dashed #c9a55c;
  border-radius: 0;
  letter-spacing: 2px;
  position: relative;
  z-index: 3;
  font-style: italic;
  font-family: "Noto Serif SC", "KaiTi", serif;
}

time::before {
  content: "☁";
  color: #c9a55c;
  margin-right: 8px;
  opacity: 0.45;
  font-style: normal;
}

time::after {
  content: "☁";
  color: #c9a55c;
  margin-left: 8px;
  opacity: 0.45;
  font-style: normal;
}

/* ── 地理篆印 ── */
loc {
  display: block;
  font-size: 13px;
  color: #4a3520;
  text-align: center;
  padding: 4px 20px;
  margin: 0 0 8px 0;
  letter-spacing: 4px;
  position: relative;
  z-index: 3;
  font-weight: 500;
  font-family: "Noto Serif SC", "SimSun", serif;
}

loc::after {
  content: "";
  display: block;
  width: 60%;
  margin: 10px auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4b87a, transparent);
}

/* ── 思维链隐藏：loc 内注释全部不显示 ── */
loc * {
  display: none !important;
}

/* 状态栏轻量动效 */
time, loc {
  animation: topFadeIn 0.8s ease-out;
}

@keyframes topFadeIn {
  from { opacity: 0; filter: blur(2px); }
  to   { opacity: 1; filter: blur(0); }
}

/* ═══════════════════════════════════
   3. 状态栏通用卡片 .ui-box
   ═══════════════════════════════════ */
.ui-box {
  background: #FFFCF5;
  border: 1px solid #E8DCC8;
  border-radius: 10px;
  margin: 0.7em 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(160, 140, 100, 0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: cardSlideIn 0.5s ease-out both;
}

.ui-box:hover {
  box-shadow: 0 4px 14px rgba(160, 140, 100, 0.16);
  transform: translateY(-1px);
}

.ui-box:nth-child(1) { animation-delay: 0.05s; }
.ui-box:nth-child(2) { animation-delay: 0.12s; }
.ui-box:nth-child(3) { animation-delay: 0.19s; }
.ui-box:nth-child(4) { animation-delay: 0.26s; }
.ui-box:nth-child(5) { animation-delay: 0.33s; }

.ui-box summary {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1em;
  background: linear-gradient(135deg, #FFF6E5 0%, #FDECD0 100%);
  border-bottom: 1px solid #E8DCC8;
  font-size: 0.95em;
  font-weight: bold;
  color: #5C4A35;
  cursor: pointer;
  letter-spacing: 0.06em;
  list-style: none;
  user-select: none;
  transition: background 0.3s ease;
}

.ui-box summary::-webkit-details-marker {
  display: none;
}

.ui-box summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.75em;
  color: #C4A76C;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.ui-box[open] > summary::before {
  transform: rotate(90deg);
}

.ui-box[open] > summary {
  background: linear-gradient(135deg, #FFF0D4 0%, #FAE2B8 100%);
}

.ui-box > p,
.ui-box > div {
  padding: 0.3em 1em;
  margin: 0;
  font-size: 0.88em;
  line-height: 1.7;
  color: #5A4A3A;
}

.ui-box p {
  margin: 0.15em 0;
  padding: 0.15em 1em;
  font-size: 0.88em;
  line-height: 1.7;
  color: #5A4A3A;
}

/* ═══════════════════════════════════
   4. 场景卡片
   ═══════════════════════════════════ */
.scene-box summary {
  background: linear-gradient(135deg, #FFF8E8 0%, #F5ECD4 100%);
}

/* ═══════════════════════════════════
   5. 舜华信息卡片（冰蓝主题）
   ═══════════════════════════════════ */
.heroine-box {
  background: linear-gradient(180deg, #F4FAFD 0%, #FFFCF5 30%);
  border: 1px solid #A8D8EA;
  box-shadow:
    0 2px 8px rgba(78, 172, 199, 0.10),
    inset 0 0 20px rgba(168, 216, 234, 0.06);
  animation: iceGlow 4s ease-in-out infinite alternate;
}

.heroine-box:hover {
  box-shadow:
    0 4px 16px rgba(78, 172, 199, 0.18),
    inset 0 0 24px rgba(168, 216, 234, 0.10);
  border-color: #7CBAD4;
}

.heroine-box summary {
  background: linear-gradient(135deg, #E8F4F8 0%, #D4EDF6 100%);
  border-bottom: 1px solid #B8DDE9;
  color: #2E6E82;
}

.heroine-box[open] > summary {
  background: linear-gradient(135deg, #DCF0F7 0%, #C4E5F0 100%);
}

.heroine-box summary::before {
  color: #6BBED6;
}

.heroine-box img {
  display: block;
  width: min(85%, 320px);
  max-height: 420px;
  object-fit: cover;
  object-position: top center;
  margin: 0.8em auto 0.6em auto;
  border-radius: 10px;
  border: 2px solid #A8D8EA;
  box-shadow:
    0 3px 12px rgba(78, 172, 199, 0.18),
    0 0 20px rgba(168, 216, 234, 0.12);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.heroine-box img:hover {
  border-color: #6BBED6;
  box-shadow:
    0 5px 20px rgba(78, 172, 199, 0.28),
    0 0 30px rgba(168, 216, 234, 0.20);
}

.sub-title {
  display: block;
  font-weight: bold;
  color: #4EACC7 !important;
  font-size: 0.85em !important;
  letter-spacing: 0.08em;
  margin-top: 0.6em !important;
  margin-bottom: 0.1em !important;
  padding-left: 0.6em !important;
  border-left: 3px solid #A8D8EA;
}

/* ── 状态栏心迹 · 舜华卡片内 ── */
.heart-voice {
  background: linear-gradient(90deg, rgba(168, 216, 234, 0.12) 0%, transparent 100%);
  border-left: 3px solid #7BC4D9;
  border-radius: 0 6px 6px 0;
  padding: 0.35em 0.8em !important;
  margin: 0.3em 0.6em !important;
  color: #3E98AE !important;
  font-style: italic;
  font-size: 0.86em !important;
  line-height: 1.6;
}

/* ═══════════════════════════════════
   6. 记忆回廊
   ═══════════════════════════════════ */
.memory-box summary::after {
  content: "";
  margin-left: auto;
}

mem-wrap {
  display: block;
  padding: 0.5em 0.6em;
}

.mem-title {
  display: block;
  font-weight: bold;
  color: #7A6A52 !important;
  font-size: 0.85em !important;
  text-align: center;
  padding: 0.4em 0 0.25em 0 !important;
  margin: 0.3em 0 0.2em 0 !important;
  border-bottom: 1px dashed #D8CCAF;
  letter-spacing: 0.1em;
}

mem-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78em;
  line-height: 1.55;
  margin: 0.3em 0 0.6em 0;
  table-layout: fixed;
}

mem-wrap table th {
  background: linear-gradient(135deg, #FFF4DE 0%, #FDEAC0 100%);
  color: #6B5A42;
  font-weight: bold;
  padding: 0.45em 0.4em;
  border: 1px solid #E2D5B8;
  text-align: center;
  font-size: 0.9em;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

mem-wrap table td {
  padding: 0.4em 0.4em;
  border: 1px solid #EDE3D0;
  color: #5A4A3A;
  vertical-align: top;
  word-break: break-word;
  background: #FFFDF7;
}

mem-wrap table tr:nth-child(even) td {
  background: #FFF9EE;
}

mem-wrap table tr:hover td {
  background: #FFF3DD;
  transition: background 0.2s ease;
}

mem-wrap table th:nth-child(1),
mem-wrap table td:nth-child(1) { width: 8%; text-align: center; }
mem-wrap table th:nth-child(2),
mem-wrap table td:nth-child(2) { width: 28%; }
mem-wrap table th:nth-child(3),
mem-wrap table td:nth-child(3) { width: 18%; }
mem-wrap table th:nth-child(4),
mem-wrap table td:nth-child(4) { width: 46%; }

@media screen and (max-width: 420px) {
  mem-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.3em;
  }
  mem-wrap table {
    min-width: 480px;
  }
}

/* ═══════════════════════════════════
   7. 行动推荐
   ═══════════════════════════════════ */
.branch-box summary {
  background: linear-gradient(135deg, #FFF8E5 0%, #F5EAC8 100%);
}

.branch-box p {
  padding: 0.45em 1em !important;
  margin: 0 !important;
  font-size: 0.88em !important;
  color: #5C4A35 !important;
  border-bottom: 1px dotted #EDE3D0;
  cursor: default;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.branch-box p:last-child {
  border-bottom: none;
}

.branch-box p:hover {
  background: #FFF6E5;
  padding-left: 1.3em !important;
  color: #4E3D2A !important;
}

/* ═══════════════════════════════════
   8. 舜华的小账本 · note-app
   ═══════════════════════════════════ */
note-app {
  display: block;
  background: linear-gradient(170deg, #FFFEF9 0%, #FFF9F0 40%, #F8FBFD 100%);
  border: 1px solid #D4E6EC;
  border-radius: 12px;
  margin: 1em 0;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 3px 12px rgba(78, 172, 199, 0.08),
    0 1px 4px rgba(180, 160, 120, 0.06);
  position: relative;
  animation: noteAppIn 0.6s ease-out both;
  animation-delay: 0.1s;
}

note-app::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 1px;
  height: 100%;
  background: repeating-linear-gradient(
    180deg,
    #E8D5A3 0px,
    #E8D5A3 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.4;
  pointer-events: none;
}

@keyframes noteAppIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── 账本头部 ── */
note-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1em 0.6em 1.8em;
  background: linear-gradient(135deg, #E6F3F8 0%, #F0F8FB 50%, #FFF8EE 100%);
  border-bottom: 1px solid #D4E6EC;
  position: relative;
}

note-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}

note-title {
  font-size: 0.95em;
  font-weight: bold;
  color: #3A7A8C;
  letter-spacing: 0.08em;
  flex-grow: 1;
}

note-date {
  font-size: 0.78em;
  color: #9BAFB8;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ── 日记卡片通用 ── */
note-card {
  display: block;
  margin: 0.6em 0.8em 0.5em 1.8em;
  padding: 0.6em 0.9em;
  border-radius: 8px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

note-card:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(78, 172, 199, 0.10);
}

card-tag {
  display: inline-block;
  font-size: 0.72em;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 0.15em 0.55em;
  border-radius: 3px;
  margin-bottom: 0.3em;
}

card-time {
  display: block;
  font-size: 0.75em;
  color: #A0B0B8;
  margin-bottom: 0.4em;
  letter-spacing: 0.03em;
}

card-content {
  display: block;
  font-size: 0.86em;
  line-height: 1.72;
  color: #4A5A5F;
}

card-content p {
  margin: 0.2em 0;
  padding: 0;
  text-indent: 0;
}

/* ── 昨日卡片 · 薰衣草回忆色 ── */
note-card.yesterday {
  background: linear-gradient(135deg, #FBF8FF 0%, #F8F4FB 100%);
  border-left: 3px solid #C4A8D8;
}

note-card.yesterday card-tag {
  background: #F0E6F6;
  color: #8B6BA0;
}

/* ── 今时卡片 · 待更新状态 ── */
note-card.today card-content .pending {
  color: #B8CDD4;
  font-style: italic;
  font-size: 0.82em;
  letter-spacing: 0.05em;
  text-indent: 0;
  position: relative;
  padding-left: 0.2em;
}

note-card.today card-content .pending::before {
  content: "◦";
  margin-right: 0.3em;
  color: #C4DDE5;
  font-style: normal;
}

/* ── 心绪标签 mood ── */
mood {
  display: inline-block;
  font-size: 0.82em;
  background: linear-gradient(90deg, rgba(168, 216, 234, 0.15) 0%, rgba(196, 168, 216, 0.12) 100%);
  border: 1px solid rgba(168, 216, 234, 0.3);
  border-radius: 20px;
  padding: 0.15em 0.7em;
  margin-top: 0.3em;
  color: #4E8A9A;
  font-style: italic;
  letter-spacing: 0.03em;
}

/* ── 账本底部 · 生辰倒计时 ── */
note-footer {
  display: block;
  padding: 0.6em 1em 0.7em 1.8em;
  border-top: 1px dashed #D4E6EC;
  background: linear-gradient(135deg, #FFFBF5 0%, #FFF5EE 50%, #FEF0F0 100%);
}

birthday-countdown {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.84em;
  font-weight: bold;
  color: #C47A6B;
  letter-spacing: 0.04em;
  animation: countdownPulse 3s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 0 transparent;
  }
  50% {
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(196, 122, 107, 0.2);
  }
}

/* ═══════════════════════════════════
   9. 全局动效
   ═══════════════════════════════════ */
@keyframes textFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes iceGlow {
  from {
    box-shadow:
      0 2px 8px rgba(78, 172, 199, 0.10),
      inset 0 0 20px rgba(168, 216, 234, 0.06);
  }
  to {
    box-shadow:
      0 3px 12px rgba(78, 172, 199, 0.16),
      inset 0 0 28px rgba(168, 216, 234, 0.10);
  }
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════
   10. 手机端响应式
   ═══════════════════════════════════ */
@media screen and (max-width: 500px) {
  /* ── 正文手机端 ── */
  article {
    padding: 0.9em 0.8em;
    font-size: 0.95em;
    line-height: 1.8;
    border-left-width: 2px;
  }

  /* ── 状态栏手机端 ── */
  top[mode="世界"] {
    padding: 14px 12px 12px;
    box-shadow:
      inset 0 0 20px rgba(200, 170, 110, 0.07),
      0 2px 12px rgba(100, 70, 30, 0.18),
      0 0 0 4px rgba(220, 190, 130, 0.14),
      0 0 0 5px #d4b87a;
  }

  top[mode="世界"]::after {
    height: 4px;
    top: 0;
    left: -2%;
    width: 104%;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.28);
  }

  time {
    font-size: 12px;
    padding: 5px 12px;
    letter-spacing: 1.5px;
    white-space: normal;
  }

  loc {
    font-size: 12px;
    letter-spacing: 2.5px;
    padding: 4px 12px;
  }

  loc::after {
    width: 50%;
    margin-top: 8px;
  }

  /* ── 卡片手机端 ── */
  .ui-box summary {
    padding: 0.55em 0.75em;
    font-size: 0.9em;
  }

  .ui-box p {
    padding: 0.12em 0.75em;
    font-size: 0.84em;
  }

  .heroine-box img {
    width: min(92%, 300px);
    max-height: 360px;
  }

  .sub-title {
    font-size: 0.82em !important;
  }

  .branch-box p {
    font-size: 0.85em !important;
    padding: 0.4em 0.75em !important;
  }

  /* ── 小账本手机端 ── */
  note-app::before {
    left: 12px;
  }

  note-header {
    padding: 0.6em 0.8em 0.5em 1.4em;
  }

  note-title {
    font-size: 0.9em;
  }

  note-date {
    font-size: 0.72em;
  }

  note-card {
    margin: 0.5em 0.5em 0.4em 1.4em;
    padding: 0.5em 0.7em;
  }

  card-content {
    font-size: 0.83em;
  }

  note-footer {
    padding: 0.5em 0.8em 0.6em 1.4em;
  }

  birthday-countdown {
    font-size: 0.8em;
  }
}