/* =========================================
   游戏入口页面专用样式 (Games Entry)
   所有类名以 .games-entry- 开头
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

.games-entry-container {
  --games-entry-font-pixel: 'DotGothic16', sans-serif;
  --games-entry-bg-color: #F7F3E8;
  --games-entry-text-black: #000000;
  --games-entry-text-gray-500: #6b7280;
  --games-entry-text-gray-400: #9ca3af;

  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  font-family: var(--games-entry-font-pixel);
  background-color: var(--games-entry-bg-color);
  /* 禁止选中和触摸默认行为 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* 游戏入口视图 */
.games-entry-view {
  position: absolute;
  inset: 0;
  z-index: 50;
  background-color: var(--games-entry-bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3rem;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 2rem;
}

/* 像素熊图标容器 */
.games-entry-icon-container {
  width: 6rem;
  height: 6rem;
  border: 4px solid var(--games-entry-text-black);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.games-entry-icon-scaler {
  transform: scale(2.0);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 标题 */
.games-entry-title {
  font-size: 2.25rem;
  color: var(--games-entry-text-black);
  letter-spacing: 0.1em;
  margin-top: 1rem;
  font-weight: normal;
  font-family: var(--games-entry-font-pixel);
}

/* 副标题 */
.games-entry-subtitle {
  color: var(--games-entry-text-gray-500);
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  line-height: 1.5;
  font-family: var(--games-entry-font-pixel);
}

/* 开始按钮 */
.games-entry-btn-start {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--games-entry-text-black);
  color: #ffffff;
  padding: 0.75rem 3rem;
  font-size: 1.125rem;
  font-family: var(--games-entry-font-pixel);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.1s;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.games-entry-btn-start:hover {
  background-color: #1f2937;
}

.games-entry-btn-start:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

/* 操作说明 */
.games-entry-instructions {
  font-size: 0.75rem;
  color: var(--games-entry-text-gray-400);
  margin-top: 1rem;
  text-align: center;
  line-height: 1.5;
  font-family: var(--games-entry-font-pixel);
}
/* =========================================
   游戏进行页面专用样式 (Games Play)
   所有类名以 .games-play- 开头
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

.games-play-container {
  --games-play-font-pixel: 'DotGothic16', sans-serif;
  --games-play-bg-color: #F7F3E8;
  --games-play-text-black: #000000;
  --games-play-text-white: #ffffff;
  --games-play-text-gray-600: #4b5563;

  position: fixed;
  inset: 0;
  background-color: var(--games-play-bg-color);
  overflow: hidden;
  cursor: crosshair;
  font-family: var(--games-play-font-pixel);
  /* 禁止选中和触摸默认行为 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* 画布样式 */
.games-play-canvas {
  display: block;
  image-rendering: pixelated; /* 强制像素化渲染 */
}

/* 退出按钮 */
.games-play-btn-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--games-play-text-black);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s;
  pointer-events: auto;
}

.games-play-btn-close:hover {
  transform: scale(1.1);
}

/* 弹窗遮罩层基础样式 */
.games-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: auto;
  color: var(--games-play-text-black);
}

.games-play-overlay.hidden {
  display: none;
}

.games-play-pointer-events-none {
  pointer-events: none;
}

/* 跌落重生提示 */
.games-play-respawn-text {
  position: absolute;
  top: 33.333%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: 0.1em;
  animation: games-play-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Game Over 遮罩 */
.games-play-bg-white-90 {
  background-color: rgba(255, 255, 255, 0.9);
  animation: games-play-fade-in 0.3s ease-out;
}

/* Game Won 遮罩 */
.games-play-bg-beige {
  background-color: var(--games-play-bg-color);
  animation: games-play-zoom-in 0.5s ease-out;
}

/* 弹窗标题 */
.games-play-overlay-title {
  font-size: 1.875rem;
  margin-bottom: 1rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  font-family: var(--games-play-font-pixel);
}

/* 弹窗描述 */
.games-play-overlay-desc {
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--games-play-text-gray-600);
  text-align: center;
  padding: 0 2rem;
  line-height: 2;
  font-family: var(--games-play-font-pixel);
}

/* 弹窗按钮组 */
.games-play-overlay-actions {
  display: flex;
  gap: 1rem;
}

/* 按钮样式 */
.games-play-btn-outline {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--games-play-text-black);
  background-color: transparent;
  color: var(--games-play-text-black);
  font-family: var(--games-play-font-pixel);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.games-play-btn-outline:hover {
  background-color: var(--games-play-text-black);
  color: var(--games-play-text-white);
}

