/* ==========================================================================
   治愈系 2D 动画书桌 - 6大功能交互弹窗样式 (modals.css)
   吉卜力复古羊皮纸 / 手账信笺 / 治愈暖木质感
   ========================================================================== */

.hidden {
  display: none !important;
}

/* 全屏遮罩模态框容器 */
.app-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 12, 10, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: modalFadeIn 0.3s ease;
}

/* 核心通用弹窗卡片基类 */
.modal-card {
  position: relative;
  background: #FFFDF5;
  border: 4px solid #C48B58;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(196, 139, 88, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: cardSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 2px dashed #E5DCCE;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FDF9EE;
}

.modal-title {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'PingFang SC', serif;
  font-size: 22px;
  font-weight: bold;
  color: #4A280E;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: #F2E8DC;
  border: 1px solid #D5C8B8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: #7A5332;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #E74C3C;
  color: #FFFFFF;
  border-color: #C0392B;
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* ==========================================================================
   1. 📚 故事书本选择菜单 (Story Menu Modal)
   ========================================================================== */
#story-menu-modal .modal-card {
  width: 480px;
}

.story-menu-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 15px 0;
}

.story-opt-btn {
  background: linear-gradient(145deg, #FFFDF7, #F8F1E2);
  border: 2px solid #D8C3A5;
  border-radius: 16px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.story-opt-btn:hover {
  transform: translateY(-6px);
  border-color: #8C582B;
  box-shadow: 0 12px 24px rgba(140, 88, 43, 0.2);
}

.story-opt-icon {
  font-size: 38px;
}

.story-opt-title {
  font-size: 17px;
  font-weight: bold;
  color: #4A280E;
}

.story-opt-desc {
  font-size: 12px;
  color: #8C6D53;
  text-align: center;
  line-height: 1.4;
}

/* ==========================================================================
   故事星空全屏宇宙 (Story Starfield Canvas Modal)
   ========================================================================== */
#story-starfield-modal {
  padding: 0;
  background: #000;
}

#starfield-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.starfield-overlay-ui {
  position: absolute;
  top: 25px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.starfield-title-badge {
  pointer-events: auto;
  background: rgba(20, 25, 45, 0.75);
  backdrop-filter: blur(12px);
  padding: 10px 24px;
  border-radius: 30px;
  border: 1px solid rgba(116, 185, 255, 0.4);
  color: #EBF5FB;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 20px rgba(116, 185, 255, 0.2);
}

.starfield-actions {
  pointer-events: auto;
  display: flex;
  gap: 12px;
}

/* 摘取的羊皮纸故事卡片 */
#story-card-modal .modal-card {
  width: 480px;
  background: #FFFDF0 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><line x1="0" y1="39" x2="40" y2="39" stroke="%23E8DFCD" stroke-width="1"/></svg>');
  border: 3px solid #8C582B;
}

.story-card-body {
  padding: 24px;
  line-height: 1.8;
  font-size: 15px;
  color: #382414;
  white-space: pre-wrap;
  min-height: 140px;
}

.story-card-footer {
  padding: 15px 24px;
  background: #FDF7E7;
  border-top: 1px solid #E8DFCD;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-like {
  background: #FFF;
  border: 1px solid #FADBD8;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: #E74C3C;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-like:hover {
  background: #FDEDEC;
  transform: scale(1.08);
}

.btn-like.liked {
  background: linear-gradient(135deg, #FF7675, #D63031);
  color: #FFFFFF;
  border-color: #D63031;
  box-shadow: 0 4px 14px rgba(214, 48, 49, 0.35);
  cursor: default;
}

/* 故事撰写录入表单 */
#story-editor-modal .modal-card {
  width: 520px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #5A3514;
  margin-bottom: 6px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #D5C8B8;
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 14px;
  color: #332211;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
  border-color: #8C582B;
  box-shadow: 0 0 0 3px rgba(140, 88, 43, 0.15);
}

.form-textarea {
  height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5A3514;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #27AE60, #1E8449);
  color: #FFF;
  border: none;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
  transition: all 0.25s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2ECC71, #27AE60);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

/* ==========================================================================
   2. 🖼️ 相册管理弹窗 (Photo Album Modal)
   ========================================================================== */
#photo-album-modal .modal-card {
  width: 640px;
}

.photo-album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.album-item-card {
  position: relative;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #E5DCCE;
  cursor: pointer;
  transition: all 0.25s ease;
}

.album-item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-item-card .photo-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #FFF;
  font-size: 11px;
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-item-card.active {
  border-color: #27AE60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.4);
  transform: scale(1.03);
}

.btn-del-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(231, 76, 60, 0.9);
  color: #FFF;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
}

.photo-upload-zone {
  border: 2px dashed #C48B58;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: #FFFDF8;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-upload-zone:hover, .photo-upload-zone.drag-over {
  background: #FAF0DC;
  border-color: #8C582B;
}

