/* ============================================
   粉彩波普风·袁素果状态栏主题 (柔和版)
   作用域：card 标签内
   ============================================ */

/* ---------- 最外层容器 ---------- */
card {
  display: block;
  position: relative;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: clamp(14px, 3.6vw, 17px);
  line-height: 1.78;
  color: #3D3535;
  padding: clamp(10px, 3vw, 20px);
  overflow: hidden;
}

/* ---------- 顶部环境栏 <env> ---------- */
env {
  display: block;
  background: #FFF3CD;
  background-image: radial-gradient(circle, rgba(180,140,60,0.06) 1px, transparent 1px);
  background-size: 8px 8px;
  border: 2.5px solid #3D3535;
  border-radius: 10px;
  padding: clamp(8px, 2vw, 14px) clamp(12px, 3vw, 18px);
  margin-bottom: clamp(14px, 3vw, 22px);
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  box-shadow: 3px 3px 0px #3D3535;
  position: relative;
  overflow: hidden;
}

env::before {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  background: #F4A4BE;
  border: 2px solid #3D3535;
  border-radius: 50%;
  z-index: 1;
}

/* ---------- 正文区域 <text> ---------- */
text {
  display: block;
  background: #FFFDF7;
  background-image: radial-gradient(circle, rgba(200,170,120,0.04) 1px, transparent 1px);
  background-size: 10px 10px;
  border: 2.5px solid #3D3535;
  border-radius: 12px;
  padding: clamp(14px, 3.5vw, 24px) clamp(12px, 3vw, 20px);
  margin-bottom: clamp(14px, 3vw, 22px);
  box-shadow: 3px 3px 0px #3D3535;
}

/* ---------- 正文段落 ---------- */
text p {
  margin: 0 0 0.8em 0;
  text-indent: 2em;
  text-align: justify;
  word-break: break-word;
  color: #3D3535;
}

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

/* ---------- 袁素果对话 ---------- */
text .syg {
  color: #B5456B;
  background: linear-gradient(135deg, #FFF5F8 0%, #FFDDE8 100%);
  border-left: 4px solid #F4A4BE;
  border-radius: 0 10px 10px 0;
  padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 16px);
  margin: 0.6em 0;
  text-indent: 0;
  font-weight: 600;
  position: relative;
  box-shadow: 2px 2px 0px rgba(244,164,190,0.5);
}

text .syg::before {
  content: "💗";
  position: absolute;
  top: -8px;
  left: -8px;
  font-size: 13px;
}

/* ---------- NPC对话 ---------- */
text .d {
  color: #8B5E3C;
  background: linear-gradient(135deg, #FFFAF3 0%, #FFE8CC 100%);
  border-left: 4px solid #E8A86D;
  border-radius: 0 10px 10px 0;
  padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 16px);
  margin: 0.6em 0;
  text-indent: 0;
  font-weight: 600;
  box-shadow: 2px 2px 0px rgba(232,168,109,0.4);
}

/* ---------- 行动选项 <actions> ---------- */
actions {
  display: block;
  background: #FFF9F9;
  background-image: radial-gradient(circle, rgba(244,164,190,0.07) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
  border: 2.5px solid #3D3535;
  border-radius: 12px;
  padding: clamp(10px, 2.5vw, 16px);
  margin-bottom: clamp(14px, 3vw, 22px);
  box-shadow: 3px 3px 0px #3D3535;
}

actions::before {
  content: "⚡ 接下来你要...";
  display: block;
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 800;
  color: #D4764E;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

actions p {
  margin: 0 0 8px 0;
  padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 18px);
  background: #FFFFFF;
  border: 2.5px solid #3D3535;
  border-radius: 8px;
  font-weight: 600;
  font-size: clamp(13px, 3.4vw, 16px);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  box-shadow: 3px 3px 0px #3D3535;
  position: relative;
  overflow: hidden;
}

actions p::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(244,164,190,0.12), rgba(126,206,194,0.12));
  transition: width 0.25s ease;
  z-index: 0;
}