.games-play-btn-solid {
  padding: 0.5rem 1.5rem;
  background-color: var(--games-play-text-black);
  color: var(--games-play-text-white);
  border: none;
  font-family: var(--games-play-font-pixel);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.games-play-btn-solid:hover {
  background-color: #1f2937;
}

.games-play-btn-large {
  padding: 0.75rem 2.5rem;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.games-play-btn-large:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

/* 奖杯图标容器 */
.games-play-trophy-icon-wrapper {
  margin-bottom: 1.5rem;
  position: relative;
  color: var(--games-play-text-black);
}

/* 动画定义 */
@keyframes games-play-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes games-play-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes games-play-zoom-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
/* =========================================
   小贝页面专用样式 (Me / Xiao Bei)
   所有类名以 .me- 开头
   ========================================= */

.me-container {
  --me-bg-color: #fff1f2;
  --me-bg-white: #ffffff;
  --me-text-dark: #1f2937;
  --me-text-gray: #6b7280;
  --me-text-light: #9ca3af;
  --me-rose-50: #fff1f2;
  --me-rose-100: #ffe4e6;
  --me-rose-200: #fecdd3;
  --me-rose-400: #fb7185;
  --me-rose-500: #f43f5e;
  --me-rose-600: #e11d48;
  --me-pink-100: #fce7f3;
  --me-pink-500: #ec4899;
  --me-amber-100: #fef3c7;
  --me-amber-300: #fcd34d;
  --me-amber-500: #f59e0b;
  --me-blue-100: #dbeafe;
  --me-blue-500: #3b82f6;
  --me-gray-100: #f3f4f6;

  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--me-bg-color);
}

/* --- 主页面 --- */
.me-profile-header {
  padding: 4rem 1.5rem 2.5rem;
  background-color: var(--me-bg-white);
  border-radius: 0 0 40px 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.me-avatar {
  width: 6rem;
  height: 6rem;
  background-color: var(--me-rose-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 4px solid var(--me-bg-white);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}

.me-avatar-face {
  width: 5rem;
  height: 5rem;
  background-color: var(--me-rose-400);
  border-radius: 50%;
  position: relative;
  top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.me-avatar-eyes {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.me-avatar-eye {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--me-rose-50);
  border-radius: 50%;
}

.me-avatar-mouth {
  width: 0.75rem;
  height: 0.5rem;
  background-color: var(--me-rose-50);
  border-radius: 50%;
}

.me-avatar-ears {
  position: absolute;
  top: 0.75rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.me-avatar-ear {
  width: 2rem;
  height: 2rem;
  background-color: var(--me-rose-400);
  border-radius: 50%;
}

.me-username {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--me-text-dark);
  font-family: 'Noto Serif SC', serif;
}

.me-user-id {
  color: var(--me-rose-400);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

/* 菜单列表 */
.me-menu-list {
  flex: 1;
  padding: 2rem 1.5rem 6rem;
  overflow-y: auto;
}

.me-menu-list::-webkit-scrollbar {
  display: none;
}

.me-menu-item {
  background-color: var(--me-bg-white);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.me-menu-item:active {
  transform: scale(0.98);
}

.me-menu-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.me-menu-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.me-menu-icon.pink {
  background-color: var(--me-pink-100);
  color: var(--me-pink-500);
}

.me-menu-icon.amber {
  background-color: var(--me-amber-100);
  color: var(--me-amber-500);
}

.me-menu-icon.blue {
  background-color: var(--me-blue-100);
  color: var(--me-blue-500);
}

.me-menu-icon.gray {
  background-color: var(--me-gray-100);
  color: var(--me-text-gray);
}

.me-menu-icon.rose {
  background-color: var(--me-rose-100);
  color: var(--me-rose-500);
}

.me-menu-text {
  color: var(--me-text-dark);
  font-weight: 500;
  font-size: 0.875rem;
}

.me-menu-arrow {
  color: var(--me-text-light);
  font-size: 1.25rem;
}

.me-menu-divider {
  margin-top: 2rem;
}

/* --- 关于页面 --- */
.me-about-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--me-bg-white);
  animation: me-slide-in 0.3s ease-out;
}

@keyframes me-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.me-about-header {
  padding: 3rem 1.5rem 1.5rem;
  background-color: var(--me-rose-50);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.me-back-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--me-bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--me-text-gray);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.me-back-btn:active {
  transform: scale(0.95);
}

.me-about-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--me-text-dark);
  font-family: 'Noto Serif SC', serif;
}

.me-about-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.me-icon-preview {
  position: relative;
  cursor: pointer;
  margin-bottom: 2rem;
}

.me-icon-preview-box {
  width: 12rem;
  height: 12rem;
  background-color: var(--me-rose-50);
  border-radius: 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--me-rose-100);
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.me-icon-preview-box:hover {
  transform: scale(1.05);
}

.me-icon-preview-box:active {
  transform: scale(0.95);
}

.me-icon-flower {
  width: 100%;
  height: 100%;
  padding: 0.5rem;
}

.me-icon-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 48px;
}

.me-icon-preview:hover .me-icon-hover-overlay {
  opacity: 1;
}

.me-icon-download-hint {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--me-rose-400);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.me-app-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--me-text-dark);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.me-app-version {
  color: var(--me-text-light);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.me-app-desc {
  color: var(--me-text-gray);
  line-height: 2;
  font-size: 0.875rem;
  max-width: 20rem;
  font-family: 'Noto Serif SC', serif;
}

.me-app-copyright {
  padding-top: 3rem;
  font-size: 0.625rem;
  color: var(--me-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 隐藏状态 */
.me-hidden {
  display: none !important;
}
/* =========================================
   读诗页面专用样式 (Read Tab)
   所有类名以 .read- 开头，避免全局冲突
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');

.read-container {
  --read-font-serif: 'Noto Serif SC', serif;
  --read-bg-color: #FFF0F5;
  --read-paper-bg: #F7F3E8;
  --read-text-dark: #3D332A;
  --read-text-muted: #8A7F70;
  --read-text-rose: #881337;

  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--read-bg-color);
  position: relative;
  font-family: var(--read-font-serif);
}

.read-svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.read-view-layer {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
}

.read-view-layer.hidden {
  display: none;
}

/* --- List View Styles --- */
.read-list-header {
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background-color: var(--read-bg-color);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.read-header-title {
  font-size: 1.875rem;
  font-weight: bold;
  color: #4c0519;
  letter-spacing: -0.025em;
}

.read-header-subtitle {
  font-size: 0.75rem;
  color: rgba(190, 18, 60, 0.6);
  margin-top: 0.5rem;
  letter-spacing: 0.025em;
}

.read-header-icon {
  font-size: 2.25rem;
  opacity: 0.2;
  transform: rotate(12deg);
  user-select: none;
}

.read-list-content {
  padding: 1rem 1rem 0 1rem;
  overflow-y: auto;
  flex: 1;
}

.read-list-footer {
  text-align: center;
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.6;
}

.read-list-footer .read-dot {
  width: 4px;
  height: 4px;
  background-color: #fda4af;
  border-radius: 50%;
}

.read-list-footer span {
  font-size: 0.75rem;
  color: #fb7185;
  font-style: italic;
}

/* Poet Card */
.read-poet-card {
  position: relative;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
  cursor: pointer;
}

.read-poet-card-inner {
  position: relative;
  padding: 1.5rem;
  transition: transform 0.5s ease-out;
}

.read-poet-card:hover .read-poet-card-inner {
  transform: scale(1.02);
}

.read-poet-card:active .read-poet-card-inner {
  transform: scale(0.98);
}

.read-paper-bg {
  position: absolute;
  inset: 0;
  background-color: var(--read-paper-bg);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  filter: url(#dongba-pulp-edge) drop-shadow(0px 8px 16px rgba(103, 90, 80, 0.1));
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23noise)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  margin: 8px;
  transition: box-shadow 0.3s;
}

.read-poet-card:hover .read-paper-bg {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.read-card-content {
  position: relative;
  z-index: 20;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.read-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px dashed #DACFB3;
  padding-bottom: 0.75rem;
}

.read-card-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.read-card-index {
  font-size: 2.25rem;
  font-weight: bold;
  color: #E6DCC8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
  user-select: none;
}

.read-card-names {
  display: flex;
  flex-direction: column;
}

.read-card-name {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--read-text-dark);
  letter-spacing: 0.1em;
}

.read-card-en-name {
  font-size: 10px;
  color: var(--read-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

.read-btn-arrow {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #DACFB3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A09585;
  transition: background-color 0.3s, color 0.3s;
}

.read-poet-card:hover .read-btn-arrow {
  background-color: #F3EFE7;
  color: #D14436;
}

.read-card-desc {
  margin-bottom: 1.5rem;
}

.read-card-desc p {
  color: #5C5046;
  font-size: 0.875rem;
  line-height: 1.625;
  text-align: justify;
  opacity: 0.9;
}

.read-card-quote {
  background-color: rgba(239, 232, 216, 0.5);
  padding: 1rem;
  border-radius: 2px;
  position: relative;
  margin-bottom: 0.5rem;
}

.read-quote-mark {
  position: absolute;
  font-size: 1.5rem;
  color: #C0B3A0;
  line-height: 1;
}

.read-quote-mark.left {
  top: -0.5rem;
  left: 0.5rem;
}

.read-quote-mark.right {
  bottom: -1rem;
  right: 0.5rem;
  transform: rotate(180deg);
}

.read-card-quote p {
  color: #4A3B32;
  font-size: 15px;
  font-style: italic;
  text-align: center;
  line-height: 1.625;
  padding: 0 0.5rem;
}

/* --- Detail View Styles --- */
.read-detail-view {
  z-index: 50;
  background-color: var(--read-bg-color);
  animation: read-fade-in 0.3s ease-out;
}

.read-detail-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5rem;
  z-index: 50;
  background: linear-gradient(to bottom, var(--read-bg-color), rgba(255, 240, 245, 0.9), transparent);
  display: flex;
  align-items: flex-end;
  padding: 0 1.5rem 1rem 1.5rem;
}

.read-btn-back {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9f1239;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.read-btn-back:hover {
  background-color: #fff;
}

.read-btn-back:active {
  transform: scale(0.95);
}

.read-nav-title-container {
  flex: 1;
  text-align: center;
  padding-bottom: 0.5rem;
  padding-right: 2.5rem;
}

.read-nav-title {
  font-weight: bold;
  font-size: 1.125rem;
  color: var(--read-text-dark);
}

.read-poem-scroll-container {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  padding-top: 4rem;
  padding-bottom: 6rem;
}

.read-poem-slide {
  width: 100%;
  height: 85vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.read-poem-card-container {
  position: relative;
  width: 100%;
  max-width: 28rem;
  height: 100%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.read-poem-paper-bg {
  position: absolute;
  inset: 0;
  background-color: var(--read-paper-bg);
  transition: box-shadow 0.3s;
  margin: 12px;
  filter: url(#dongba-pulp-edge) drop-shadow(0px 12px 24px rgba(103, 90, 80, 0.15));
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23noise)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.read-poem-content {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.read-poem-header {
  margin-bottom: 2rem;
  opacity: 0.4;
  flex-shrink: 0;
  text-align: center;
}

.read-poem-header-line {
  width: 4px;
  height: 2rem;
  background-color: var(--read-text-muted);
  margin: 0 auto 0.5rem auto;
}

.read-poem-index {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--read-text-muted);
}

.read-poem-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2C241B;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
  text-align: center;
  flex-shrink: 0;
}

.read-poem-lines {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
}

.read-poem-line {
  color: #4A3B32;
  font-size: 1.125rem;
  line-height: 2;
  text-align: center;
  letter-spacing: 0.05em;
}

.read-poem-actions {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
  opacity: 0.6;
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px dashed #DACFB3;
  width: 50%;
  justify-content: center;
}

.read-btn-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  transition: color 0.2s;
}

.read-btn-action:hover {
  color: #f43f5e;
}

.read-scroll-hint {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  animation: read-bounce 1s infinite;
  opacity: 0.4;
  pointer-events: none;
}

.read-scroll-hint-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.read-scroll-hint-text {
  font-size: 10px;
  color: var(--read-text-rose);
  letter-spacing: 0.1em;
}

.read-scroll-hint-line {
  width: 1px;
  height: 1.5rem;
  background-color: rgba(136, 19, 55, 0.5);
}

.read-end-card {
  width: 100%;
  height: 50vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  opacity: 0.5;
}

.read-end-text {
  color: var(--read-text-rose);
}

/* Animations */
@keyframes read-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes read-bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8,0,1,1);
  }
  50% {
    transform: none;
    animation-timing-function: cubic-bezier(0,0,0.2,1);
  }
}
/* =========================================
   底部 Tab Bar 专用样式
   ========================================= */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(60px + env(safe-area-inset-bottom));
  background-color: var(--tab-bg);
  border-top: 1px solid var(--tab-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(225, 29, 72, 0.05);
}

/* 单个 Tab 项 */
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--tab-inactive);
  flex: 1;
  height: 100%;
  transition: color 0.3s ease, transform 0.2s ease;
}

/* Tab 图标 (SVG) */
.tab-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Tab 文字 */
.tab-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* 激活状态 */
.tab-item.active {
  color: var(--tab-active);
}

.tab-item.active svg {
  transform: translateY(-2px);
}

/* 悬浮状态 (主要针对桌面端) */
@media (hover: hover) {
  .tab-item:hover {
    color: var(--tab-active);
  }
}
/* =========================================
   打字机写诗页面专用样式
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
  --font-serif: 'Noto Serif SC', serif;
  --font-hand: 'Ma Shan Zheng', cursive;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.write-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* 诗歌展示墙 */
.wall-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1rem 16rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wall-area::-webkit-scrollbar { display: none; }
.wall-area { -ms-overflow-style: none; scrollbar-width: none; }

/* 纸条样式 */
.paper-wrapper {
  position: relative;
  margin: 0 auto;
}

.paper-wrapper.wall-item {
  width: 100%;
  max-width: 88%;
  margin-bottom: 2rem;
  transition: transform 0.5s;
}

.paper-wrapper.wall-item:hover {
  transform: scale(1.01);
}

.paper-wrapper.preview {
  width: 100%;
  transform-origin: bottom;
  animation: paper-float 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.paper-body {
  position: relative;
  background-color: #F7F3E8;
  padding: 1.5rem;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.08), inset 0 0 40px rgba(160,140,100,0.1);
  overflow: hidden;
  border-radius: 2px 3px 2px 4px / 4px 2px 3px 2px;
}

.btn-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #C0B3A0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 20;
  transition: color 0.2s;
}

.btn-delete:hover {
  color: #f43f5e;
}

.paper-noise {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 东巴纸毛边效果 */
.paper-edge-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #EBE5CE;
  opacity: 0.5;
  clip-path: polygon(0% 0%, 5% 100%, 10% 0%, 15% 80%, 20% 0%, 25% 100%, 30% 0%, 35% 60%, 40% 0%, 45% 90%, 50% 0%, 55% 70%, 60% 0%, 65% 100%, 70% 0%, 75% 80%, 80% 0%, 85% 90%, 90% 0%, 95% 70%, 100% 0%);
}

.paper-edge-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #DACFB3;
  opacity: 0.4;
  clip-path: polygon(0% 100%, 5% 0%, 10% 100%, 15% 20%, 20% 100%, 25% 10%, 30% 100%, 35% 40%, 40% 100%, 45% 10%, 50% 100%, 55% 30%, 60% 100%, 65% 0%, 70% 100%, 75% 20%, 80% 100%, 85% 10%, 90% 100%, 95% 30%, 100% 100%);
}