/* ==========================================================================
   3. ⏰ 做题计时计数助手 (Timer Counter Modal)
   ========================================================================== */
#timer-counter-modal .modal-card {
  width: 600px;
}

.tab-nav-container {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #E5DCCE;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 20px;
  background: #F4EBE1;
  border: 1px solid #D8C3A5;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #5A3514;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #8C582B;
  color: #FFFFFF;
  border-color: #5A3514;
}

.timer-hero-card {
  background: linear-gradient(145deg, #FFFDF8, #F8F1E2);
  border: 2px solid #E2D2BC;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: inset 0 0 15px rgba(140, 88, 43, 0.05);
}

.timer-time-display {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 52px;
  font-weight: bold;
  color: #2C3E50;
  margin: 10px 0;
  letter-spacing: 2px;
}

.timer-control-matrix {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
}

.timer-btn {
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  color: #FFF;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-start { background: #27AE60; }
.btn-start:hover { background: #2ECC71; }
.btn-pause { background: #E67E22; }
.btn-pause:hover { background: #F39C12; }
.btn-finish { background: #2980B9; }
.btn-finish:hover { background: #3498DB; }
.btn-reset { background: #C0392B; }
.btn-reset:hover { background: #E74C3C; }
.timer-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 题目计数器矩阵 */
.counter-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF;
  border: 2px solid #E2D2BC;
  border-radius: 16px;
  padding: 16px 24px;
}

.counter-value-main {
  font-size: 54px;
  font-weight: bold;
  color: #2980B9;
  line-height: 1;
}

.counter-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-matrix-plus {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #2980B9;
  color: #FFF;
  font-size: 26px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(41, 128, 185, 0.3);
  transition: all 0.2s;
}

.btn-matrix-plus:hover { transform: scale(1.05); background: #3498DB; }

.btn-matrix-discard {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #E67E22;
  color: #FFF;
  font-size: 18px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(230, 126, 34, 0.3);
  transition: all 0.2s;
}

.btn-matrix-discard:hover { transform: scale(1.05); background: #D35400; }

.btn-matrix-minus {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #7F8C8D;
  color: #FFF;
  font-size: 18px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-matrix-minus:hover { background: #95A5A6; }

/* 历史日志列表 */
.timer-logs-container {
  max-height: 320px;
  overflow-y: auto;
}

.timer-log-card {
  background: #FFF;
  border: 1px solid #E5DCCE;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-date { font-size: 14px; font-weight: bold; color: #2C3E50; }
.log-timespan { font-size: 12px; color: #7F8C8D; }
.log-questions strong { color: #2980B9; }
.log-discard { font-size: 12px; color: #E67E22; margin-left: 4px; }
.log-pace-badge { background: #EBF5FB; color: #2980B9; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.btn-del-log { background: none; border: none; font-size: 18px; color: #E74C3C; cursor: pointer; margin-left: 10px; }

/* ==========================================================================
   4. 🪴 桌面绿植养护面板 (Plant Garden Modal)
   ========================================================================== */
#plant-modal .modal-card {
  width: 580px;
}

.plant-interactive-stage {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #F4F9F4;
  border: 2px solid #D5E8D4;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.modal-plant-preview-wrap {
  width: 140px;
  height: 160px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-plant-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plant-status-col {
  flex: 1;
}

.plant-progress-bar {
  width: 100%;
  height: 14px;
  background: #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
  margin: 6px 0 12px;
}

.plant-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #58D68D, #27AE60);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.btn-water-action {
  background: linear-gradient(135deg, #3498DB, #2980B9);
  color: #FFF;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
  transition: all 0.2s;
}

.btn-water-action:hover {
  background: linear-gradient(135deg, #5DADE2, #3498DB);
  transform: translateY(-2px);
}

.plant-variety-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.plant-select-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFF;
  border: 2px solid #E5DCCE;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.plant-select-card:hover {
  border-color: #27AE60;
  background: #F4FAF4;
}

.plant-select-card.selected {
  border-color: #27AE60;
  background: #E8F8F5;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

.plant-card-preview {
  width: 48px;
  height: 48px;
}

.plant-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plant-card-details .plant-name { font-size: 14px; font-weight: bold; color: #2C3E50; }
.plant-card-details .plant-desc { font-size: 11px; color: #7F8C8D; margin-bottom: 3px; }
.plant-card-moisture-badge {
  display: inline-block;
  background: #EBF5FB;
  color: #2980B9;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(41, 128, 185, 0.2);
}

/* ==========================================================================
   5. 📅 实时日历与签到打卡 (Calendar Modal)
   ========================================================================== */
#calendar-modal .modal-card {
  width: 760px;
  max-width: 95vw;
}

.cal-month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.cal-nav-btn {
  background: #F2E8DC;
  border: 1px solid #D5C8B8;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background: #E8DCCB;
  border-color: #B57338;
}

.calendar-weekdays-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  color: #7A5332;
  margin-bottom: 10px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.cal-day-cell {
  min-height: 68px;
  background: #FFF;
  border: 1px solid #E5DCCE;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 4px 2px;
}

.cal-day-cell:hover {
  background: #FAF0DC;
  border-color: #C48B58;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(196, 139, 88, 0.18);
}

.cal-day-cell.is-today {
  border: 2px solid #C0392B;
  background: #FDEDEC;
}

.cal-day-cell .day-number {
  font-size: 17px;
  font-weight: bold;
  color: #332211;
  line-height: 1.1;
}

.cal-day-cell .lunar-text {
  font-size: 11px;
  color: #8C6D53;
  line-height: 1.2;
  margin-top: 3px;
  white-space: nowrap;
}

.cal-day-cell .lunar-text.is-festival {
  color: #C0392B;
  font-weight: bold;
}

.cal-day-cell.has-stamp .stamp-icon {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 13px;
  line-height: 1;
}

/* ==========================================================================
   7. 📖 治愈本地手账日记本 (Local Diary Modal)
   ========================================================================== */
#local-diary-modal .modal-card {
  width: 940px;
  max-width: 95vw;
  height: 620px;
  max-height: 90vh;
}

.diary-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: calc(100% - 20px);
  padding: 10px 0;
}

/* 左侧日记时间轴列表 */
.diary-sidebar {
  display: flex;
  flex-direction: column;
  background: #F8F3E6;
  border-radius: 14px;
  border: 1px solid #E5DCCE;
  padding: 14px;
  overflow: hidden;
}

.diary-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #D5C8B8;
}

.diary-sidebar-title {
  font-family: 'Ma Shan Zheng', 'KaiTi', serif;
  font-size: 16px;
  font-weight: bold;
  color: #4A280E;
}

.diary-timeline-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.diary-item-card {
  background: #FFFDF9;
  border: 1px solid #E2D7C5;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.diary-item-card:hover {
  border-color: #C48B58;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(196, 139, 88, 0.15);
}

.diary-item-card.active {
  background: #FFF9ED;
  border: 2px solid #B57338;
  box-shadow: 0 4px 12px rgba(181, 115, 56, 0.2);
}

.diary-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.diary-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.diary-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.3;
  flex-shrink: 0;
}

.diary-status-pill.pill-public {
  background: #E8F8F5;
  color: #16A085;
  border: 1px solid #A3E4D7;
}

.diary-status-pill.pill-private {
  background: #FEF9E7;
  color: #B7950B;
  border: 1px solid #F9E79F;
}

.diary-card-title {
  font-weight: bold;
  font-size: 14px;
  color: #3B200B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.diary-card-mood {
  font-size: 11px;
  background: #F0E6D8;
  padding: 2px 6px;
  border-radius: 12px;
  color: #6D4C2F;
}

.diary-card-preview {
  font-size: 12px;
  color: #7A6049;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-card-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9C826C;
}

.diary-empty-hint {
  text-align: center;
  padding: 40px 10px;
  color: #8C6D53;
}

/* 右侧信笺阅读/编辑区 */
.diary-main-pane {
  background: #FFFDF8;
  border: 1px solid #E5DCCE;
  border-radius: 14px;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 0 15px rgba(196, 139, 88, 0.05);
}

.diary-view-header {
  border-bottom: 2px solid #EFE4D2;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.diary-view-title {
  font-family: 'Ma Shan Zheng', 'KaiTi', serif;
  font-size: 24px;
  color: #4A280E;
  margin-bottom: 8px;
}

.diary-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #8C6D53;
  align-items: center;
}

.diary-view-meta .meta-tag {
  background: #F2E8DC;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
}

.diary-view-meta .meta-tag.meta-tag-public {
  background: #E8F8F5;
  color: #117A65;
  border: 1px solid #A2D9CE;
}

.diary-view-meta .meta-tag.meta-tag-private {
  background: #FEF9E7;
  color: #9A7D0A;
  border: 1px solid #F7DC6F;
}

.btn-publish-star-action {
  background: linear-gradient(135deg, #F39C12, #E67E22) !important;
  color: #FFF !important;
  border: none !important;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-publish-star-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.45);
}

.diary-view-body {
  flex: 1;
  font-size: 15px;
  line-height: 1.8;
  color: #3D2918;
  padding: 8px 0;
}

.diary-paragraph {
  margin-bottom: 14px;
  text-indent: 2em;
}

.diary-view-footer {
  border-top: 1px dashed #E5DCCE;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* 编辑表单面板 */
.diary-edit-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.diary-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.diary-edit-textarea {
  flex: 1;
  min-height: 220px;
  width: 100%;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #D5C8B8;
  border-radius: 10px;
  background: #FCF9F2;
  color: #332211;
  resize: vertical;
  box-sizing: border-box;
}

.diary-edit-textarea:focus {
  outline: none;
  border-color: #B57338;
  background: #FFF;
}

/* ==========================================================================
   6.5 🐱 专属猫咪初次领养仪式模态框 (Cat Adoption Modal)
   ========================================================================== */
.cat-adopt-modal-card {
  width: 780px;
  max-width: 95vw;
  max-height: 90vh;
  background: #FFFDF9;
  border-color: #E67E22;
}

.adopt-modal-body {
  padding: 24px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.adopt-guide-header {
  text-align: center;
}

.adopt-guide-title {
  font-size: 20px;
  font-weight: bold;
  color: #4A280E;
  margin-bottom: 6px;
}

.adopt-guide-sub {
  font-size: 13px;
  color: #7F8C8D;
  line-height: 1.4;
}

.cat-breed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 6px 0;
}

.cat-breed-card {
  background: #FFF;
  border: 2.5px solid #E5DCCE;
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.cat-breed-card:hover {
  transform: translateY(-4px);
  border-color: #F39C12;
  box-shadow: 0 8px 20px rgba(243, 156, 18, 0.2);
}

.cat-breed-card.selected {
  border-color: #E67E22;
  background: #FFF8F0;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.25), 0 8px 24px rgba(230, 126, 34, 0.2);
  transform: translateY(-3px);
}

.breed-badge {
  font-size: 12px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 10px;
  background: #FEF5E7;
  color: #D35400;
  margin-bottom: 10px;
}

.breed-avatar-box {
  width: 110px;
  height: 85px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.breed-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.cat-breed-card:hover .breed-avatar-box img {
  transform: scale(1.08);
}

.breed-name {
  font-size: 16px;
  font-weight: bold;
  color: #2C3E50;
  margin-bottom: 6px;
}

.breed-traits {
  font-size: 11.5px;
  color: #7F8C8D;
  line-height: 1.35;
}

.adopt-naming-section {
  background: linear-gradient(135deg, #FFF9F2, #FDF2E9);
  border: 1.5px solid #F5CBA7;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adopt-naming-label {
  font-size: 14px;
  font-weight: bold;
  color: #5A3514;
}

.adopt-input-row input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5DCCE;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #2C3E50;
  background: #FFF;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.adopt-input-row input:focus {
  border-color: #E67E22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.btn-confirm-adopt {
  background: linear-gradient(135deg, #E67E22, #D35400);
  color: #FFF;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(211, 84, 0, 0.3);
  transition: all 0.2s ease;
  text-align: center;
}

.btn-confirm-adopt:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 84, 0, 0.4);
}

/* ==========================================================================
   7. 🐱 三花小猫养护与等级成长面板 (Cat Care Modal)
   ========================================================================== */
.cat-modal-card {
  width: 820px;
  max-width: 94vw;
  max-height: 92vh;
  background: #FFFDF9;
}

.cat-modal-card .modal-body {
  padding: 22px 28px;
  overflow-y: auto;
}

/* 小猫档案横幅 */
.cat-profile-banner {
  display: flex;
  align-items: center;
  gap: 22px;
  background: linear-gradient(135deg, #FFF5EB, #FDEBD0);
  border: 2px solid #F5CBA7;
  border-radius: 20px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(245, 203, 167, 0.35);
}

.cat-avatar-wrap {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #FFF;
  border-radius: 50%;
  border: 4px solid #EDBB99;
  box-shadow: 0 6px 18px rgba(237, 187, 153, 0.45);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.cat-avatar-wrap:hover {
  transform: scale(1.05);
}

.cat-avatar-wrap img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: transform 0.2s;
}

.cat-pet-heart {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 22px;
  opacity: 0;
  transition: all 0.3s;
}

.cat-avatar-wrap:hover .cat-pet-heart {
  opacity: 1;
  transform: translateY(-6px);
}

.cat-profile-info {
  flex: 1;
}

.cat-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cat-main-name {
  font-size: 22px;
  font-weight: bold;
  color: #4A280E;
}

.cat-main-name.editable-name {
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
  border-bottom: 2px dashed rgba(230, 126, 34, 0.45);
  transition: all 0.2s;
}

.cat-main-name.editable-name:hover {
  background: #FFF0E0;
  border-bottom-color: #E67E22;
  color: #D35400;
}

/* 小猫自定义起名原生弹窗 */
.cat-rename-dialog {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 30, 15, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: modalFadeIn 0.2s ease;
}

.cat-rename-box {
  background: #FFFDF9;
  border: 3px solid #E67E22;
  border-radius: 18px;
  padding: 24px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: cardSlideUp 0.25s ease;
}

.rename-box-title {
  font-size: 17px;
  font-weight: bold;
  color: #4A280E;
  text-align: center;
}

.rename-input-wrap input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5DCCE;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #2C3E50;
  background: #FFF;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.rename-input-wrap input:focus {
  border-color: #E67E22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.rename-btn-row {
  display: flex;
  gap: 12px;
}

.btn-rename-main {
  flex: 1;
  background: linear-gradient(135deg, #E67E22, #D35400);
  color: #FFF;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(211, 84, 0, 0.25);
  transition: transform 0.2s;
}

.btn-rename-main:hover {
  transform: translateY(-2px);
}

.btn-rename-sub {
  background: #ECEFF1;
  color: #546E7A;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-rename-sub:hover {
  background: #CFD8DC;
}

.btn-rename-pill {
  background: #FFF;
  border: 1.5px solid #F0C49E;
  color: #8C4A1E;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(140, 74, 30, 0.15);
}

.btn-rename-pill:hover {
  background: #FDF2E9;
  border-color: #E67E22;
  color: #D35400;
  transform: scale(1.06);
}

.cat-level-tag {
  background: linear-gradient(135deg, #E67E22, #D35400);
  color: #FFF;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(211, 84, 0, 0.25);
}

.cat-title-tag {
  background: #FEF9E7;
  color: #B7950B;
  border: 1.5px solid #F9E79F;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 12px;
}

.cat-exp-wrapper {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  padding: 10px 16px;
  border: 1.5px solid #FAD7A0;
}

.cat-exp-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: bold;
  color: #784218;
  margin-bottom: 6px;
}

.cat-exp-bar {
  width: 100%;
  height: 12px;
  background: #EBEDEF;
  border-radius: 8px;
  overflow: hidden;
}

.cat-exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #F39C12, #E67E22);
  border-radius: 8px;
  transition: width 0.4s ease;
}

/* 三维状态仪表卡片 */
.cat-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.cat-status-card {
  background: #FFF;
  border: 2px solid #E5DCCE;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cat-status-card.status-good {
  border-color: #A9DFBF;
  background: #F9FCF9;
}

.cat-status-card.status-warning {
  border-color: #F5B7B1;
  background: #FDEDEC;
}

.status-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status-title {
  font-size: 14px;
  font-weight: bold;
  color: #5A3514;
}

.status-val {
  font-size: 14px;
  font-weight: bold;
}

.txt-good { color: #27AE60; font-weight: bold; }
.txt-warn { color: #E74C3C; font-weight: bold; }

.status-desc {
  font-size: 12px;
  color: #7F8C8D;
  line-height: 1.4;
}

.cat-section-title {
  font-size: 15px;
  font-weight: bold;
  color: #4A280E;
  margin-bottom: 12px;
}

/* 美食卡片网格 */
.cat-food-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.cat-food-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFF;
  border: 2px solid #E8DFCD;
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.2s;
}

.cat-food-card:hover {
  border-color: #E67E22;
  background: #FFFBF5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.18);
}

.food-icon-wrap {
  font-size: 32px;
  flex-shrink: 0;
}

.food-info {
  flex: 1;
}

.food-name {
  font-size: 14.5px;
  font-weight: bold;
  color: #2C3E50;
  margin-bottom: 2px;
}

.food-desc {
  font-size: 12px;
  color: #7F8C8D;
  line-height: 1.3;
}

.food-exp-tag {
  font-size: 12px;
  color: #E67E22;
  font-weight: bold;
  margin-top: 3px;
}

.btn-feed-action {
  background: linear-gradient(135deg, #E67E22, #D35400);
  color: #FFF;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(211, 84, 0, 0.25);
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-feed-action:hover {
  transform: scale(1.05);
}

.btn-feed-action.btn-feed-full {
  background: #BDC3C7 !important;
  color: #7F8C8D !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* 养护快捷动作栏 */
.cat-actions-row {
  display: flex;
  gap: 16px;
}

.btn-cat-action {
  flex: 1;
  background: linear-gradient(135deg, #3498DB, #2980B9);
  color: #FFF;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(41, 128, 185, 0.25);
  transition: all 0.2s;
  text-align: center;
}

.btn-cat-action:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #5DADE2, #3498DB);
}

.btn-cat-action.btn-action-urgent {
  background: linear-gradient(135deg, #E74C3C, #C0392B);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
  animation: urgentPulse 2s infinite;
}

.btn-cat-action.btn-action-disabled {
  background: #D5DBDB !important;
  color: #7F8C8D !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.88;
}

.food-card-disabled {
  opacity: 0.72;
  background: #F8F9F9 !important;
  border-color: #E5E7E9 !important;
}

@keyframes urgentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* 浮动经验气泡反馈 */
.cat-floating-toast {
  position: fixed;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #FF7675, #D63031);
  color: #FFF;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(214, 48, 49, 0.4);
  pointer-events: none;
  z-index: 9999;
  animation: floatUpFade 1.4s ease-out forwards;
}

@keyframes floatUpFade {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -24px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -48px) scale(1);
  }
}

/* ==========================================================================
   8. 🎨 桌面彩色铅笔筒 · 治愈手绘画板 (Paint Modal - Windows 风格)
   ========================================================================== */
.paint-modal-card {
  width: 980px;
  max-width: 96vw;
  height: 740px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #F0F3F6;
  border: 1px solid #C4D0DB;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.paint-window-header {
  background: #E8EEF5;
  border-bottom: 1px solid #D0D9E2;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.paint-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paint-action-btn {
  background: #FFFFFF;
  border: 1px solid #CAD4DE;
  color: #334455;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.paint-action-btn:hover:not(:disabled) {
  background: #E4ECF4;
  border-color: #88AACC;
  transform: translateY(-1px);
}

.paint-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.paint-action-btn.paint-btn-highlight {
  background: linear-gradient(135deg, #F39C12, #E67E22);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

.paint-action-btn.paint-btn-highlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.45);
}

.paint-action-btn.paint-btn-primary {
  background: linear-gradient(135deg, #27AE60, #2ECC71);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.paint-action-btn.paint-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.45);
}

/* Ribbon 经典工具栏 */
.paint-ribbon-bar {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid #D5DCE2;
  align-items: stretch;
  overflow-x: auto;
  flex-shrink: 0;
}

.paint-ribbon-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid #E6ECF1;
  padding: 0 10px;
  flex-shrink: 0;
}

.paint-ribbon-group:last-child {
  border-right: none;
}

.ribbon-group-title {
  font-size: 11px;
  color: #8C9CA9;
  margin-top: 5px;
  font-weight: 600;
  user-select: none;
}

.ribbon-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.ribbon-shapes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.paint-tool-btn {
  background: #F7F9FA;
  border: 1px solid #D9E1E7;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  color: #2C3E50;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.paint-tool-btn:hover {
  background: #E8F2FC;
  border-color: #80B6E8;
}

.paint-tool-btn.active {
  background: #CFE4F9;
  border-color: #3399FF;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  font-weight: bold;
  color: #0055AA;
}

.paint-mode-select {
  grid-column: span 3;
  padding: 2px 6px;
  border: 1px solid #D9E1E7;
  border-radius: 4px;
  font-size: 11px;
  background: #FFF;
  color: #2C3E50;
}

.ribbon-sizes-row {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}

.paint-size-btn {
  padding: 5px 8px;
  border: 1px solid #D9E1E7;
  border-radius: 6px;
  background: #F7F9FA;
  font-size: 11px;
  font-weight: bold;
  color: #2C3E50;
  cursor: pointer;
  transition: all 0.15s ease;
}

.paint-size-btn:hover {
  background: #E8F2FC;
  border-color: #80B6E8;
}

.paint-size-btn.active {
  background: #CFE4F9;
  border-color: #3399FF;
  color: #0055AA;
}

/* 调色板与颜色槽 */
.ribbon-colors-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paint-color-slots {
  display: flex;
  gap: 6px;
}

.color-slot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-slot-box:hover {
  background: #F0F4F8;
}

.color-slot-box.active {
  border-color: #3399FF;
  background: #EBF4FC;
}

.color-preview-inner {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #B5C2CC;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25);
}

.color-slot-label {
  font-size: 10px;
  color: #5A6D7C;
  margin-top: 2px;
  font-weight: bold;
}

.paint-palette-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  background: #F5F7F9;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #E1E6EB;
}

.paint-color-swatch {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.paint-color-swatch:hover {
  transform: scale(1.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.paint-custom-picker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.paint-custom-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  background: #F7F9FA;
  border: 1px solid #D9E1E7;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: #2C3E50;
  font-weight: 600;
  transition: all 0.15s ease;
}

.paint-custom-picker-btn:hover {
  background: #E8F2FC;
  border-color: #80B6E8;
}

/* 画布工作区 (类纸张投影排版) */
.paint-canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #C4D0DB;
  padding: 16px;
  overflow: auto;
  min-height: 0;
  user-select: none;
}

.paint-canvas-wrapper {
  background: #FFFFFF;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
}

#paint-canvas {
  display: block;
  background: #FFFFFF;
  cursor: crosshair;
  touch-action: none;
}

#paint-canvas.tool-pencil { cursor: crosshair; }
#paint-canvas.tool-brush { cursor: crosshair; }
#paint-canvas.tool-bucket { cursor: cell; }
#paint-canvas.tool-eraser { cursor: default; }
#paint-canvas.tool-picker { cursor: crosshair; }
#paint-canvas.tool-text { cursor: text; }

/* 底部状态栏 */
.paint-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #E8EEF5;
  border-top: 1px solid #D0D9E2;
  padding: 5px 16px;
  font-size: 11px;
  color: #5A6D7C;
  font-weight: 600;
  flex-shrink: 0;
}

/* 文字植入浮层对话框 (替代原生 prompt，100% 避免 WebView 拦截) */
.paint-text-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid #BAC9D8;
  width: 400px;
  max-width: 90vw;
  z-index: 120;
  overflow: hidden;
  animation: modalScaleIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.paint-text-dialog.hidden {
  display: none !important;
}

.paint-text-box {
  display: flex;
  flex-direction: column;
}

.paint-text-header {
  background: #E8EEF5;
  border-bottom: 1px solid #D0D9E2;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
  color: #2C3E50;
}

.paint-text-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #788896;
  padding: 0 4px;
}

.paint-text-close:hover {
  color: #E74C3C;
}

.paint-text-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paint-text-label {
  font-size: 12px;
  font-weight: bold;
  color: #4B5B6D;
}

.paint-text-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #BAC9D8;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.paint-text-input:focus {
  border-color: #3399FF;
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.25);
}

.paint-text-controls-row {
  display: flex;
  gap: 10px;
}

.paint-text-control-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.paint-text-controls-row .control-label,
.paint-text-preview-wrap .control-label {
  font-size: 11px;
  color: #6C7A89;
  font-weight: 600;
}

.paint-select {
  padding: 6px 8px;
  border: 1px solid #BAC9D8;
  border-radius: 6px;
  font-size: 12px;
  background: #FFF;
  color: #2C3E50;
}

.paint-text-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.paint-text-preview-box {
  background: #F8FAFC;
  border: 1px dashed #B8C8D8;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #2C3E50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paint-text-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.paint-dialog-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.paint-dialog-btn.btn-secondary {
  background: #F1F3F5;
  border-color: #CED4DA;
  color: #495057;
}

.paint-dialog-btn.btn-secondary:hover {
  background: #E9ECEF;
}

.paint-dialog-btn.btn-primary {
  background: linear-gradient(135deg, #3399FF, #1E70BF);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(30, 112, 191, 0.3);
}

.paint-dialog-btn.btn-primary:hover {
  background: linear-gradient(135deg, #4AA3FF, #237CD1);
  box-shadow: 0 4px 12px rgba(30, 112, 191, 0.45);
}

.paint-text-tip {
  font-size: 11px;
  color: #8C9CA9;
  line-height: 1.4;
  text-align: center;
}

/* 浮动操作反馈 Toast */
.paint-floating-toast {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 49, 66, 0.9);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 150;
  animation: modalScaleIn 0.15s ease-out;
}

/* ==========================================================================
   9. 🧶 陪小猫玩耍 · 捕鱼贪吃猫小游戏 (Cat Game Modal)
   ========================================================================== */
.btn-cat-play {
  background: linear-gradient(135deg, #FF7675, #E84393) !important;
  color: #FFF !important;
  box-shadow: 0 4px 14px rgba(232, 67, 147, 0.35) !important;
}

.btn-cat-play:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(232, 67, 147, 0.45) !important;
}

/* 全屏捕鱼贪吃猫模态框 (默认hidden必须隐藏) */
.cat-game-fullscreen-modal.app-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #0B1329;
  z-index: 99999;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* 核心修复：hidden 时绝对不显示 */
.cat-game-fullscreen-modal.app-modal.hidden,
#cat-game-modal.hidden {
  display: none !important;
}

.cat-game-fullscreen-card {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #0B1329;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: none;
}

/* 全屏 Canvas 覆盖层 */
#cat-game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: none;
}

/* 浮动玻璃拟态顶部状态栏 */
.cat-game-floating-header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.cat-game-title-badge {
  font-size: 17px;
  font-weight: 800;
  color: #FFF9F0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 18px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.cat-game-floating-header .cat-game-status-tags {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-game-stat-badge {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #F39C12;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  color: #FFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cat-game-stat-badge.best-score {
  border-color: #F1C40F;
  color: #FEEAA7;
}

.cat-game-stat-badge .highlight-val {
  color: #F39C12;
  font-size: 16px;
}

.cat-game-stat-badge .highlight-exp {
  color: #2ECC71;
  font-size: 16px;
}

/* 🕹️ 左下方 360° 平滑触控虚拟轮盘 (Joystick) */
.cat-joystick-wrap {
  position: absolute;
  left: 36px;
  bottom: 36px;
  width: 140px;
  height: 140px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.joystick-base {
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 2.5px solid rgba(243, 156, 18, 0.65);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), inset 0 0 15px rgba(243, 156, 18, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.joystick-base:active {
  cursor: grabbing;
}

/* 方向指示微标 */
.joystick-dir-indicator {
  position: absolute;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.joystick-dir-indicator.d-up { top: 6px; left: 50%; transform: translateX(-50%); }
.joystick-dir-indicator.d-down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.joystick-dir-indicator.d-left { left: 6px; top: 50%; transform: translateY(-50%); }
.joystick-dir-indicator.d-right { right: 6px; top: 50%; transform: translateY(-50%); }

/* 可拖拽摇杆旋钮 */
.joystick-knob {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFEAA7 0%, #F39C12 70%, #D35400 100%);
  border: 2px solid #FFFFFF;
  box-shadow: 0 4px 16px rgba(211, 84, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s ease-out;
  pointer-events: none;
}

.knob-paw {
  font-size: 22px;
  user-select: none;
}

/* 底部浮动引导提示 */
.cat-game-floating-tip {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 24px;
  border-radius: 30px;
  color: #F8FAFC;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
  pointer-events: auto;
}

/* 摄像头启动手势引导层 */
.cat-camera-prompt {
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 6, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 80;
  text-align: center;
  padding: 24px;
  animation: modalFadeIn 0.3s ease;
}

.cam-prompt-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.cam-prompt-title {
  font-size: 22px;
  font-weight: bold;
  color: #FFF9F0;
  margin-bottom: 6px;
}

.cam-prompt-desc {
  font-size: 13.5px;
  color: #EAD8C7;
  margin-bottom: 22px;
  max-width: 360px;
  line-height: 1.5;
}

.cam-prompt-btns {
  display: flex;
  gap: 12px;
}

.btn-cam-action {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-cam-primary {
  background: linear-gradient(135deg, #10B981, #059669);
  border: none;
  color: #FFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-cam-primary:hover {
  transform: scale(1.05);
}

.btn-cam-secondary {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #FFF;
}

.btn-cam-secondary:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

/* 暂停指示提示 */
.cat-game-pause-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #FFEAA7;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  pointer-events: none;
  border: 1px solid rgba(255, 234, 167, 0.4);
  animation: urgentPulse 1.5s infinite;
}

/* 游戏结束结算卡片 */
.cat-game-result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 18, 8, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: modalFadeIn 0.25s ease-out;
}

.game-result-card {
  background: #FFFDF9;
  border: 3px solid #D4A373;
  border-radius: 20px;
  padding: 24px 32px;
  text-align: center;
  width: 380px;
  max-width: 88vw;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-cat-avatar {
  font-size: 48px;
  margin-bottom: 6px;
}

.result-title {
  font-size: 20px;
  font-weight: bold;
  color: #4A280E;
}

.result-reason {
  font-size: 12px;
  color: #8C6A48;
  margin-top: 4px;
}

.result-stats-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #FFF5E6;
  border-radius: 14px;
  padding: 12px 8px;
  margin: 18px 0;
  border: 1.5px solid #F39C12;
}

.result-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.result-stat-box .stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #D35400;
}

.result-stat-box .stat-num.exp-gain {
  color: #27AE60;
}

.result-stat-box .stat-lbl {
  font-size: 11px;
  color: #7F8C8D;
  margin-top: 2px;
  font-weight: 600;
}

.result-stat-divider {
  width: 1px;
  height: 36px;
  background: #D4A373;
  opacity: 0.5;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.btn-game-again {
  flex: 1;
  padding: 11px 16px;
  background: linear-gradient(135deg, #2ECC71, #27AE60);
  color: #FFF;
  border: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
  transition: transform 0.15s;
}

.btn-game-again:hover {
  transform: scale(1.04);
}

.btn-game-back {
  flex: 1;
  padding: 11px 16px;
  background: #F1F2F6;
  border: 1px solid #CED6E0;
  color: #2F3542;
  border-radius: 12px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-game-back:hover {
  background: #E4E7EB;
}

/* 鸿蒙端触屏虚拟十字按键 (支持触屏单手轻松控制) */
.cat-virtual-dpad {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  user-select: none;
  z-index: 50;
  touch-action: none;
}

.dpad-mid-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dpad-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #E67E22;
  color: #D35400;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(211, 84, 0, 0.25);
  transition: transform 0.1s, background 0.1s;
  touch-action: manipulation;
}

.dpad-btn:active {
  transform: scale(0.92);
  background: #FFEAA7;
}

.dpad-center-pad {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* 底部操作说明栏 */
.cat-game-footer-tip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF5E6;
  border-top: 1.5px solid #F39C12;
  padding: 6px 18px;
  font-size: 11px;
  color: #7F5835;
  flex-shrink: 0;
}

.btn-mini-restart {
  background: #FFFFFF;
  border: 1px solid #D4A373;
  color: #8B5A2B;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.btn-mini-restart:hover {
  background: #FFEAA7;
}