actions p:hover::before,
actions p:active::before {
  width: 100%;
}

actions p:hover,
actions p:active {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0px #3D3535;
}

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

/* ---------- 折叠栏通用基础 ---------- */
card > details {
  border: 2.5px solid #3D3535;
  border-radius: 10px;
  margin-bottom: clamp(10px, 2.5vw, 16px);
  overflow: hidden;
  box-shadow: 3px 3px 0px #3D3535;
  transition: box-shadow 0.2s ease;
}

card > details[open] {
  box-shadow: 2px 2px 0px #3D3535;
}

card > details > summary {
  padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 18px);
  font-weight: 800;
  font-size: clamp(14px, 3.6vw, 17px);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
  position: relative;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  letter-spacing: 0.5px;
}

card > details[open] > summary {
  border-bottom-color: rgba(61,53,53,0.2);
}

card > details > summary::-webkit-details-marker {
  display: none;
}

card > details > summary::after {
  content: "▸";
  position: absolute;
  right: clamp(12px, 3vw, 18px);
  font-size: 18px;
  transition: transform 0.2s ease;
  color: #3D3535;
}

card > details[open] > summary::after {
  transform: rotate(90deg);
}

card > details > summary:hover,
card > details > summary:active {
  opacity: 0.8;
}

card > details p {
  margin: 0.35em 0;
  font-size: clamp(12.5px, 3.3vw, 15px);
  line-height: 1.7;
  word-break: break-word;
  padding-left: clamp(12px, 3vw, 18px);
  padding-right: clamp(12px, 3vw, 18px);
}

card > details p b {
  font-weight: 800;
  margin-right: 2px;
}