.paper-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.paper-date {
  align-self: flex-end;
  margin-bottom: 1rem;
  font-size: 10px;
  color: #8A7F70;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.paper-text-container {
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

.paper-text {
  color: #4A4036;
  font-size: 1rem;
  line-height: 2;
  text-align: center;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 印章 */
.paper-seal-container {
  margin-top: 2rem;
  align-self: flex-end;
  opacity: 0.9;
}

.paper-seal {
  width: 32px;
  height: 32px;
  border: 2px solid #D14436;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transform: rotate(-3deg);
}

.paper-seal-inner {
  width: 100%;
  height: 100%;
  background-color: #D14436;
  color: #F7F3E8;
  font-size: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-hand);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 打字机容器 - 调整位置避免与Tab Bar重叠 */
.typewriter-container {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
  z-index: 20;
}

.typewriter-wrapper {
  position: relative;
  width: 100%;
  max-width: 24rem;
  pointer-events: auto;
}

.animation-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 2.5rem;
  width: 16rem;
  display: flex;
  justify-content: center;
  z-index: 0;
  perspective: 1000px;
}

/* 打字机机身 */
.machine-body {
  position: relative;
  z-index: 10;
  padding-top: 1.5rem;
}

.paper-exit-slot {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 10rem;
  height: 1rem;
  background-color: #2D2D2D;
  border-radius: 9999px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.2);
  z-index: 0;
}

.chassis {
  background-color: #F3EFE7;
  border-radius: 36px;
  padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(80,50,50,0.25), inset 0 4px 12px rgba(255,255,255,0.9), inset 0 -10px 30px rgba(200,190,170,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
}

.top-highlight {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 4px;
  background-color: rgba(255,255,255,0.6);
  border-radius: 9999px;
  filter: blur(1px);
}

/* 屏幕区域 */
.screen-bezel {
  background-color: #2C2C2C;
  border-radius: 24px;
  padding: 0.625rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.1);
  position: relative;
  z-index: 10;
}

.screen-inner {
  background-color: #1a1a1a;
  border-radius: 18px;
  height: 7rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(75,85,99,0.5);
  box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
}

.scanline {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%), linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.2;
}

#mainTextarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f59e0b;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  resize: none;
  line-height: 1.625;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 20;
}

#mainTextarea::placeholder {
  color: #374151;
}

.cursor-block {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 8px;
  height: 16px;
  background-color: rgba(245,158,11,0.5);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.cursor-block.hidden {
  opacity: 0;
  animation: none;
}

.btn-expand {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #4b5563;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 30;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.btn-expand:hover {
  color: #fff;
  opacity: 1;
}

/* 底部按钮区域 */
.bumper-area {
  margin-top: 1.25rem;
  background-color: #EAE6DA;
  border-radius: 24px;
  padding: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 1px 0 rgba(255,255,255,0.5);
  height: 42px;
}

.btn-control {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: #E5E5E5;
  box-shadow: 0 3px 0 #B0B0B0, 0 4px 4px rgba(0,0,0,0.1);
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-control:active {
  box-shadow: none;
  transform: translateY(3px);
}

#btnClear:hover {
  color: #fb7185;
}

#btnInspire:hover {
  color: #a855f7;
}