/* ---------- 🗯️ 心声 ---------- */
card > details:nth-of-type(1) {
  background: linear-gradient(145deg, #F8F0FF 0%, #F0E6F8 100%);
  background-image: radial-gradient(circle, rgba(160,120,190,0.05) 1.5px, transparent 1.5px);
  background-size: 6px 6px;
}

card > details:nth-of-type(1) > summary {
  color: #7B5A8E;
}

card > details:nth-of-type(1) p {
  color: #5A3D6E;
  font-style: italic;
}

/* ---------- 📊 袁素果状态 ---------- */
card > details:nth-of-type(2) {
  background: linear-gradient(145deg, #FFF8FA 0%, #FFEEF3 100%);
  background-image: radial-gradient(circle, rgba(244,164,190,0.07) 1.5px, transparent 1.5px);
  background-size: 7px 7px;
}

card > details:nth-of-type(2) > summary {
  color: #B5456B;
}

/* ---------- 👤 User状态 ---------- */
card > details:nth-of-type(3) {
  background: linear-gradient(145deg, #F2FDFB 0%, #E4F8F4 100%);
  background-image: radial-gradient(circle, rgba(126,206,194,0.07) 1.5px, transparent 1.5px);
  background-size: 7px 7px;
}

card > details:nth-of-type(3) > summary {
  color: #3D8E80;
}

/* ---------- 🧠 记忆区 ---------- */
card > details:nth-of-type(4) {
  background: linear-gradient(145deg, #F5FFF8 0%, #E8F8EC 100%);
  background-image: radial-gradient(circle, rgba(126,190,160,0.06) 1.5px, transparent 1.5px);
  background-size: 7px 7px;
}

card > details:nth-of-type(4) > summary {
  color: #3D7A5E;
}

/* 记忆区内嵌子details */
card > details:nth-of-type(4) details {
  background: rgba(255,255,255,0.65);
  border: 2px solid rgba(61,53,53,0.6);
  border-radius: 8px;
  margin: 8px clamp(8px, 2vw, 14px);
  overflow: hidden;
  box-shadow: 2px 2px 0px rgba(61,53,53,0.3);
}

card > details:nth-of-type(4) details summary {
  padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 14px);
  font-weight: 700;
  font-size: clamp(12px, 3.2vw, 14.5px);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
  position: relative;
  transition: all 0.15s ease;
}

card > details:nth-of-type(4) details summary::-webkit-details-marker {
  display: none;
}

card > details:nth-of-type(4) details summary::after {
  content: "▸";
  position: absolute;
  right: clamp(10px, 2.5vw, 14px);
  font-size: 14px;
  transition: transform 0.2s ease;
}

card > details:nth-of-type(4) details[open] summary::after {
  transform: rotate(90deg);
}

card > details:nth-of-type(4) details[open] summary {
  border-bottom: 1.5px solid rgba(61,53,53,0.15);
}

card > details:nth-of-type(4) details p {
  padding: 0.2em clamp(10px, 2.5vw, 14px);
  font-size: clamp(11.5px, 3vw, 13.5px);
}

/* 锚点记忆 🔒 */
card > details:nth-of-type(4) > details:nth-of-type(1) {
  border-color: #E8A0A0;
}

card > details:nth-of-type(4) > details:nth-of-type(1) summary {
  color: #A04040;
}

/* 里程碑记忆 📌 */
card > details:nth-of-type(4) > details:nth-of-type(2) {
  border-color: #E8CC6D;
}

card > details:nth-of-type(4) > details:nth-of-type(2) summary {
  color: #9E8A2D;
}

/* 长期记忆 📗 */
card > details:nth-of-type(4) > details:nth-of-type(3) {
  border-color: #7ECBA4;
}

card > details:nth-of-type(4) > details:nth-of-type(3) summary {
  color: #3D8E5E;
}

/* 短期记忆 📝 */
card > details:nth-of-type(4) > details:nth-of-type(4) {
  border-color: #7EB8D9;
}

card > details:nth-of-type(4) > details:nth-of-type(4) summary {
  color: #3D6E8E;
}

/* ============================================
   响应式适配
   ============================================ */

/* 小屏手机竖屏 (≤380px) */
@media screen and (max-width: 380px) {
  card {
    padding: 8px;
  }

  env {
    border-width: 2px;
    box-shadow: 2px 2px 0px #3D3535;
    padding: 6px 10px;
  }

  text {
    border-width: 2px;
    box-shadow: 2px 2px 0px #3D3535;
    padding: 10px;
  }

  card > details {
    border-width: 2px;
    box-shadow: 2px 2px 0px #3D3535;
  }

  actions p {
    border-width: 2px;
    box-shadow: 2px 2px 0px #3D3535;
    padding: 10px;
  }

  text .syg,
  text .d {
    border-left-width: 3px;
    box-shadow: 1.5px 1.5px 0px currentColor;
    padding: 6px 8px;
  }
}

/* 平板及大屏 (≥768px) */
@media screen and (min-width: 768px) {
  card {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
  }

  env {
    padding: 14px 22px;
    font-size: 15px;
    letter-spacing: 1px;
  }

  text {
    padding: 24px 22px;
    border-radius: 14px;
  }

  card > details > summary {
    padding: 14px 20px;
  }

  actions p {
    padding: 14px 20px;
    font-size: 16px;
  }

  text .syg,
  text .d {
    padding: 12px 18px;
    border-radius: 0 12px 12px 0;
  }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 500px) {
  card {
    padding: 8px 16px;
  }

  env {
    margin-bottom: 10px;
    padding: 6px 14px;
  }

  text {
    padding: 10px 14px;
    margin-bottom: 10px;
  }

  card > details {
    margin-bottom: 8px;
  }

  card > details > summary {
    min-height: 40px;
    padding: 8px 14px;
  }

  actions p {
    min-height: 40px;
    padding: 8px 14px;
    margin-bottom: 6px;
  }
}

/* ---------- 触摸优化 ---------- */
@media (pointer: coarse) {
  card > details > summary,
  card > details:nth-of-type(4) details summary,
  actions p {
    min-height: 44px;
  }

  actions p:active {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px #3D3535;
  }
}

/* ---------- 动效偏好尊重 ---------- */
@media (prefers-reduced-motion: reduce) {
  actions p,
  actions p::before,
  card > details > summary::after,
  card > details:nth-of-type(4) details summary::after {
    transition: none;
  }
}