#btnInspire.spinning svg {
  animation: spin 1s linear infinite;
}

/* 打印按钮 */
.btn-print {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-print:disabled {
  opacity: 0.7;
  filter: grayscale(0.3);
  cursor: not-allowed;
}

.btn-print:not(:disabled):hover {
  transform: scale(1.05);
}

.btn-print:not(:disabled):active {
  transform: scale(0.95);
}

.btn-print-housing {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(to bottom, #e5e7eb, #9ca3af);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-print-body {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #FF4D4D, #D10000);
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.4), inset 0 -2px 5px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-print:not(:disabled):active .btn-print-body {
  inset: 4px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.4);
}

.btn-print-body span {
  color: #fff;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 24rem;
  height: 60vh;
  background-color: #F7F3E8;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  border: 4px solid #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background-color: #EAE6DA;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D6CDB8;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fb7185;
}

.modal-title span {
  font-family: var(--font-serif);
  color: #4A3B32;
  font-weight: bold;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.btn-close {
  color: #8A7F70;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close:hover {
  color: #D14436;
}

.modal-body {
  flex: 1;
  padding: 1.5rem;
  position: relative;
}

.lines-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 100% 32px;
  margin-top: 30px;
}

#expandedTextarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: #2C241B;
  line-height: 2;
  letter-spacing: 0.05em;
}

#expandedTextarea::placeholder {
  color: #d1d5db;
}

.modal-footer {
  padding: 1rem;
  background-color: #F3EFE7;
  border-top: 1px solid #EAE6DA;
  display: flex;
  justify-content: flex-end;
}

.btn-done {
  padding: 0.5rem 1.5rem;
  background-color: #2C2C2C;
  color: #fff;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: bold;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-done:hover {
  background-color: #000;
}

.btn-done:active {
  transform: scale(0.95);
}

/* 动画 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes paper-float {
  0% { transform: translateY(100%) scale(0.9); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-120%) scale(1) rotate(-2deg); opacity: 1; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* =========================================
   全局 CSS 变量定义
   ========================================= */
:root {
  --bg-color: #fff1f2;
  --text-main: #4c0519;
  --tab-bg: #ffffff;
  --tab-active: #e11d48;
  --tab-inactive: #fda4af;
  --tab-border: #ffe4e6;
}

/* =========================================
   基础重置
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Noto Serif SC', serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   布局
   ========================================= */
.main-content {
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding-bottom: calc(65px + env(safe-area-inset-bottom));
}

/* =========================================
   页面占位样式
   ========================================= */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  opacity: 0.6;
}

.placeholder-page h1 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 700;
}

.placeholder-page p {
  font-size: 14px;
}
