/* ==========================================
   来自我们的时光集 — 统一样式表 (Vue SPA)
   响应式: 桌面 >768px / 平板 ≤768px / 手机 ≤480px
   ========================================== */

:root {
  --caramel: #B98A5E;
  --caramel-hover: #A5764A;
  --espresso: #4A3A2E;
  --mocha: #8B5A2B;
  --cream: #F7F3EC;
  --text: #4A3A2E;
  --text-light: #8C7A69;
  --surface: #FFFFFF;
  --surface-soft: #FBF8F3;
  --border: #EDE4D6;
  --shadow: 0 4px 20px rgba(90,60,30,0.08);
  --shadow-lg: 0 16px 48px rgba(90,60,30,0.12);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: "Microsoft Yahei","PingFang SC",sans-serif;
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(217,160,102,0.10), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(185,138,94,0.08), transparent 50%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* =========================== 导航栏 =========================== */
.main-nav {
  position: fixed; top:0; left:0; width:100%; height:50px;
  background: rgba(253,251,247,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  z-index: 999;
}
.nav-container {
  max-width: 1200px; margin:0 auto; padding:0 20px;
  display:flex; justify-content:space-between; align-items:center; height:100%;
}
.nav-logo { font-size:1.1rem; font-weight:bold; color:var(--espresso); letter-spacing:1px; white-space:nowrap; }
.nav-menu { display:flex; list-style:none; gap:8px; align-items:center; }
.nav-item { position:relative; }
.nav-link {
  display:flex; align-items:center; gap:6px;
  text-decoration:none; color:var(--espresso); font-size:0.95rem;
  padding:8px 12px; border-radius:8px; transition:all .3s; white-space:nowrap;
}
.nav-link::after {
  content:''; position:absolute; bottom:0; left:50%; transform:translateX(-50%);
  width:0; height:2px; background:var(--caramel); transition:width .3s;
}
.nav-link:hover, .nav-link.active { background:rgba(197,168,128,0.2); color:var(--mocha); }
.nav-link:hover::after, .nav-link.active::after { width:80%; }
.nav-link.active { background:rgba(197,168,128,0.3); font-weight:600; }
.login-nav-btn {
  background:linear-gradient(135deg,#c7a883,#a88b63); color:#fff !important;
  padding:6px 14px !important; border-radius:20px; font-size:0.9rem; transition:all .3s;
}
.login-nav-btn::after { display:none; }
.login-nav-btn:hover {
  transform:translateY(-2px); box-shadow:0 4px 12px rgba(199,168,131,0.4);
  background:linear-gradient(135deg,#a88b63,#c7a883);
}

/* 汉堡菜单按钮（平板+手机显示） */
.hamburger {
  display:none; width:36px; height:36px; border:none; background:rgba(199,168,131,0.15);
  border-radius:8px; cursor:pointer; flex-direction:column; align-items:center;
  justify-content:center; gap:4px; z-index:1000; transition:all .3s;
}
.hamburger span {
  display:block; width:18px; height:2px; background:var(--espresso);
  border-radius:2px; transition:all .3s;
}
.hamburger.open span:nth-child(1) { transform:rotate(45deg) translate(4px,4px); }
.hamburger.open span:nth-child(2) { opacity:0; }
.hamburger.open span:nth-child(3) { transform:rotate(-45deg) translate(4px,-4px); }

/* =========================== 登录页 =========================== */
.login-page {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; padding:20px;
}
.login-container {
  width:100%; max-width:420px; display:flex; flex-direction:column; align-items:center;
  animation: fadeUp .8s ease;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(30px); }
  to { opacity:1; transform:translateY(0); }
}
.login-box {
  width:100%; background:var(--surface);
  border-radius:20px; padding:40px 35px;
  border:1px solid var(--border); box-shadow:var(--shadow-lg); transition:all .3s;
}
.login-header { text-align:center; margin-bottom:35px; }
.logo { font-size:1.8rem; font-weight:bold; color:var(--espresso); margin-bottom:8px; letter-spacing:2px; }
.login-subtitle { color:var(--text-light); font-size:0.95rem; }
.login-form { display:flex; flex-direction:column; gap:20px; }
.login-form .form-group { display:flex; flex-direction:column; gap:8px; }
.login-form .form-group label { font-size:0.95rem; color:var(--text); font-weight:500; }
.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"] {
  padding:14px 16px; border:2px solid rgba(199,168,131,0.3); border-radius:12px;
  font-size:1rem; color:var(--text); background:rgba(255,255,255,0.6); transition:all .3s;
}
.login-form .form-group input:focus {
  outline:none; border-color:var(--caramel);
  background:rgba(255,255,255,0.9); box-shadow:0 0 0 3px rgba(199,168,131,0.15);
}
.login-form .form-group input::placeholder { color:#a89888; }
.form-options { display:flex; align-items:center; font-size:0.9rem; }
.remember-me {
  display:flex; align-items:center; gap:8px; cursor:pointer; color:#6d5d52; user-select:none;
}
.remember-me input[type="checkbox"] { width:16px; height:16px; accent-color:var(--caramel); cursor:pointer; }
.login-btn {
  width:100%; padding:14px; background:var(--caramel);
  color:#fff; border:none; border-radius:12px; font-size:1.05rem; font-weight:500;
  cursor:pointer; transition:all .3s; box-shadow:0 4px 15px rgba(185,138,94,0.28); margin-top:10px;
}
.login-btn:hover { transform:translateY(-2px); background:var(--caramel-hover); box-shadow:0 6px 20px rgba(185,138,94,0.35); }
.login-btn:active { transform:translateY(0); }
.login-btn:disabled { opacity:0.7; cursor:not-allowed; transform:none; }
.login-footer { margin-top:30px; text-align:center; color:var(--text-light); font-size:0.9rem; animation: fadeUp 1s ease .2s both; }

/* =========================== 首页计时器 =========================== */
.name-bar {
  display:flex; align-items:center; justify-content:center; gap:14px;
  font-size:25px; font-weight:bold; color:#6d4c41;
  padding-top:80px; margin-bottom:30px;
}
.name-bar .heart { font-size:25px; animation: heartbeat 1.2s ease-in-out infinite; }
@keyframes heartbeat {
  0%,100% { transform:scale(1); }
  15% { transform:scale(1.15); }
  30% { transform:scale(1); }
  45% { transform:scale(1.1); }
  60% { transform:scale(1); }
}
.timer-wrap {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:0 20px;
}
.content-box {
  background:var(--surface);
  padding:30px 40px; border-radius:16px; border:1px solid var(--border);
  box-shadow:var(--shadow); max-width:500px; width:100%;
}
.content-box h1 { margin-bottom:10px; color:var(--espresso); }
.subtitle { margin-bottom:30px; color:var(--text-light); }
.settings { margin-bottom:20px; display:flex; flex-direction:column; align-items:center; gap:10px; }
.settings input[type="date"], .date-input {
  padding:12px 20px; border:2px solid rgba(180,140,120,0.2); border-radius:12px;
  color:#5c4033; background:#fef9f2; transition:all .3s; font-size:1rem;
  min-width:200px; text-align:center;
  -webkit-appearance:none; appearance:none; min-height:44px;
}
.settings input[type="date"]:focus, .date-input:focus { outline:none; border-color:#e8a87c; }
/* 只作用于 .settings 的直接子按钮（封存记忆）。
   不能写成 .settings button：自绘月历嵌在同容器内，其每个日期格也是 <button>，
   会被这条规则的背景色与白字覆盖，导致整月日历变成一片棕色方块。 */
.settings > button, .reset-btn {
  padding:10px 20px; border-radius:8px; border:none; background:#c7a883;
  color:#fff; cursor:pointer; transition:all .3s; font-size:0.95rem;
}
.settings > button:hover, .reset-btn:hover { background:var(--caramel-hover); transform:translateY(-1px); }
.reset-btn { margin-top:20px; }
.timer-title { margin-bottom:14px; font-size:16px; color:var(--text-light); }
.timer { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; }
.time-box {
  background:var(--surface); border:1px solid var(--border);
  padding:12px 16px; border-radius:12px;
  min-width:70px; transition:transform .3s;
  box-shadow:0 1px 3px rgba(90,60,30,0.06);
}
.time-box:hover { transform:translateY(-2px); }
.time-box span { font-size:26px; font-weight:bold; color:var(--caramel-hover); }

/* =========================== 页面通用布局 =========================== */
.page-container { max-width:1100px; margin:0 auto; padding:70px 20px 40px; }
.page-header { text-align:center; margin-bottom:30px; }
.page-header h1 { font-size:2rem; color:var(--text); margin-bottom:8px; }
.page-subtitle { color:var(--text-light); font-size:1rem; }
.action-bar {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:25px; padding:0 10px; flex-wrap:wrap; gap:12px;
}
.add-btn {
  display:inline-flex; align-items:center; gap:8px; padding:12px 24px;
  background:var(--caramel); color:#fff;
  border:none; border-radius:25px; font-size:1rem; cursor:pointer;
  transition:all .3s; box-shadow:0 4px 15px rgba(185,138,94,0.28);
  -webkit-tap-highlight-color: transparent;
}
.add-btn:hover { transform:translateY(-2px); background:var(--caramel-hover); box-shadow:0 6px 20px rgba(185,138,94,0.35); }
.add-btn:active { transform:scale(0.97); }
.stats { color:var(--text-light); font-size:0.95rem; white-space:nowrap; }
.stats span { font-size:1.5rem; font-weight:bold; color:#c7a883; }
.empty-state { text-align:center; padding:60px 20px; color:var(--text-light); }
.empty-icon {
  width:80px; height:80px; margin:0 auto 20px;
  background:rgba(199,168,131,0.2); border-radius:50%;
  display:flex; align-items:center; justify-content:center; font-size:2rem;
}
.empty-state p { font-size:1.1rem; margin-bottom:10px; }
.empty-hint { font-size:0.9rem; color:#a89888; }

/* =========================== 旅游时间线 =========================== */
.timeline { position:relative; padding-left:30px; }
.timeline::before {
  content:''; position:absolute; left:8px; top:0; bottom:0; width:3px;
  background:linear-gradient(to bottom,#c7a883,#e8d5c4); border-radius:3px;
}
.travel-card {
  position:relative; background:var(--surface);
  border-radius:16px; padding:20px; margin-bottom:20px;
  border:1px solid var(--border); box-shadow:var(--shadow);
  cursor:pointer; transition:all .3s; animation: fadeUp .4s ease both;
  -webkit-tap-highlight-color: transparent;
}
.travel-card:active { transform:scale(0.98); }
.travel-card::before {
  content:''; position:absolute; left:-26px; top:25px; width:14px; height:14px;
  background:#c7a883; border-radius:50%; border:3px solid #fdfbf7;
  box-shadow:0 2px 8px rgba(199,168,131,0.4);
}
.card-content { display:flex; gap:20px; }
.card-image {
  width:120px; height:120px; border-radius:12px; overflow:hidden; flex-shrink:0;
  background:linear-gradient(135deg,#e8d5c4,#d4c4b0);
  display:flex; align-items:center; justify-content:center; font-size:2.5rem;
}
.card-image img { width:100%; height:100%; object-fit:cover; }
.card-info { flex:1; display:flex; flex-direction:column; min-width:0; }
.card-title { font-size:1.2rem; color:var(--text); margin-bottom:8px; font-weight:bold; }
.card-meta { display:flex; gap:15px; color:var(--text-light); font-size:0.9rem; margin-bottom:10px; flex-wrap:wrap; }
.card-desc {
  color:#6d5d52; font-size:0.9rem; line-height:1.5;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.card-mood { margin-top:auto; padding-top:10px; }
.mood-badge {
  display:inline-block; padding:4px 12px; background:rgba(199,168,131,0.2);
  color:#8b5a2b; border-radius:15px; font-size:0.85rem;
}
.mood-tags { display:flex; flex-wrap:wrap; gap:8px; }
.mood-tag {
  padding:8px 16px; background:rgba(199,168,131,0.15); border-radius:20px;
  color:#6d5d52; font-size:0.9rem; cursor:pointer; transition:all .3s;
  border:2px solid transparent; user-select:none; -webkit-tap-highlight-color:transparent;
}
.mood-tag:active { transform:scale(0.95); }
.mood-tag.selected { background:rgba(199,168,131,0.3); border-color:#c7a883; color:var(--text); }
.type-dot {
  display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px;
}
.type-del {
  margin-left:4px; font-size:0.85rem; opacity:0.4; cursor:pointer; line-height:1;
}
.type-del:hover { opacity:1; color:#c44; }
.type-add-btn {
  border-style:dashed !important; background:transparent !important;
  color:var(--text-light) !important;
}
.type-add-btn:active { background:rgba(199,168,131,0.15) !important; }
.form-row { display:flex; gap:15px; }
.form-row .form-group { flex:1; }
.photo-upload { position:relative; }
.photo-upload input[type="file"] {
  position:absolute; width:100%; height:100%; opacity:0; cursor:pointer; z-index:1;
}
.photo-preview {
  width:100%; height:150px; border:2px dashed rgba(199,168,131,0.4);
  border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.5); overflow:hidden; transition:all .3s;
}
.photo-preview img { width:100%; height:100%; object-fit:cover; }
.upload-hint { color:var(--text-light); font-size:0.95rem; pointer-events:none; }

/* 详情弹窗 */
.detail-modal {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(0,0,0,0.7); backdrop-filter:blur(8px);
  display:none; align-items:center; justify-content:center; z-index:1001; padding:16px;
}
.detail-modal.active { display:flex; }
.detail-content {
  background:#fdfbf7; border-radius:20px; width:100%; max-width:560px;
  max-height:90vh; overflow-y:auto; position:relative; animation: modalIn .3s ease;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(0.95); }
  to { opacity:1; transform:scale(1); }
}
.detail-close { position:absolute; top:12px; right:12px; z-index:10; background:rgba(255,255,255,0.9); }
.detail-image {
  width:100%; height:220px; background:linear-gradient(135deg,#e8d5c4,#d4c4b0);
  display:flex; align-items:center; justify-content:center; font-size:4rem;
  border-radius:20px 20px 0 0; overflow:hidden;
}
.detail-image img { width:100%; height:100%; object-fit:cover; }
.detail-info { padding:20px 25px; }
.detail-info h2 { color:var(--text); font-size:1.4rem; margin-bottom:12px; }
.detail-meta { display:flex; gap:16px; color:var(--text-light); font-size:0.95rem; margin-bottom:12px; flex-wrap:wrap; }
.detail-mood { margin-bottom:12px; }
.detail-desc { color:#6d5d52; line-height:1.7; margin-bottom:20px; }
.detail-actions { display:flex; gap:12px; }
.edit-btn, .delete-btn {
  flex:1; padding:12px 20px; border-radius:10px; font-size:1rem; cursor:pointer;
  transition:all .3s; border:none;
}
.edit-btn { background:rgba(199,168,131,0.2); color:#6d5d52; }
.edit-btn:hover { background:rgba(199,168,131,0.4); }
.delete-btn { background:rgba(220,100,100,0.15); color:#c44; }
.delete-btn:hover { background:rgba(220,100,100,0.3); }

/* =========================== 甜蜜相册 =========================== */
.filter-bar { display:flex; justify-content:center; gap:10px; margin-bottom:25px; flex-wrap:wrap; }
.filter-btn {
  padding:8px 20px; background:rgba(199,168,131,0.15); border:2px solid transparent;
  border-radius:20px; color:#6d5d52; font-size:0.9rem; cursor:pointer; transition:all .3s;
  -webkit-tap-highlight-color:transparent;
}
.filter-btn:active { transform:scale(0.95); }
.filter-btn.active { background:rgba(199,168,131,0.3); border-color:#c7a883; color:var(--text); }
.filter-btn.manage-btn { padding:8px 14px; background:rgba(199,168,131,0.08); font-size:1.1rem; font-weight:bold; }
.gallery {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:20px;
}
.photo-card {
  position:relative; border-radius:16px; overflow:hidden;
  background:var(--surface);
  border:1px solid var(--border); box-shadow:var(--shadow);
  cursor:pointer; transition:all .4s cubic-bezier(0.4,0,0.2,1); aspect-ratio:1;
  animation: fadeUp .4s ease both; -webkit-tap-highlight-color:transparent;
}
.photo-card:active { transform:scale(0.97); }
.photo-card img { width:100%; height:100%; object-fit:cover; transition:transform .4s ease; }
.photo-overlay {
  position:absolute; bottom:0; left:0; right:0; padding:30px 15px 15px;
  background:linear-gradient(transparent,rgba(0,0,0,0.7)); opacity:0; transition:opacity .3s;
  pointer-events:none;
}
.photo-title {
  color:#fff; font-size:0.95rem; font-weight:500; margin-bottom:4px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.photo-category {
  position:absolute; top:12px; right:12px; padding:4px 10px;
  background:rgba(199,168,131,0.9); color:#fff; border-radius:12px;
  font-size:0.75rem; opacity:0; transition:opacity .3s; pointer-events:none;
}
.upload-type-btns { display:flex; gap:10px; margin-bottom:12px; }
.upload-type-btn {
  flex:1; padding:10px 16px; background:rgba(199,168,131,0.15); border:2px solid transparent;
  border-radius:10px; color:#6d5d52; font-size:0.9rem; cursor:pointer; transition:all .3s;
  -webkit-tap-highlight-color:transparent;
}
.upload-type-btn.active { background:rgba(199,168,131,0.3); border-color:#c7a883; color:var(--text); }
.photo-upload-area { position:relative; }
.photo-upload-area input[type="file"] {
  position:absolute; width:100%; height:100%; opacity:0; cursor:pointer; z-index:1; top:0; left:0;
}
.photo-upload-area .upload-preview {
  width:100%; min-height:160px; border:2px dashed rgba(199,168,131,0.4);
  border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.5); overflow:hidden; transition:all .3s;
  cursor:pointer;
}
.photo-upload-area .upload-preview:hover { border-color:rgba(199,168,131,0.7); background:rgba(255,255,255,0.7); }
.upload-placeholder { display:flex; flex-direction:column; align-items:center; gap:8px; }
.upload-placeholder-icon { font-size:2.4rem; opacity:0.6; }
.upload-hint-sub { color:#b0a099; font-size:0.8rem; }

/* 缩略图网格 */
.upload-thumbnails {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(110px, 1fr)); gap:10px;
  max-height:320px; overflow-y:auto; padding:8px; border:2px dashed rgba(199,168,131,0.4);
  border-radius:12px; background:rgba(255,255,255,0.5);
}
.upload-thumbnails::-webkit-scrollbar { width:4px; }
.upload-thumbnails::-webkit-scrollbar-track { background:transparent; }
.upload-thumbnails::-webkit-scrollbar-thumb { background:rgba(199,168,131,0.3); border-radius:2px; }

.upload-thumb {
  position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden;
  background:rgba(199,168,131,0.1); border:2px solid rgba(199,168,131,0.2);
  transition:all .25s; display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.upload-thumb:hover { border-color:#c7a883; transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.08); }
.upload-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.upload-thumb-remove {
  position:absolute; top:4px; right:4px; width:22px; height:22px; border-radius:50%;
  background:rgba(0,0,0,0.55); color:#fff; border:none; font-size:14px; line-height:22px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity .2s; z-index:2;
}
.upload-thumb:hover .upload-thumb-remove { opacity:1; }
.upload-thumb-remove:hover { background:rgba(220,80,80,0.85); }
.upload-thumb-name {
  position:absolute; bottom:0; left:0; right:0; padding:4px 6px;
  background:linear-gradient(transparent, rgba(0,0,0,0.55)); color:#fff;
  font-size:0.68rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-align:center; pointer-events:none;
}
.upload-thumb-size {
  position:absolute; top:4px; left:6px; padding:1px 5px;
  background:rgba(0,0,0,0.4); color:#eee; border-radius:3px;
  font-size:0.6rem; opacity:0; transition:opacity .2s; pointer-events:none;
}
.upload-thumb:hover .upload-thumb-size { opacity:1; }

/* 继续添加按钮 */
.upload-thumb-add {
  cursor:pointer; border-style:dashed; border-color:rgba(199,168,131,0.35);
  background:rgba(199,168,131,0.05);
}
.upload-thumb-add:hover { background:rgba(199,168,131,0.12); border-color:#c7a883; }
.upload-thumb-add-icon { font-size:2rem; color:#c7a883; line-height:1; }
.upload-thumb-add-text { font-size:0.75rem; color:var(--text-light); margin-top:2px; }

/* 底部操作栏 */
.upload-actions-bar {
  display:flex; align-items:center; justify-content:space-between; margin-top:10px;
  padding:8px 12px; background:rgba(199,168,131,0.08); border-radius:8px;
}
.upload-count { color:var(--text); font-size:0.85rem; font-weight:500; }
.upload-clear-btn {
  padding:5px 14px; background:rgba(200,100,100,0.12); color:#c44; border:1px solid rgba(200,100,100,0.2);
  border-radius:6px; font-size:0.8rem; cursor:pointer; transition:all .2s;
}
.upload-clear-btn:hover { background:rgba(200,100,100,0.2); }
.category-tags { display:flex; flex-wrap:wrap; gap:8px; }
.category-tag {
  padding:8px 16px; background:rgba(199,168,131,0.15); border-radius:20px;
  color:#6d5d52; font-size:0.9rem; cursor:pointer; transition:all .3s;
  border:2px solid transparent; user-select:none; -webkit-tap-highlight-color:transparent;
}
.category-tag:active { transform:scale(0.95); }
.category-tag.selected { background:rgba(199,168,131,0.3); border-color:#c7a883; color:var(--text); }
.add-category-row { display:flex; gap:10px; margin-top:12px; }
.add-category-row input {
  flex:1; padding:10px 15px; border:2px solid rgba(199,168,131,0.3);
  border-radius:10px; font-size:0.9rem; color:var(--text); background:rgba(255,255,255,0.8); transition:all .3s;
}
.add-category-row input:focus { outline:none; border-color:#c7a883; }
.add-category-btn {
  width:42px; height:42px; border:none; background:var(--caramel);
  color:#fff; border-radius:10px; font-size:1.3rem; cursor:pointer; transition:all .3s;
  flex-shrink:0;
}
.add-category-btn:active { transform:scale(0.95); }
.category-modal { max-width:400px; }
.category-manage-list { padding:20px 25px; display:flex; flex-direction:column; gap:12px; }
.category-manage-item { display:flex; gap:10px; align-items:center; }
.category-edit-input {
  flex:1; padding:10px 15px; border:2px solid rgba(199,168,131,0.3);
  border-radius:10px; font-size:0.9rem; color:var(--text); background:rgba(255,255,255,0.8); transition:all .3s;
}
.category-edit-input:focus { outline:none; border-color:#c7a883; }
.category-save-btn, .category-delete-btn {
  padding:8px 14px; border:none; border-radius:8px; font-size:0.85rem; cursor:pointer; transition:all .3s;
}
.category-save-btn { background:rgba(199,168,131,0.3); color:var(--text); }
.category-save-btn:hover { background:rgba(199,168,131,0.5); }
.category-delete-btn { background:rgba(220,100,100,0.2); color:#a55; }
.category-delete-btn:hover { background:rgba(220,100,100,0.35); }

/* 全屏查看器 */
.viewer-modal {
  position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.95);
  display:none; flex-direction:column; align-items:center; justify-content:center; z-index:1001;
}
.viewer-modal.active { display:flex; }
.viewer-close {
  position:absolute; top:16px; right:16px; width:44px; height:44px;
  background:rgba(255,255,255,0.1); border:none; border-radius:50%;
  color:#fff; font-size:1.8rem; cursor:pointer; transition:all .3s; z-index:10;
  display:flex; align-items:center; justify-content:center;
  -webkit-tap-highlight-color:transparent;
}
.viewer-close:active { background:rgba(255,255,255,0.3); }
.viewer-nav {
  position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px;
  background:rgba(255,255,255,0.1); border:none; border-radius:50%;
  color:#fff; font-size:1.4rem; cursor:pointer; transition:all .3s; z-index:10;
  display:flex; align-items:center; justify-content:center;
  -webkit-tap-highlight-color:transparent;
}
.viewer-nav:active { background:rgba(255,255,255,0.3); }
.viewer-prev { left:12px; }
.viewer-next { right:12px; }
.viewer-content { max-width:90vw; max-height:75vh; display:flex; align-items:center; justify-content:center; }
.viewer-content img { max-width:100%; max-height:75vh; object-fit:contain; border-radius:8px; }
.viewer-info {
  position:absolute; bottom:0; left:0; right:0; padding:20px 30px 30px;
  background:linear-gradient(transparent,rgba(0,0,0,0.8)); text-align:center;
}
.viewer-actions { display:flex; justify-content:center; gap:15px; margin-top:10px; }
.viewer-btn {
  padding:10px 25px; background:rgba(255,255,255,0.15); border:none; border-radius:20px;
  color:#fff; font-size:0.9rem; cursor:pointer; transition:all .3s;
  -webkit-tap-highlight-color:transparent;
}
.viewer-btn:active { background:rgba(255,255,255,0.35); }
.viewer-btn.delete { background:rgba(220,100,100,0.3); }
.viewer-btn.delete:active { background:rgba(220,100,100,0.5); }

/* =========================== 模态框公共 =========================== */
.modal-overlay {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(0,0,0,0.5); backdrop-filter:blur(5px);
  display:none; align-items:center; justify-content:center; z-index:1000; padding:16px;
}
.modal-overlay.active { display:flex; }
.modal {
  background:var(--cream); border-radius:20px; width:100%; max-width:500px;
  max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,0.2); animation: modalIn .3s ease;
}
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:20px 25px; border-bottom:1px solid rgba(199,168,131,0.2);
  position:sticky; top:0; background:var(--cream); border-radius:20px 20px 0 0; z-index:1;
}
.modal-header h2 { color:var(--text); font-size:1.3rem; }
.close-btn {
  width:32px; height:32px; border:none; background:rgba(199,168,131,0.2);
  border-radius:50%; font-size:1.5rem; color:var(--text-light); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:all .3s;
  flex-shrink:0;
}
.close-btn:active { background:rgba(199,168,131,0.5); }

/* 表单通用 */
form { padding:25px; }
.form-group { margin-bottom:20px; }
.form-group label { display:block; margin-bottom:8px; color:var(--text); font-weight:500; font-size:0.95rem; }
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea {
  width:100%; padding:12px 15px; border:1.5px solid var(--border);
  border-radius:10px; font-size:1rem; color:var(--text);
  background:var(--surface); transition:all .3s;
}
.form-group input:focus,
.form-group textarea:focus { outline:none; border-color:var(--caramel); box-shadow:0 0 0 3px rgba(185,138,94,0.12); }
.form-actions { display:flex; gap:12px; margin-top:25px; }
.cancel-btn, .submit-btn { flex:1; padding:12px 20px; border-radius:10px; font-size:1rem; cursor:pointer; transition:all .3s; }
.cancel-btn { background:rgba(199,168,131,0.2); border:none; color:var(--text-light); }
.cancel-btn:active { background:rgba(199,168,131,0.4); }
.submit-btn {
  background:var(--caramel); border:none; color:#fff;
  box-shadow:0 4px 15px rgba(185,138,94,0.28);
}
.submit-btn:active { transform:scale(0.97); }
.submit-btn:disabled { opacity:0.6; cursor:not-allowed; transform:none; }

/* =========================== 抽奖页 =========================== */
.lottery-tabs-bar { margin-bottom:20px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.lottery-tabs-bar::-webkit-scrollbar { display:none; }
.lottery-tabs-wrap { display:flex; gap:8px; padding-bottom:4px; min-width:max-content; }
.lottery-tab {
  padding:9px 18px; border-radius:20px; border:2px solid rgba(197,168,128,0.3);
  background:transparent; color:var(--text); cursor:pointer;
  font-size:0.95rem; transition:all .3s; white-space:nowrap; user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.lottery-tab:active { transform:scale(0.95); }
.lottery-tab.active { background:rgba(197,168,128,0.3); border-color:var(--caramel); color:var(--espresso); font-weight:600; }
.lottery-tab-add {
  border-style:dashed; color:var(--text-light); font-size:1.2rem;
  padding:9px 14px; background:transparent;
}
.lottery-tab-add:active { background:rgba(197,168,128,0.15); }

/* 老虎机 */
.lottery-main { display:flex; flex-direction:column; align-items:center; gap:18px; margin-bottom:18px; }
.lottery-empty { text-align:center; padding:40px 20px; color:var(--text-light); display:flex; flex-direction:column; align-items:center; gap:16px; }
.slot-machine {
  position:relative; width:100%; max-width:380px;
}
.slot-window {
  height:130px; overflow:hidden; border-radius:16px;
  background:rgba(255,255,255,0.6); border:2px solid rgba(197,168,128,0.3);
  position:relative;
}
.slot-window::before, .slot-window::after {
  content:''; position:absolute; left:0; right:0; height:30px; z-index:2; pointer-events:none;
}
.slot-window::before { top:0; background:linear-gradient(to bottom, rgba(253,251,247,0.9), transparent); }
.slot-window::after { bottom:0; background:linear-gradient(to top, rgba(253,251,247,0.9), transparent); }
.slot-highlight {
  position:absolute; top:50%; left:8px; right:8px; height:50px; transform:translateY(-50%);
  border-top:2px dashed rgba(197,168,128,0.4); border-bottom:2px dashed rgba(197,168,128,0.4);
  border-radius:4px; pointer-events:none; z-index:1;
}
.slot-strip { display:flex; flex-direction:column; }
.slot-item {
  height:130px; display:flex; align-items:center; justify-content:center;
  font-size:1.8rem; font-weight:bold; color:var(--espresso);
  padding:0 20px; flex-shrink:0;
}

.lottery-draw-btn {
  width:100%; max-width:380px; padding:16px;
  background:var(--caramel); color:#fff;
  border:none; border-radius:16px; font-size:1.15rem; font-weight:500;
  cursor:pointer; transition:all .3s;
  box-shadow:0 4px 15px rgba(185,138,94,0.28);
  -webkit-tap-highlight-color:transparent;
}
.lottery-draw-btn:hover { transform:translateY(-2px); background:var(--caramel-hover); box-shadow:0 6px 20px rgba(185,138,94,0.35); }
.lottery-draw-btn:active { transform:scale(0.97); }
.lottery-draw-btn:disabled { opacity:0.6; cursor:not-allowed; transform:none; }

/* 结果区 */
.lottery-result { text-align:center; width:100%; max-width:380px; animation: fadeUp .4s ease; }
.lottery-result-text { font-size:1.1rem; color:var(--text); margin-bottom:14px; }
.lottery-result-text strong { color:var(--espresso); font-size:1.3rem; }
.lottery-result-actions { display:flex; gap:10px; }
.lottery-retry-btn, .lottery-confirm-btn {
  flex:1; padding:12px; border-radius:12px; font-size:0.95rem; cursor:pointer; transition:all .3s; border:none;
  -webkit-tap-highlight-color:transparent;
}
.lottery-retry-btn { background:rgba(197,168,128,0.2); color:var(--text); }
.lottery-retry-btn:active { background:rgba(197,168,128,0.4); }
.lottery-confirm-btn {
  background:var(--caramel); color:#fff;
  box-shadow:0 4px 12px rgba(185,138,94,0.28);
}
.lottery-confirm-btn:active { transform:scale(0.97); }

/* 管理选项按钮 */
.lottery-manage-bar { text-align:center; margin-bottom:24px; }
.lottery-manage-btn {
  padding:8px 24px; border-radius:20px; border:1px dashed rgba(197,168,128,0.5);
  background:transparent; color:var(--text-light); font-size:0.9rem;
  cursor:pointer; transition:all .3s;
  -webkit-tap-highlight-color:transparent;
}
.lottery-manage-btn:active { background:rgba(197,168,128,0.15); color:var(--text); }

/* 统计面板 */
.lottery-stats {
  background:var(--surface);
  border-radius:16px; border:1px solid var(--border); box-shadow:var(--shadow);
  overflow:hidden; transition:all .3s;
}
.lottery-stats-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 20px; cursor:pointer; font-weight:500; color:var(--espresso);
  user-select:none; -webkit-tap-highlight-color:transparent;
}
.lottery-stats-header:active { background:rgba(197,168,128,0.1); }
.lottery-stats-arrow { font-size:1.2rem; transition:transform .3s; color:var(--text-light); }
.lottery-stats-body { padding:0 20px 20px; }
.lottery-stats-empty { text-align:center; padding:20px 0; color:var(--text-light); font-size:0.9rem; }
.lottery-stats-group { margin-bottom:14px; }
.lottery-stats-cat-name { font-weight:600; color:var(--espresso); margin-bottom:8px; font-size:0.95rem; }
.lottery-stats-options { display:flex; flex-wrap:wrap; gap:8px; }
.lottery-stats-tag {
  padding:5px 14px; background:rgba(197,168,128,0.15); border-radius:14px;
  font-size:0.85rem; color:var(--text);
}
.lottery-stats-tag strong { color:var(--mocha); }

/* ==========================================
   响应式 — 平板 (≤768px)
   ========================================== */
@media (max-width: 768px) {
  .hamburger { display:flex; }
  .nav-menu {
    position:fixed; top:50px; right:-100%; width:200px; height:auto;
    background:rgba(253,251,247,0.95); backdrop-filter:blur(12px);
    flex-direction:column; gap:4px; padding:12px;
    border-radius:0 0 0 16px; box-shadow:-4px 8px 20px rgba(0,0,0,0.1);
    transition:right .3s ease; z-index:999;
  }
  .nav-menu.open { right:0; }
  .nav-link { width:100%; justify-content:flex-start; padding:10px 14px; }
  .nav-link::after { display:none; }
  .login-nav-btn { text-align:center; justify-content:center; }

  .page-header h1 { font-size:1.6rem; }
  .page-container { padding:60px 16px 32px; }
  .content-box { padding:24px 20px; max-width:100%; }
  .name-bar { font-size:22px; gap:10px; padding-top:70px; }
  .name-bar .heart { font-size:22px; }
  .timer { gap:8px; flex-wrap:nowrap; }
  .time-box { width:64px; height:64px; min-width:64px; padding:4px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .time-box span { font-size:22px; }

  .card-content { flex-direction:column; }
  .card-image { width:100%; height:160px; }
  .form-row { flex-direction:column; gap:0; }
  .detail-image { height:180px; }
  .detail-info { padding:16px 20px; }

  .gallery { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
  .viewer-content { max-width:95vw; max-height:70vh; }
  .viewer-nav { width:38px; height:38px; font-size:1.2rem; }
  .viewer-prev { left:6px; } .viewer-next { right:6px; }

  .modal { max-width:100%; border-radius:16px 16px 0 0; margin-top:auto; max-height:85vh; }
  .modal-overlay { align-items:flex-end; padding:0; }
  form { padding:20px; }

  .slot-machine { max-width:100%; }
  .slot-item { font-size:1.5rem; height:120px; }
  .slot-window { height:120px; }
  .lottery-draw-btn { max-width:100%; }
}

/* ==========================================
   响应式 — 手机 (≤480px)
   ========================================== */
@media (max-width: 480px) {
  .nav-logo { font-size:0.95rem; }
  .nav-menu { width:180px; top:50px; }
  .login-box { padding:28px 20px; border-radius:16px; }
  .logo { font-size:1.5rem; }
  .login-subtitle { font-size:0.85rem; }
  .login-btn { padding:12px; font-size:1rem; }

  .page-header h1 { font-size:1.4rem; }
  .page-subtitle { font-size:0.9rem; }
  .action-bar { flex-direction:column; align-items:stretch; text-align:center; }
  .add-btn { justify-content:center; width:100%; padding:14px; }
  .stats { text-align:center; }

  .name-bar { font-size:18px; gap:8px; padding-top:65px; }
  .name-bar .heart { font-size:18px; }
  .timer { gap:6px; flex-wrap:nowrap; justify-content:center; }
  .time-box { width:56px; height:56px; min-width:56px; padding:2px; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .time-box span { font-size:18px; }
  .content-box { padding:20px 16px; max-width:100%; }

  .timeline { padding-left:22px; }
  .travel-card { padding:16px; margin-bottom:16px; }
  .travel-card::before { left:-20px; width:10px; height:10px; }
  .card-image { height:140px; }
  .card-title { font-size:1.05rem; }

  .gallery { grid-template-columns:repeat(2,1fr); gap:8px; }
  .photo-card { border-radius:12px; }
  .filter-bar { gap:6px; }
  .filter-btn { padding:6px 12px; font-size:0.8rem; }

  .modal-header { padding:16px 18px; }
  .modal-header h2 { font-size:1.1rem; }
  form { padding:16px; }
  .form-actions { flex-direction:column; }
  .detail-actions { flex-direction:column; }

  .category-manage-item { flex-wrap:wrap; }
  .category-edit-input { width:100%; flex:none; }
  .category-save-btn, .category-delete-btn { flex:1; }

  .viewer-content { max-width:100vw; max-height:65vh; }
  .viewer-nav { width:34px; height:34px; font-size:1rem; }
  .viewer-close { width:38px; height:38px; font-size:1.5rem; }
  .viewer-info { padding:16px 20px 24px; }
}

/* =========================== 日历页面 =========================== */
.calendar-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* 月份导航 */
.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.month-title {
  font-size: 1.25rem; font-weight: 700; color: var(--espresso);
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px; transition: background .2s;
}
.month-title:hover { background: rgba(185,138,94,0.08); }
.month-title .caret {
  font-size: 0.75rem; color: var(--text-light);
  transition: transform .2s;
}
.month-nav-actions {
  display: flex; align-items: center; gap: 8px;
}
.month-nav-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 50%; font-size: 1rem; color: var(--text);
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.month-nav-btn:hover { background: var(--surface-soft); border-color: var(--caramel); color: var(--caramel-hover); }
.month-nav-btn:active { transform: scale(0.94); }

/* 月份选择器 */
.month-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}
.month-picker-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-weight: 700; color: var(--espresso);
}
.month-picker-nav {
  width: 28px; height: 28px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 50%;
  font-size: 0.9rem; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.month-picker-nav:hover { border-color: var(--caramel); color: var(--caramel-hover); }
.month-picker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.month-picker-item {
  padding: 10px 0; text-align: center; border-radius: 10px;
  font-size: 0.9rem; color: var(--text); cursor: pointer;
  transition: all .18s;
}
.month-picker-item:hover { background: var(--surface-soft); }
.month-picker-item.active {
  background: var(--caramel); color: #fff; font-weight: 700;
}

.today-btn {
  padding: 8px 16px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 999px;
  color: var(--caramel-hover); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.today-btn:hover { background: rgba(185,138,94,0.1); border-color: var(--caramel); }

/* 日历网格 */
.calendar-grid-wrap {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: 22px; padding: 24px 24px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.calendar-grid .weekday {
  padding: 6px 0 10px;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 1px;
}
.calendar-grid .day-cell {
  padding: 8px 2px;
  cursor: pointer;
  border-radius: 10px;
  transition: all .18s;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.calendar-grid .day-cell:hover { background: var(--surface-soft); }
.calendar-grid .day-cell:active { transform: scale(0.96); }

/* 日期数字 */
.calendar-grid .day-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.9rem; color: var(--text);
  font-weight: 500; transition: all .18s;
}

/* 非当月日期 */
.calendar-grid .day-cell.other-month .day-num {
  color: #C9BFAF;
}
.calendar-grid .day-cell.other-month {
  cursor: default;
}

/* 今天 */
.calendar-grid .day-cell.today .day-num {
  background: var(--caramel); color: #fff; font-weight: 700;
  box-shadow: 0 3px 8px rgba(185,138,94,0.35);
}

/* 选中日期 */
.calendar-grid .day-cell.selected .day-num {
  border: 2px solid var(--caramel); color: var(--caramel-hover); font-weight: 700;
}
.calendar-grid .day-cell.selected.today .day-num {
  background: var(--caramel); color: #fff; border: 2px solid var(--caramel);
}

/* 事件圆点标记 */
.day-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}
.day-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 事件列表侧栏 */
.event-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 22px; padding: 24px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: 80px;
}
.event-sidebar-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.event-sidebar-header h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
}
.event-sidebar-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.event-sidebar .export-btn {
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--caramel-hover); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.event-sidebar .export-btn:hover { background: var(--surface-soft); border-color: var(--caramel); }
.event-sidebar .add-event-btn {
  padding: 9px 18px; background: var(--caramel);
  border: none; border-radius: 999px; color: #fff;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all .2s;
  box-shadow: 0 3px 10px rgba(185,138,94,0.3);
  -webkit-tap-highlight-color: transparent;
}
.event-sidebar .add-event-btn:hover { background: var(--caramel-hover); transform: translateY(-1px); }
.event-sidebar-empty {
  text-align: center; padding: 40px 10px; color: var(--text-light); font-size: 0.9rem;
}
.event-sidebar-list {
  display: flex; flex-direction: column; gap: 10px;
}

/* 事件卡片 */
.event-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; border-radius: 14px;
  cursor: pointer; transition: all .18s;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}
.event-card:hover { border-color: var(--caramel); box-shadow: var(--shadow); transform: translateY(-1px); }
.event-card:active { transform: scale(0.98); }
.event-card .event-color-bar {
  width: 4px; border-radius: 4px; flex-shrink: 0;
  align-self: stretch; min-height: 36px;
}
.event-card .event-color-bar.travel {
  background: #95c4a0;
}
.event-card .event-info { flex: 1; min-width: 0; }
.event-card .event-title {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  margin-bottom: 3px;
}
.event-card .event-meta {
  font-size: 0.75rem; color: var(--text-light);
}
.event-card .event-note {
  font-size: 0.8rem; color: var(--text-light);
  margin-top: 5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-card .event-delete-btn {
  width: 26px; height: 26px; border: none; background: rgba(220,100,100,0.12);
  border-radius: 50%; color: #C25B5B; font-size: 0.9rem; cursor: pointer;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  align-self: center;
  transition: all .2s; opacity: 0;
}
.event-card:hover .event-delete-btn { opacity: 1; }
.event-card .event-delete-btn:active { background: rgba(220,100,100,0.35); }

/* 提醒横幅 */
.reminder-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; margin-bottom: 20px;
  background: linear-gradient(135deg, #FBF3E8, #F6E9D7);
  border: 1px solid #F0E0C8; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(90,60,30,0.06);
  font-size: 0.9rem; color: var(--caramel-hover);
}
.reminder-banner .reminder-close {
  width: 26px; height: 26px; border: none; background: rgba(185,138,94,0.15);
  border-radius: 50%; color: var(--caramel-hover); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.reminder-banner .reminder-close:active { background: rgba(185,138,94,0.3); }

/* 响应式 — 平板 */
@media (max-width: 768px) {
  .calendar-container { flex-direction: column; gap: 16px; align-items: stretch; }
  .calendar-grid-wrap { width: 100%; }
  .event-sidebar { width: 100%; position: static; }
  .calendar-grid .day-cell { min-height: 52px; padding: 6px 2px; }
  .calendar-grid .day-num { width: 28px; height: 28px; font-size: 0.85rem; }
}

/* 响应式 — 手机 */
@media (max-width: 480px) {
  .calendar-grid-wrap { padding: 16px 12px 14px; }
  .calendar-grid { gap: 2px; }
  .calendar-grid .day-cell { min-height: 46px; padding: 5px 0; border-radius: 8px; }
  .calendar-grid .day-num { width: 26px; height: 26px; font-size: 0.82rem; }
  .calendar-grid .weekday { font-size: 0.72rem; padding: 5px 0 8px; }
  .day-dot { width: 4px; height: 4px; }
  .month-nav-btn { width: 30px; height: 30px; font-size: 0.9rem; }
  .month-title { font-size: 1rem; }
  .today-btn { padding: 6px 12px; font-size: 0.78rem; }
  .event-card:hover .event-delete-btn { opacity: 1; }
  .event-sidebar { padding: 18px 16px; }
  .event-sidebar-header h3 { font-size: 1rem; }

  .lottery-tab { padding:7px 14px; font-size:0.85rem; }
  .lottery-tab-add { padding:7px 12px; font-size:1rem; }
  .slot-item { font-size:1.3rem; height:110px; }
  .slot-window { height:110px; }
  .lottery-draw-btn { font-size:1rem; padding:14px; }
  .lottery-result-text { font-size:1rem; }
  .lottery-result-text strong { font-size:1.15rem; }
  .lottery-stats-header { padding:12px 16px; font-size:0.9rem; }
  .lottery-stats-body { padding:0 12px 16px; }
}

/* =========================== 首页时间轴 =========================== */
.timeline-section {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 0 20px;
}
.timeline-section-head {
  text-align: center;
  margin-bottom: 32px;
}
.timeline-section-head .line {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.timeline-section-head .line::before,
.timeline-section-head .line::after {
  content: ''; width: 40px; height: 1px; background: var(--border);
}
.timeline-section-head h2 {
  font-size: 20px; font-weight: 700; color: var(--espresso); letter-spacing: 2px;
}
.timeline-section-head p { color: var(--text-light); font-size: 13px; margin-top: 6px; }

.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--caramel), var(--caramel), rgba(185,138,94,0.15));
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 28px; }
.tl-dot {
  position: absolute; left: -40px; top: 20px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid #fff;
  z-index: 1;
}
.tl-year {
  position: relative; margin: 8px 0 20px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--caramel);
}
.tl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.tl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tl-card .date { font-size: 12px; color: var(--text-light); letter-spacing: 0.5px; }
.tl-card .title-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; flex-wrap: wrap; }
.tl-card .title { font-size: 17px; font-weight: 700; }
.tl-tag {
  font-size: 11px; padding: 2px 10px; border-radius: 999px;
  color: #fff; font-weight: 500; white-space: nowrap;
}
.tl-card .desc { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.tl-card .thumb {
  width: 100%; height: 150px; margin-top: 12px; border-radius: 10px;
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.tl-card .thumb .thumb-tag {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 11px; color: #fff; background: rgba(0,0,0,0.4);
  padding: 2px 10px; border-radius: 999px;
}
.tl-card.diary { background: var(--surface-soft); border-style: dashed; }
.timeline-empty {
  text-align: center; padding: 40px 20px; color: var(--text-light); font-size: 14px;
}

/* 响应式 — 平板 */
@media (max-width: 768px) {
  .timeline-section { margin-top: 32px; }
}

/* 响应式 — 手机 */
@media (max-width: 480px) {
  .timeline-section { padding: 0 16px; }
  .timeline { padding-left: 34px; }
  .timeline::before { left: 13px; }
  .tl-dot { left: -34px; }
  .tl-card { padding: 15px 16px; }
  .tl-card .thumb { height: 120px; }
}

/* ==========================================
   情侣留言板
   ========================================== */
.message-board {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); overflow: hidden;
}

.message-list {
  padding: 20px 20px 10px;
  height: 56vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}

.message-bubble {
  max-width: 78%; padding: 12px 16px;
  border-radius: 16px; position: relative;
  animation: fadeUp .3s ease;
}
.message-bubble.mine {
  align-self: flex-end;
  background: var(--caramel);
  color: #fff; border-bottom-right-radius: 4px;
}
.message-bubble.theirs {
  align-self: flex-start;
  background: var(--surface); color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(90,60,30,0.06);
}

.message-sender {
  font-size: 0.78rem; margin-bottom: 4px; opacity: 0.75; font-weight: 600;
}
.message-bubble.theirs .message-sender { color: var(--text-light); }
.message-content {
  font-size: 0.98rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.message-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: 0.72rem; opacity: 0.65; justify-content: flex-end;
}
.message-del {
  border: none; background: none; cursor: pointer;
  font-size: 0.72rem; text-decoration: underline; opacity: 0.8; padding: 0;
}
.message-bubble.mine .message-del { color: #fff; }
.message-bubble.theirs .message-del { color: var(--text-light); }

.message-input-bar {
  display: flex; gap: 10px; padding: 14px 16px;
  background: var(--surface-soft); border-top: 1px solid var(--border);
}
.message-input-bar input {
  flex: 1; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: 24px; font-size: 0.95rem; color: var(--text);
  background: var(--surface); transition: all .3s;
}
.message-input-bar input:focus {
  outline: none; border-color: var(--caramel);
  box-shadow: 0 0 0 3px rgba(185,138,94,0.12);
}
.message-input-bar button {
  padding: 0 22px; border: none; border-radius: 24px;
  background: var(--caramel); color: #fff;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all .3s;
  white-space: nowrap;
}
.message-input-bar button:hover:not(:disabled) { transform: translateY(-2px); background: var(--caramel-hover); box-shadow: 0 4px 12px rgba(185,138,94,0.35); }
.message-input-bar button:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-icon { font-size: 2.6rem; margin-bottom: 6px; }

@media (max-width: 480px) {
  .message-list { height: 52vh; padding: 14px 14px 8px; }
  .message-bubble { max-width: 86%; }
  .message-input-bar { padding: 10px 12px; }
  .message-input-bar button { padding: 0 16px; }
}

/* =========================== 心愿页 =========================== */
:root {
  --wish-rule: #E3D8C7;
  --wish-warn: #C99A4E;
  --wish-no: #C08080;
  --wish-done: #8B9DB5;
  --wish-ok: #7FA87F;
  --serif-cn: "Songti SC","STSong","SimSun",Georgia,serif;
}

/* 余额条 */
.balance-bar {
  background: linear-gradient(135deg,#FFFDFA 0%,#FBF6EE 100%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 22px; box-shadow: var(--shadow); margin-bottom: 22px;
  cursor: pointer; display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  transition: box-shadow .3s, transform .25s;
}
.balance-bar:hover { box-shadow: var(--shadow-lg); }
.bal-main { display: flex; align-items: baseline; gap: 9px; }
.bal-label { font-size: 0.82rem; color: var(--text-light); letter-spacing: 1px; }
.bal-amount { font-family: var(--serif-cn); font-size: 2rem; font-weight: bold; color: var(--caramel); line-height: 1; }
.bal-amount .sym { font-size: 1.1rem; margin-right: 2px; }
.bal-sub { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--text-light); flex-wrap: wrap; }
.bal-sub .dot { color: #B0A091; }
.bal-pending { color: #9C7327; font-weight: 600; }
.bal-spacer { flex: 1; }
.bal-actions { display: flex; gap: 9px; }
.bal-btn {
  padding: 8px 15px; border-radius: 9px; font-size: 0.84rem; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-light);
  font-family: inherit; transition: all .25s;
}
.bal-btn:hover { border-color: var(--caramel); color: var(--mocha); }
.bal-btn.primary { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.bal-btn.primary:hover { background: var(--caramel-hover); }

/* 心愿页 Tab 与筛选 */
.wish-tabs { display: flex; justify-content: center; gap: 9px; margin-bottom: 15px; }
.wish-tab {
  padding: 10px 26px; border-radius: 22px; border: 2px solid rgba(197,168,128,0.3);
  background: transparent; color: var(--text); cursor: pointer; font-size: 0.95rem;
  transition: all .3s; font-family: inherit;
}
.wish-tab.active { background: rgba(197,168,128,0.3); border-color: var(--caramel); color: var(--espresso); font-weight: 600; }
.wish-filters { display: flex; justify-content: center; gap: 7px; margin-bottom: 24px; flex-wrap: wrap; }
.wish-chip {
  padding: 6px 13px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-light); cursor: pointer;
  font-size: 0.82rem; font-family: inherit; transition: all .25s;
}
.wish-chip.active { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.wish-chip-n { opacity: 0.6; margin-left: 3px; font-size: 0.74rem; }

.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); gap: 19px; }

/* 购物申请卡片 */
.buy-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.buy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.buy-card.is-dead { opacity: 0.68; }
.buy-head { display: flex; gap: 8px; align-items: center; padding: 14px 17px 0; }
.buy-badge { padding: 3px 9px; border-radius: 10px; font-size: 0.71rem; font-weight: 600; background: rgba(185,138,94,0.14); color: var(--mocha); }
.buy-body { padding: 11px 17px 15px; flex: 1; display: flex; flex-direction: column; }
.buy-title {
  font-size: 1.06rem; font-weight: bold; margin-bottom: 7px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.buy-price { color: #C2694B; font-weight: bold; font-size: 1.02rem; margin-bottom: 8px; font-family: var(--serif-cn); }
.buy-reason {
  font-size: 0.85rem; color: var(--text-light); line-height: 1.6; margin-bottom: 11px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.buy-thumbs { display: flex; gap: 6px; margin-bottom: 11px; }
.buy-thumb { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.buy-thumb img { width: 100%; height: 100%; object-fit: cover; }
.buy-thumb.more { display: flex; align-items: center; justify-content: center; background: #FBF8F3; color: var(--text-light); font-size: 0.75rem; font-weight: 600; }
.buy-foot {
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 0.79rem; color: var(--text-light); flex-wrap: wrap;
}
.buy-foot .arrow { color: var(--caramel); margin: 0 5px; font-family: var(--serif-cn); }

/* 状态标签 */
.wish-st { margin-left: auto; padding: 3px 10px; border-radius: 10px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.wish-st-pending    { background: rgba(217,168,96,0.17);  color: #9C7327; }
.wish-st-discussing { background: rgba(185,138,94,0.17);  color: #8B5A2B; }
.wish-st-approved   { background: rgba(127,168,127,0.17); color: #4F7A4F; }
.wish-st-rejected   { background: rgba(201,139,139,0.17); color: #A05A5A; }
.wish-st-redeemed   { background: rgba(139,157,181,0.17); color: #5A6E8B; }
.wish-st-active     { background: rgba(185,138,94,0.17);  color: #8B5A2B; }
.wish-st-used       { background: rgba(139,157,181,0.17); color: #5A6E8B; }
.wish-st-expired    { background: rgba(176,160,145,0.18); color: #8C7A69; }

/* 券样卡片 */
.voucher-card {
  position: relative; display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.voucher-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.voucher-card.is-dead { opacity: 0.62; }
.voucher-card.is-dead .stub-word { color: #B9A896; }
.voucher-main { flex: 1; min-width: 0; padding: 15px 16px 13px; display: flex; flex-direction: column; }
.v-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.v-type { padding: 3px 9px; border-radius: 11px; font-size: 0.71rem; font-weight: 600; background: rgba(185,138,94,0.14); color: var(--mocha); }
.v-title { font-family: var(--serif-cn); font-size: 1.22rem; letter-spacing: 2px; margin-bottom: 8px; line-height: 1.35; color: var(--espresso); }
.v-msg {
  font-size: 0.85rem; color: var(--text-light); line-height: 1.65; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v-times { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.v-pips { display: flex; gap: 4px; }
.v-pip { width: 9px; height: 9px; border-radius: 50%; background: var(--caramel); }
.v-pip.off { background: var(--border); }
.v-times-txt { font-size: 0.79rem; color: var(--text-light); }
.v-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--wish-rule);
  font-size: 0.79rem; color: var(--text-light); display: flex; gap: 6px; align-items: center;
}
.v-foot .arrow { color: var(--caramel); font-family: var(--serif-cn); }
.voucher-stub {
  width: 104px; flex-shrink: 0; position: relative; background: #FBF8F3;
  border-left: 2px dashed var(--wish-rule); padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.voucher-stub::before, .voucher-stub::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream); left: -9px;
}
.voucher-stub::before { top: -8px; }
.voucher-stub::after { bottom: -8px; }
.stub-word {
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: var(--serif-cn); font-size: 0.9rem; letter-spacing: 5px;
  color: var(--caramel); font-weight: bold;
}
.stub-no {
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 0.67rem; color: #B0A091; letter-spacing: 1px;
  font-family: Consolas,"Courier New",monospace;
}
.stub-date { font-size: 0.64rem; color: #B0A091; text-align: center; line-height: 1.55; }
.voucher-stamp {
  position: absolute; right: 118px; top: 50%; margin-top: -30px;
  width: 60px; height: 60px; border: 2.5px solid rgba(139,157,181,0.42);
  border-radius: 50%; color: rgba(139,157,181,0.72);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-cn); font-size: 0.76rem; letter-spacing: 1px;
  transform: rotate(-14deg); pointer-events: none;
}
.voucher-stamp.grey { border-color: rgba(176,160,145,0.45); color: rgba(176,160,145,0.85); }

/* 券类型选择 */
.vtype-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.vtype-pill {
  padding: 8px 15px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 0.87rem;
  transition: all .25s; font-family: var(--serif-cn); letter-spacing: 1px;
}
.vtype-pill:hover { border-color: var(--caramel); }
.vtype-pill.on { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.vtype-pill.manage {
  border-style: dashed; color: var(--text-light); font-family: inherit;
  font-size: 0.8rem; letter-spacing: 0; padding: 8px 12px;
}

/* 详情中的小券样 */
.detail-voucher { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.detail-voucher .voucher-main { padding: 17px 20px; }
.detail-voucher .voucher-stub { width: 118px; }

/* 详情图片横滑 */
.detail-gallery { display: flex; gap: 9px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.detail-gallery img { height: 168px; border-radius: 12px; flex-shrink: 0; }

/* 上传区与缩略图 */
.upload-area {
  border: 2px dashed var(--border); border-radius: 12px; padding: 19px;
  text-align: center; cursor: pointer; color: var(--text-light);
  font-size: 0.88rem; background: var(--surface); transition: all .3s;
}
.upload-area:hover { border-color: var(--caramel); background: rgba(197,168,128,0.06); }
.thumb-list { display: flex; gap: 9px; margin-top: 11px; flex-wrap: wrap; }
.thumb-list .thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.thumb-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-list .thumb .rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  border: none; cursor: pointer; font-size: 0.78rem; line-height: 1;
}
.hint { font-size: 0.78rem; color: var(--text-light); margin-top: 6px; }

/* 心愿页字段明细 */
.wish-field { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.91rem; }
.wish-field:last-of-type { border-bottom: none; }
.wish-field .k { color: var(--text-light); width: 88px; flex-shrink: 0; }
.wish-field .v { flex: 1; word-break: break-all; }
.wish-field .v a { color: var(--caramel); }
.wish-field .v .empty { color: #B0A091; }

/* 心愿页操作区 */
.wish-actions { display: flex; gap: 9px; margin: 16px 0 0; flex-wrap: wrap; padding-top: 16px; border-top: 1px dashed var(--wish-rule); }
.wish-actions.right { justify-content: flex-end; }
.wish-actions .submit-btn, .wish-actions .cancel-btn { flex: none; padding: 9px 16px; font-size: 0.88rem; }
.wish-actions .submit-btn.ok { background: var(--wish-ok); }
.wish-actions .submit-btn.warn { background: var(--wish-warn); }
.wish-actions .submit-btn.no { background: var(--wish-no); }
.wish-actions .submit-btn.done { background: var(--wish-done); }
.wish-flow-tip { font-size: 0.78rem; color: #B0A091; margin-top: 9px; line-height: 1.65; }
.wish-perm-note {
  font-size: 0.76rem; color: #B0A091; background: #FBF8F3;
  border: 1px dashed var(--wish-rule); border-radius: 9px;
  padding: 8px 12px; margin-top: 12px; line-height: 1.6;
}
.respond-note {
  background: rgba(197,168,128,0.12); border-left: 3px solid var(--caramel);
  padding: 11px 14px; border-radius: 0 10px 10px 0; font-size: 0.88rem;
  margin-top: 12px; line-height: 1.65;
}
.use-note {
  background: rgba(127,168,127,0.1); border-left: 3px solid var(--wish-ok);
  padding: 11px 14px; border-radius: 0 10px 10px 0; font-size: 0.88rem;
  margin-top: 10px; line-height: 1.65;
}
.use-note .who { font-weight: 600; color: #4F7A4F; }

/* 心愿页讨论区 */
.wish-cmt-list { display: flex; flex-direction: column; gap: 11px; }
.wish-cmt { display: flex; gap: 10px; }
.wish-cmt-avatar {
  width: 33px; height: 33px; border-radius: 50%; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 600;
}
.wish-cmt-main { flex: 1; min-width: 0; }
.wish-cmt-head { font-size: 0.78rem; color: var(--text-light); margin-bottom: 4px; }
.wish-cmt-text {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 13px; font-size: 0.89rem; line-height: 1.62; word-break: break-word;
}
.wish-cmt-sys { text-align: center; font-size: 0.76rem; color: #B0A091; padding: 4px 0; }
.wish-cmt-sys span { background: rgba(185,138,94,0.1); padding: 3px 12px; border-radius: 10px; }
.wish-cmt-input { display: flex; gap: 10px; margin-top: 13px; }
.wish-cmt-input input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.92rem; font-family: inherit; background: var(--surface); color: var(--text);
}
.wish-cmt-input input:focus { outline: none; border-color: var(--caramel); }

/* 账目明细 */
.ledger-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-who {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 600;
}
.ledger-main { flex: 1; min-width: 0; }
.ledger-title { color: var(--text); margin-bottom: 2px; }
.ledger-sub { font-size: 0.77rem; color: #B0A091; }
.ledger-amt { font-family: var(--serif-cn); font-weight: bold; font-size: 1rem; white-space: nowrap; }
.ledger-amt.in { color: #4F7A4F; }
.ledger-amt.out { color: #A05A5A; }
.ledger-sum {
  display: flex; justify-content: space-between; padding: 14px 0 4px;
  font-size: 0.95rem; border-top: 2px solid var(--border); margin-top: 6px;
}
.ledger-sum .big { font-family: var(--serif-cn); font-size: 1.35rem; font-weight: bold; color: var(--caramel); }

.wish-section-title { font-size: 0.96rem; font-weight: 600; margin: 22px 0 11px; display: flex; align-items: center; gap: 8px; }
.wish-section-title::before { content: ''; width: 3px; height: 15px; background: var(--caramel); border-radius: 2px; }

.empty-title { font-size: 1rem; margin-bottom: 10px; }

/* 心愿页悬浮新增按钮（独立命名，避免与通用短类名冲突，并让心愿页样式自成一体） */
.fab-btn {
  position: fixed; right: 28px; bottom: 28px; width: 58px; height: 58px;
  border-radius: 50%; background: var(--caramel); color: #fff; border: none;
  font-size: 1.9rem; cursor: pointer; line-height: 1; z-index: 90;
  box-shadow: 0 8px 26px rgba(185,138,94,0.45); transition: all .3s;
}
.fab-btn:hover { background: var(--caramel-hover); transform: scale(1.06); }
.fab-btn:active { transform: scale(0.96); }

/* 次级悬浮按钮：申请券 */
.fab-btn.sub {
  right: 96px; width: 46px; height: 46px; font-size: 1.05rem;
  background: var(--surface); color: var(--caramel);
  border: 1.5px solid var(--caramel);
  box-shadow: 0 6px 18px rgba(185,138,94,0.3);
}
.fab-btn.sub:hover { background: rgba(185,138,94,0.1); }
@media (max-width: 768px) { .fab-btn.sub { right: 78px; bottom: 19px; } }

@media (max-width: 768px) {
  .wish-grid { grid-template-columns: 1fr; gap: 15px; }
  .balance-bar { padding: 13px 16px; gap: 14px; }
  .bal-amount { font-size: 1.65rem; }
  .wish-tab { padding: 9px 20px; }
  .fab-btn { right: 18px; bottom: 18px; }

  /* 手机端：券根转到顶部 */
  .voucher-card { flex-direction: column; }
  .voucher-card .voucher-stub {
    width: 100%; border-left: none; border-bottom: 2px dashed var(--wish-rule);
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 9px 14px; order: -1; gap: 10px;
  }
  .voucher-card .voucher-stub::before { top: auto; bottom: -9px; left: -8px; }
  .voucher-card .voucher-stub::after  { top: auto; bottom: -9px; left: auto; right: -8px; }
  .voucher-card .stub-word,
  .voucher-card .stub-no { writing-mode: horizontal-tb; letter-spacing: 2px; }
  .voucher-card .stub-word { font-size: 0.8rem; }
  .voucher-card .stub-no { font-size: 0.7rem; }
  .voucher-card .stub-date { text-align: right; line-height: 1.4; white-space: nowrap; }
  .voucher-card .voucher-stamp { right: 14px; top: 46px; margin-top: 0; width: 54px; height: 54px; font-size: 0.7rem; }

  .detail-voucher { flex-direction: column; }
  .detail-voucher .voucher-stub {
    width: 100%; border-left: none; border-bottom: 2px dashed var(--wish-rule);
    flex-direction: row; padding: 9px 14px; order: -1; justify-content: space-between;
  }
  .detail-voucher .stub-word,
  .detail-voucher .stub-no { writing-mode: horizontal-tb; letter-spacing: 2px; }
}

/* =========================== 日期选择器 =========================== */
/* 自绘月历，替代原生 input[type=date]。
   原因：部分安卓自带浏览器不弹原生日期选择器。 */
.dp-wrap { position: relative; }

.dp-trigger {
  width:100%; padding:12px 15px; border:1.5px solid var(--border); border-radius:10px;
  font-size:1rem; color:var(--text); background:var(--surface);
  cursor:pointer; display:flex; align-items:center; justify-content:space-between;
  gap:10px; transition:all .25s; min-height:48px;
  -webkit-tap-highlight-color:transparent;
}
.dp-trigger:hover { border-color:var(--caramel); }
.dp-trigger.open { border-color:var(--caramel); box-shadow:0 0 0 3px rgba(185,138,94,0.12); }
.dp-val { flex:1; }
.dp-val.placeholder { color:#B0A091; }
.dp-icon {
  width:18px; height:18px; flex-shrink:0; opacity:0.55;
  background:no-repeat center/contain;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C7A69' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
}

/* 首页纪念日输入框：沿用该处原有的居中加宽外观 */
.dp-trigger.dp-settings {
  min-width:200px; padding:12px 20px; text-align:center;
  border:2px solid rgba(180,140,120,0.2); border-radius:12px;
  color:#5c4033; background:#fef9f2; justify-content:center;
}
.dp-trigger.dp-settings.open { border-color:#e8a87c; box-shadow:none; }
.dp-trigger.dp-settings .dp-icon { display:none; }

/* 月历面板 */
.dp-pop {
  position:absolute; top:calc(100% + 8px); left:0; z-index:50;
  background:var(--surface); border:1px solid var(--border); border-radius:14px;
  box-shadow:var(--shadow-lg); padding:16px; width:308px;
  animation:dpPopIn .18s ease;
}
@keyframes dpPopIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
/* 下方空间不足（弹窗内表单）时向上弹出，避免被 .modal 的 overflow-y:auto 裁掉 */
.dp-pop.up {
  top:auto; bottom:calc(100% + 8px);
  animation:dpPopUpIn .18s ease;
}
@keyframes dpPopUpIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.dp-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.dp-nav {
  width:32px; height:32px; border:1px solid var(--border); background:var(--surface);
  border-radius:9px; cursor:pointer; color:var(--text-light); font-size:1rem;
  display:flex; align-items:center; justify-content:center; transition:all .22s; font-family:inherit;
}
.dp-nav:hover { border-color:var(--caramel); color:var(--caramel); }
.dp-title { font-family:var(--serif-cn); font-size:1.02rem; letter-spacing:1px; color:var(--espresso); }

.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.dp-wd { text-align:center; font-size:0.72rem; color:#B0A091; padding:6px 0; font-weight:500; }
.dp-day {
  aspect-ratio:1; border:none; background:transparent; border-radius:9px;
  cursor:pointer; font-size:0.86rem; color:var(--text); font-family:inherit;
  display:flex; align-items:center; justify-content:center; transition:all .15s;
  position:relative;
}
.dp-day:hover:not(:disabled):not(.sel) { background:rgba(197,168,128,0.2); }
.dp-day.other { color:#D0C4B4; }
.dp-day.today { color:var(--caramel); font-weight:700; }
.dp-day.today::after {
  content:''; position:absolute; bottom:4px; left:50%; transform:translateX(-50%);
  width:4px; height:4px; border-radius:50%; background:var(--caramel);
}
.dp-day.sel { background:var(--caramel); color:#fff; font-weight:600; }
.dp-day.sel::after { background:#fff; }
.dp-day:disabled { color:#DED5C8; cursor:not-allowed; text-decoration:line-through; }

.dp-foot { display:flex; gap:8px; margin-top:13px; padding-top:13px; border-top:1px solid var(--border); }
.dp-foot button {
  flex:1; padding:8px; border-radius:9px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-light); font-size:0.83rem;
  cursor:pointer; font-family:inherit; transition:all .22s;
}
.dp-foot button:hover { border-color:var(--caramel); color:var(--mocha); }

/* 遮罩仅在手机端显示 */
.dp-sheet-mask { display:none; }

@media (max-width: 768px) {
  /* 手机端：月历从底部升起 */
  .dp-pop {
    position:fixed; left:0; right:0; bottom:0; top:auto;
    width:100%; border-radius:18px 18px 0 0; padding:18px 16px 22px;
    box-shadow:0 -12px 40px rgba(40,25,10,0.22);
    animation:dpSheetUp .22s ease;
  }
  @keyframes dpSheetUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
  .dp-day { font-size:0.92rem; }
  .dp-sheet-mask.show {
    display:block; position:fixed; inset:0;
    background:rgba(40,28,18,0.4); z-index:45; animation:dpFadeIn .2s ease;
  }
  @keyframes dpFadeIn { from { opacity:0; } to { opacity:1; } }
}

/* ========================================
   上传进度环 — 相册 / 旅游 / 心愿 三处共用
   环形用 SVG stroke-dasharray，不用 conic-gradient（部分安卓自带浏览器不支持）
   ======================================== */
.up-overlay {
  position: fixed; inset: 0;
  background: rgba(70,50,35,0.42);
  display: flex; align-items: center; justify-content: center;
  z-index: 1200; padding: 20px;
}
.up-card {
  background: #fff; border-radius: 18px;
  padding: 30px 34px 26px; text-align: center;
  box-shadow: 0 18px 50px rgba(120,84,58,0.22);
  animation: modalIn .26s cubic-bezier(.32,.72,0,1);
  min-width: 240px;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.up-ring-wrap { position: relative; width: 148px; height: 148px; margin: 0 auto; }
.up-ring-wrap svg { transform: rotate(-90deg); display: block; }
.up-ring-track {
  fill: none; stroke: rgba(180,140,120,0.16); stroke-width: 9;
}
.up-ring-bar {
  fill: none; stroke: url(#upRingGrad); stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset .28s cubic-bezier(.32,.72,0,1);
}
.up-ring-bar.is-done { stroke: #4f7a55; }
.up-ring-bar.is-error { stroke: #b06a6a; }
.up-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.up-ring-pct {
  font-size: 34px; font-weight: 700; line-height: 1;
  color: #5c4033; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.up-ring-pct .unit { font-size: 16px; font-weight: 600; color: #a8907c; margin-left: 2px; }
.up-ring-label { font-size: 12px; color: #b09888; margin-top: 5px; letter-spacing: 1px; }
.up-card.done .up-ring-pct { color: #4f7a55; }
.up-card.error .up-ring-pct { color: #b06a6a; }
.up-title { font-size: 16px; font-weight: 600; color: #5c4033; margin: 18px 0 5px; }
.up-sub { font-size: 13px; color: #b09888; }
.up-sub b { color: #d4956b; font-weight: 700; font-variant-numeric: tabular-nums; }
.up-sub.error-txt { color: #b06a6a; margin-top: 8px; max-width: 240px; line-height: 1.6; }
.up-bar-mini {
  width: 168px; height: 4px; border-radius: 2px;
  background: rgba(180,140,120,0.16); margin: 16px auto 0; overflow: hidden;
}
.up-bar-mini i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #f0c4a8, #d4956b);
  transition: width .28s;
}

/* 手机端：环略小，避免撑破小屏 */
@media (max-width: 768px) {
  .up-ring-wrap { width: 124px; height: 124px; }
  .up-ring-wrap svg { width: 124px; height: 124px; }
  .up-ring-pct { font-size: 29px; }
  .up-bar-mini { width: 140px; }
}

/* ==========================================================
   AI 助手 — 悬浮球与抽屉面板
   所有类名以 .agent- 开头，不复用也不覆盖任何既有选择器。
   主色加深到 #8F6540，满足白字 4.5:1 对比度。
   ========================================================== */
:root {
  --ag-accent: #8F6540;
  --ag-accent-hover: #7C5536;
  --ag-accent-soft: #F4F0EC;
  --ag-ink: #4A3A2E;
  --ag-ink-2: #7A6857;
  --ag-ink-3: #8F7A66;
  --ag-line: #EDE4D6;
  --ag-line-2: #F1E9DC;
  --ag-line-3: #D8C8B2;
  --ag-wait: #7A5410;
  --ag-wait-bg: #EFEAE2;
  --ag-ok: #3F6B3F;
  --ag-ok-bg: #ECF0EC;
  --ag-err: #96504E;
  --ag-err-bg: #F5EEED;
  --ag-err-soft: #FBEDEB;
  --ag-z-ball: 950;
  --ag-z-panel: 1100;
  --ag-z-layer: 1160;
  --ag-dur-fast: 120ms;
  --ag-dur-base: 180ms;
  --ag-dur-panel: 240ms;
  --ag-ease: cubic-bezier(.32,.72,0,1);
  --ag-avatar: url('/img/ai-avatar.jpg');
  --ag-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 悬浮球 ---------- */
.agent-ball {
  position: fixed; right: 28px; bottom: 100px;
  width: 56px; height: 56px; border-radius: 50%;
  background-image: var(--ag-avatar);
  background-size: cover; background-position: 50% 20%; background-repeat: no-repeat;
  background-color: #FFFFFF;
  border: 2px solid #FFFFFF; padding: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: var(--ag-z-ball);
  box-shadow: 0 10px 26px rgba(90,60,30,0.24);
  cursor: pointer;
  touch-action: none;              /* 触屏拖动由脚本接管，避免页面跟着滚 */
  -webkit-touch-callout: none;
  user-select: none; -webkit-user-select: none;
  transition: transform var(--ag-dur-fast) var(--ag-ease), box-shadow var(--ag-dur-base) var(--ag-ease);
}
.agent-ball:hover { box-shadow: 0 12px 30px rgba(90,60,30,0.30); }
.agent-ball:active { transform: scale(0.96); }
.agent-ball:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.28), 0 10px 26px rgba(90,60,30,0.24); }
/* 拖动中：不跟手缩放，抬起阴影以便看清位置 */
.agent-ball.is-dragging {
  cursor: grabbing;
  transform: scale(1.06);
  box-shadow: 0 16px 34px rgba(90,60,30,0.32);
  transition: box-shadow var(--ag-dur-fast) linear;
}
/* 长按提示：桌面端悬停 0.6 秒后出现，避免划过时闪一下就消失 */
@media (hover: hover) and (pointer: fine) {
  .agent-ball::after {
    content: '长按拖动'; position: absolute; left: 50%; bottom: calc(100% + 8px);
    transform: translateX(-50%); white-space: nowrap;
    font-size: 11px; color: var(--ag-ink-2); background: #FFFFFF;
    border: 1px solid var(--ag-line); border-radius: 6px; padding: 3px 7px;
    box-shadow: 0 4px 12px rgba(90,60,30,0.10); pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: opacity var(--ag-dur-base) var(--ag-ease), visibility 0s linear var(--ag-dur-base);
  }
  .agent-ball:hover::after {
    opacity: 1; visibility: visible;
    transition-delay: 0.6s, 0.6s;
  }
  .agent-ball.is-dragging::after { opacity: 0; visibility: hidden; transition-delay: 0s, 0s; }
}
.agent-ball-dot {
  position: absolute; top: 1px; right: 1px; width: 14px; height: 14px;
  border-radius: 50%; background: #B4483F; border: 2px solid #FFFFFF;
}

/* ---------- 遮罩（仅手机） ---------- */
.agent-mask {
  position: fixed; inset: 0; background: rgba(60,45,32,0.32);
  z-index: calc(var(--ag-z-panel) - 1);
}

/* ---------- 面板 ---------- */
.agent-panel {
  position: fixed; top: 66px; right: 20px; bottom: 20px; width: 420px;
  display: flex; flex-direction: column;
  background: #FFFFFF; border: 1px solid var(--ag-line); border-radius: 20px;
  box-shadow: 0 16px 48px rgba(90,60,30,0.16);
  z-index: var(--ag-z-panel); overflow: hidden;
  animation: agent-panel-in var(--ag-dur-panel) var(--ag-ease);
}
@keyframes agent-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-panel, .agent-layer, .agent-typing span { animation: none; }
}

/* ---------- 头栏 ---------- */
.agent-head {
  height: 60px; flex: 0 0 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 14px; border-bottom: 1px solid var(--ag-line-2);
}
.agent-head-mark {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  background-image: var(--ag-avatar);
  background-size: cover; background-position: 50% 20%; background-repeat: no-repeat;
  border: 1px solid var(--ag-line);
}
.agent-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.agent-head-title { font-size: 15px; font-weight: 600; color: var(--ag-ink); line-height: 1.25; }
.agent-head-sub { font-size: 11.5px; color: var(--ag-ink-2); line-height: 1.35; margin-top: 1px; }
.agent-icon-btn {
  width: 32px; height: 32px; flex: 0 0 32px; border: 0; background: transparent;
  border-radius: 8px; color: var(--ag-ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background var(--ag-dur-fast) var(--ag-ease), color var(--ag-dur-fast) var(--ag-ease);
}
.agent-icon-btn svg { width: 18px; height: 18px; }
.agent-icon-btn:hover { background: var(--ag-accent-soft); color: var(--ag-ink); }
.agent-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.20); }

/* ---------- 身份条 ---------- */
.agent-idbar {
  height: 32px; flex: 0 0 32px; display: flex; align-items: center;
  padding: 0 14px; background: #FBF8F3; border-bottom: 1px solid var(--ag-line-2);
  font-size: 11.5px; color: var(--ag-ink-2);
}

/* ---------- 消息区 ---------- */
.agent-msgs {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 气泡 ---------- */
.agent-bubble { font-size: 14.5px; line-height: 1.62; word-break: break-word; flex-shrink: 0; }
.agent-bubble p { margin: 0 0 6px; }
.agent-bubble p:last-child { margin-bottom: 0; }
.agent-bubble ul { margin: 4px 0 8px; padding-left: 20px; }
.agent-bubble li { margin: 2px 0; }
.agent-bubble code {
  background: #FBF8F3; border: 1px solid var(--ag-line); border-radius: 4px;
  padding: 1px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
}
.agent-bubble.user {
  align-self: flex-end; max-width: 84%;
  background: var(--ag-accent); color: #FFFFFF;
  padding: 10px 14px; border-radius: 16px 16px 4px 16px;
}
.agent-bubble.bot {
  align-self: flex-start; max-width: calc(100% - 68px);
  margin-left: 36px; position: relative;
  background: #FFFFFF; border: 1px solid var(--ag-line);
  color: var(--ag-ink); padding: 10px 14px; border-radius: 4px 16px 16px 16px;
}
.agent-bubble.bot::before {
  content: ''; position: absolute; left: -36px; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background-image: var(--ag-avatar);
  background-size: cover; background-position: 50% 20%; background-repeat: no-repeat;
  border: 1px solid var(--ag-line);
}

/* ---------- 工具卡 ---------- */
.agent-tool {
  align-self: flex-start; flex-shrink: 0; width: calc(100% - 36px); margin-left: 36px;
  background: #FFFFFF; border: 1px solid var(--ag-line); border-radius: 14px;
  padding: 0 12px; min-height: 40px;
  display: flex; align-items: center; gap: 8px;
}
.agent-tool-name { font-size: 12.5px; color: var(--ag-ink-2); flex: 1; min-width: 0; }
.agent-tool-ms { font-size: 11px; color: var(--ag-ink-3); }

/* ---------- 状态胶囊 ---------- */
.agent-chip {
  height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 20px;
  display: inline-flex; align-items: center; white-space: nowrap; flex: 0 0 auto;
}
.agent-chip.ok { background: var(--ag-ok-bg); color: var(--ag-ok); }
.agent-chip.err { background: var(--ag-err-bg); color: var(--ag-err); }
.agent-chip.wait { background: var(--ag-wait-bg); color: var(--ag-wait); }
.agent-chip.neutral { background: #EDEFF2; color: #4A5E78; }

/* ---------- 确认卡 ---------- */
.agent-confirm {
  align-self: flex-start; flex-shrink: 0; width: calc(100% - 36px); margin-left: 36px;
  background: #FFFFFF; border: 1px solid var(--ag-line); border-radius: 14px;
  overflow: hidden;
}
.agent-confirm.is-expired { opacity: 0.62; }
.agent-confirm-head {
  min-height: 40px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border-bottom: 1px solid var(--ag-line-2);
}
.agent-confirm-title { font-size: 13.5px; font-weight: 600; color: var(--ag-ink); }
.agent-confirm-fields { padding: 6px 12px 8px; margin: 0; }
.agent-field { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; margin: 0; }
.agent-field dt { width: 76px; flex: 0 0 76px; font-size: 12px; color: var(--ag-ink-2); line-height: 1.55; margin: 0; }
.agent-field dd { flex: 1; min-width: 0; font-size: 13px; color: var(--ag-ink); line-height: 1.55; margin: 0; word-break: break-word; }
.agent-confirm-warn {
  background: var(--ag-err-soft); padding: 8px 12px;
  font-size: 12px; line-height: 1.65; color: var(--ag-err);
}
.agent-confirm-expire { padding: 5px 12px 0; font-size: 11.5px; color: var(--ag-ink-3); }
.agent-confirm-result { padding: 6px 12px 10px; font-size: 12.5px; color: var(--ag-ok); }
.agent-confirm-actions { display: flex; gap: 8px; padding: 10px 12px 12px; }
.agent-btn {
  height: 40px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  font-family: inherit; cursor: pointer; border: 1px solid transparent;
  transition: background var(--ag-dur-fast) var(--ag-ease);
}
.agent-btn.ghost { flex: 1; background: #FFFFFF; border-color: var(--ag-line-3); color: var(--ag-ink-2); }
.agent-btn.ghost:hover { background: #FBF8F3; }
.agent-btn.solid { flex: 1.4; background: var(--ag-accent); color: #FFFFFF; }
.agent-btn.solid:hover { background: var(--ag-accent-hover); }
.agent-btn:disabled { opacity: 0.6; cursor: default; }
.agent-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.24); }

/* ---------- 空态 ---------- */
.agent-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 20px 0; text-align: center;
}
.agent-empty-mark {
  width: 56px; height: 56px; border-radius: 50%;
  background-image: var(--ag-avatar);
  background-size: cover; background-position: 50% 20%; background-repeat: no-repeat;
  border: 1px solid var(--ag-line);
}
.agent-empty-title { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--ag-ink); }
.agent-empty-desc { margin-top: 5px; font-size: 12.5px; color: var(--ag-ink-2); line-height: 1.6; }
.agent-empty-list { width: 100%; margin-top: 12px; border-top: 1px solid var(--ag-line-2); }
.agent-empty-item {
  width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 4px; background: transparent; border: 0;
  border-bottom: 1px solid var(--ag-line-2); font-family: inherit;
  font-size: 13.5px; color: var(--ag-ink); text-align: left; cursor: pointer;
}
.agent-empty-item:hover { color: var(--ag-accent); }
.agent-empty-item svg { width: 14px; height: 14px; color: var(--ag-ink-3); flex: 0 0 14px; }
.agent-empty-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(143,101,64,0.24); border-radius: 8px; }

/* ---------- 打字指示 ---------- */
.agent-typing {
  align-self: flex-start; flex-shrink: 0; margin-left: 36px;
  display: flex; gap: 5px; align-items: center; padding: 8px 0;
}
.agent-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ag-ink-3);
  animation: agent-dot 900ms infinite ease-in-out;
}
.agent-typing span:nth-child(2) { animation-delay: 160ms; }
.agent-typing span:nth-child(3) { animation-delay: 320ms; }
@keyframes agent-dot {
  0%, 80%, 100% { opacity: 0.35; }
  40% { opacity: 1; }
}

/* ---------- 错误条 ---------- */
.agent-error {
  display: flex; align-items: center; gap: 8px;
  background: var(--ag-err-soft); border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; color: var(--ag-err);
}
.agent-error span { flex: 1; min-width: 0; }
.agent-error button {
  border: 0; background: transparent; color: var(--ag-err);
  font-family: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 4px;
}
.agent-error button:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(150,80,78,0.3); border-radius: 4px; }

/* ---------- 快捷区 ---------- */
.agent-quick {
  flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 16px;
  overflow-x: auto; scrollbar-width: none;
  /* 右缘渐隐，提示后面还有内容可滑 */
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent);
}
.agent-quick::-webkit-scrollbar { display: none; }
.agent-quick-item {
  flex: 0 0 auto; height: 28px; padding: 0 12px; border-radius: 999px;
  background: #FFFFFF; border: 1px solid var(--ag-line);
  font-family: inherit; font-size: 12.5px; color: var(--ag-ink-2);
  cursor: pointer; white-space: nowrap;
  transition: border-color var(--ag-dur-fast) var(--ag-ease), color var(--ag-dur-fast) var(--ag-ease);
}
.agent-quick-item:hover { border-color: var(--ag-line-3); color: var(--ag-ink); }
.agent-quick-item:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.20); }

/* ---------- 输入区 ---------- */
.agent-input {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--ag-line); background: #FBF8F3;
  position: relative;
}
.agent-input textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: none;
  border: 1px solid var(--ag-line-3); border-radius: 12px;
  padding: 11px 12px; font-family: inherit; font-size: 14.5px; line-height: 1.5;
  color: var(--ag-ink); background: #FFFFFF; outline: none;
  transition: border-color var(--ag-dur-fast) var(--ag-ease), box-shadow var(--ag-dur-fast) var(--ag-ease);
  /* box-sizing 已由全局 border-box 保证：44px 含边框，与两侧 44px 按钮等高 */
}
.agent-input textarea:focus {
  border-color: var(--ag-accent); box-shadow: 0 0 0 3px rgba(143,101,64,0.12);
}
.agent-input textarea::placeholder { color: var(--ag-ink-3); }
.agent-input textarea:disabled { background: #FBF8F3; color: var(--ag-ink-3); }
.agent-send {
  height: 44px; min-width: 60px; padding: 0 14px; border-radius: 10px;
  border: 0; background: var(--ag-accent); color: #FFFFFF;
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background var(--ag-dur-fast) var(--ag-ease);
}
.agent-send:hover { background: var(--ag-accent-hover); }
.agent-send:disabled { opacity: 0.45; cursor: default; }
.agent-send.stop { background: #FFFFFF; border: 1.5px solid var(--ag-err); color: var(--ag-err); }
.agent-send:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.24); }
.agent-count {
  position: absolute; right: 88px; bottom: 12px;
  font-size: 11px; color: var(--ag-err);
}
.agent-hint {
  flex: 0 0 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ag-ink-3); background: #FBF8F3;
  padding-bottom: 2px;
}

/* 本轮 token 用量：只做展示，不参与任何额度判断 */
.agent-usage {
  margin-left: 4px;
  color: #C0B3A4;
}

/* ---------- 覆盖层（历史 / 技能） ---------- */
.agent-layer {
  position: absolute; left: 0; right: 0; top: 60px; bottom: 0;
  background: #FFFFFF; z-index: var(--ag-z-layer);
  display: flex; flex-direction: column;
  animation: agent-layer-in var(--ag-dur-base) var(--ag-ease);
}
@keyframes agent-layer-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.agent-layer-head {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 16px; border-bottom: 1px solid var(--ag-line-2);
  font-size: 13.5px; font-weight: 600; color: var(--ag-ink);
}
.agent-layer-body { flex: 1; overflow-y: auto; padding: 4px 0; }
.agent-layer-empty {
  padding: 40px 16px; text-align: center; font-size: 12.5px; color: var(--ag-ink-3);
}
.agent-history-item {
  flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; justify-content: center;
  gap: 3px; padding: 8px 16px; background: transparent; border: 0;
  border-bottom: 1px solid var(--ag-line-2); font-family: inherit;
  text-align: left; cursor: pointer; position: relative;
}
.agent-history-item:hover { background: #FBF8F3; }
.agent-history-item.active::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--ag-accent);
}

/* 每行 = 会话按钮 + 删除按钮；删除钮默认低可见度，悬停或键盘聚焦时浮出 */
.agent-history-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--ag-line-2);
}
.agent-history-row .agent-history-item { border-bottom: 0; }
.agent-history-del {
  flex: 0 0 44px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: #B0A091; opacity: 0.55;
  transition: opacity var(--ag-dur-fast) var(--ag-ease), color var(--ag-dur-fast) var(--ag-ease);
}
.agent-history-del svg { width: 16px; height: 16px; }
.agent-history-row:hover .agent-history-del,
.agent-history-del:focus-visible { opacity: 1; }
.agent-history-del:hover { color: #96504E; background: #FBF5F4; }
.agent-history-del:disabled { opacity: 0.3; cursor: default; }

@media (hover: none) {
  /* 触屏没有悬停，删除钮常驻可见，否则用户找不到 */
  .agent-history-del { opacity: 1; }
}
.agent-history-title {
  font-size: 13.5px; color: var(--ag-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-history-time { font-size: 11.5px; color: var(--ag-ink-3); }
.agent-skill-item {
  width: 100%; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 16px; background: transparent; border: 0;
  border-bottom: 1px solid var(--ag-line-2); font-family: inherit;
  text-align: left; cursor: pointer;
}
.agent-skill-item:hover { background: #FBF8F3; }
.agent-skill-item.active { background: var(--ag-accent-soft); }
.agent-skill-name { font-size: 13.5px; font-weight: 600; color: var(--ag-ink); }
.agent-skill-desc { font-size: 12px; color: var(--ag-ink-2); line-height: 1.5; }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .agent-panel { top: 62px; right: 16px; bottom: 16px; width: 400px; border-radius: 18px; }
  .agent-head { height: 56px; flex-basis: 56px; }
  .agent-ball { right: 22px; bottom: 96px; width: 54px; height: 54px; }
}

@media (max-width: 767px) {
  .agent-panel {
    top: 0; right: 0; bottom: 0; left: 0; width: auto;
    border-radius: 0; border: 0;
  }
  .agent-head { height: 56px; flex-basis: 56px; padding: 0 8px 0 12px; }
  .agent-head-sub { display: none; }
  .agent-icon-btn { width: 40px; height: 40px; flex-basis: 40px; }
  .agent-idbar { height: 30px; flex-basis: 30px; font-size: 11px; }
  .agent-msgs { padding: 12px 12px 6px; gap: 12px; }
  .agent-bubble.user { max-width: 88%; }
  .agent-bubble.bot, .agent-tool, .agent-confirm { width: calc(100% - 32px); margin-left: 32px; }
  .agent-bubble.bot::before { left: -32px; width: 22px; height: 22px; }
  .agent-input { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .agent-input textarea { font-size: 16px; }
  .agent-quick { padding: 8px 12px; }
  .agent-ball { right: 18px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
  .agent-layer { top: 56px; }
}

/* ---------- 选图 ---------- */
.agent-attach {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 0; overflow-x: auto; scrollbar-width: none;
}
.agent-attach::-webkit-scrollbar { display: none; }
.agent-attach-item { position: relative; flex: 0 0 auto; }
.agent-attach-item img {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--ag-line-3); display: block;
}
.agent-attach-del {
  position: absolute; top: -5px; right: -5px;
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  background: #4A3A2E; color: #FFFFFF; border: 1.5px solid #FFFFFF;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.agent-attach-del svg { width: 9px; height: 9px; }
.agent-attach-hint { flex: 0 0 auto; font-size: 11px; color: var(--ag-ink-3); }

.agent-attach-btn {
  flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--ag-line-3); border-radius: 10px;
  background: #FFFFFF; color: var(--ag-ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--ag-dur-fast) var(--ag-ease), color var(--ag-dur-fast) var(--ag-ease);
}
.agent-attach-btn svg { width: 18px; height: 18px; }
.agent-attach-btn:hover { border-color: var(--ag-accent); color: var(--ag-accent); }
.agent-attach-btn:disabled { opacity: 0.45; cursor: default; }
.agent-attach-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.20); }

.agent-photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 14px;
}
.agent-photo-cell {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px;
  background: #FBF8F3; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--ag-dur-fast) var(--ag-ease);
}
.agent-photo-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.agent-photo-cell.selected { border-color: var(--ag-accent); }
.agent-photo-cell:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143,101,64,0.24); }
.agent-photo-name {
  display: block; padding: 4px 6px; font-size: 10.5px; color: var(--ag-ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.agent-photo-check {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ag-accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.24);
}
.agent-photo-check svg { width: 12px; height: 12px; }

.agent-layer-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ag-line-2); font-size: 12px; color: var(--ag-ink-2);
}
.agent-photo-done { flex: 0 0 auto; min-width: 88px; padding: 0 18px; }

.agent-bubble-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.agent-bubble-photos img {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.4); display: block;
}
.agent-bubble.user span { display: block; }

@media (max-width: 767px) {
  .agent-photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; }
  .agent-bubble-photos img { width: 84px; height: 84px; }
  .agent-attach { padding: 6px 10px 0; }
}

/* ==========================================================
   日历页 — 经期记录视图（cy- 前缀，不与既有选择器冲突）
   配色沿用 App 端方案：月经期粉 / 卵泡期绿 / 排卵期紫 / 黄体期黄
   ========================================================== */

/* 分段切换 */
.seg-switch {
  display: inline-flex; position: relative; margin-bottom: 16px;
  background: rgba(199,168,131,0.15); border-radius: 12px; padding: 4px;
  gap: 2px;
}
.seg-item {
  padding: 8px 22px; border-radius: 9px; font-size: 0.95rem;
  color: var(--text-light); cursor: pointer; user-select: none;
  transition: all .2s; font-weight: 500;
}
.seg-item.active {
  background: var(--surface); color: var(--mocha); font-weight: 600;
  box-shadow: 0 2px 8px rgba(90,60,30,0.10);
}

/* 图例 */
.cyc-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-bottom: 14px; padding: 0 4px;
}
.cyc-lg-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-light);
}
.cyc-lg-block {
  width: 14px; height: 14px; border-radius: 4px; display: inline-block;
}
.cyc-lg-menstrual { background: #f9e4e0; }
.cyc-lg-follicular { background: #edf3ed; }
.cyc-lg-ovulation { background: #f2ecf5; }
.cyc-lg-luteal { background: #f8f0e0; }
.cyc-lg-pred { background: #fdf3f1; border: 1.5px dashed #d8a49c; }

/* 日历格着色（仅经期视图生效；优先级低于 today/selected 的 day-num 样式） */
.calendar-grid .day-cell.cyc-menstrual { background: #f9e4e0; }
.calendar-grid .day-cell.cyc-menstrual .day-num { color: #b56060; }
.calendar-grid .day-cell.cyc-follicular { background: #edf3ed; }
.calendar-grid .day-cell.cyc-follicular .day-num { color: #6d8a70; }
.calendar-grid .day-cell.cyc-ovulation { background: #f2ecf5; }
.calendar-grid .day-cell.cyc-ovulation .day-num { color: #8a6191; }
.calendar-grid .day-cell.cyc-luteal { background: #f8f0e0; }
.calendar-grid .day-cell.cyc-luteal .day-num { color: #a08550; }
.calendar-grid .day-cell.cyc-pred { background: transparent; }
.calendar-grid .day-cell.cyc-pred-period { background: #fdf3f1; border: 1.5px dashed #d8a49c; }
.calendar-grid .day-cell.cyc-pred-period .day-num { color: #b56060; }

/* 排卵日小标 */
.cyc-ovu-tag {
  font-size: 0.62rem; color: #8a6191; line-height: 1;
  margin-top: -2px;
}

/* 侧栏经期面板 */
.cyc-panel { padding: 4px 2px; }
.cyc-empty { text-align: center; padding: 30px 10px; }
.cyc-empty-title { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.cyc-empty-sub { font-size: 0.85rem; color: var(--text-light); }

.cyc-phase-card {
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.cyc-phase-menstrual { background: #fdf0ee; border-color: #f0d5d0; }
.cyc-phase-follicular { background: #f2f7f2; border-color: #d8e6d8; }
.cyc-phase-ovulation { background: #f5f0f8; border-color: #e0d5e8; }
.cyc-phase-luteal { background: #faf4e8; border-color: #eadfc5; }
.cyc-phase-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cyc-phase-name { font-size: 1.05rem; font-weight: 700; color: var(--espresso); }
.cyc-phase-badge {
  font-size: 0.75rem; padding: 3px 10px; border-radius: 20px;
  background: #ffffff; color: var(--mocha); border: 1px solid var(--border);
}
.cyc-phase-sub { margin-top: 8px; font-size: 0.85rem; color: var(--text-light); }

.cyc-stats {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.cyc-stat {
  flex: 1; text-align: center; padding: 12px 8px;
  background: var(--surface-soft); border-radius: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.cyc-stat-num { font-size: 1.3rem; font-weight: 700; color: var(--caramel-hover); }
.cyc-stat-label { font-size: 0.75rem; color: var(--text-light); }

.cyc-list-title {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.cyc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-bottom: 1px solid var(--border);
}
.cyc-item:last-child { border-bottom: none; }
.cyc-item-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: #e8b4aa;
}
.cyc-item-dot.ongoing { background: #d47f6e; box-shadow: 0 0 0 3px rgba(212,127,110,0.2); }
.cyc-item-main { flex: 1; cursor: pointer; min-width: 0; }
.cyc-item-date { font-size: 0.88rem; color: var(--text); }
.cyc-item-note {
  font-size: 0.78rem; color: var(--text-light); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cyc-item-del {
  border: none; background: transparent; color: var(--text-light);
  font-size: 1.1rem; cursor: pointer; padding: 4px 6px; border-radius: 6px;
  transition: all .15s; flex-shrink: 0;
}
.cyc-item-del:hover { color: #c06060; background: rgba(192,96,96,0.08); }

.cyc-dur-hint {
  font-size: 0.8rem; color: var(--text-light);
  margin-top: 6px; line-height: 1.6;
}

/* 手机端 */
@media (max-width: 768px) {
  .seg-item { padding: 7px 16px; font-size: 0.88rem; }
  .cyc-legend { gap: 10px; }
  .cyc-stats { gap: 8px; }
}

/* ---------- 首次引导卡（只在第一次出现，之后由 localStorage 记住） ---------- */
.agent-guide {
  position: fixed; right: 20px; bottom: 168px;
  width: 240px; min-height: 88px;
  padding: 12px 14px;
  background: #FFFFFF; border: 1px solid var(--ag-line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(90,60,30,0.16);
  z-index: var(--ag-z-ball);
  cursor: pointer;
}
.agent-guide::after {
  content: ''; position: absolute; right: 26px; bottom: -6px;
  width: 10px; height: 10px; background: #FFFFFF;
  border-right: 1px solid var(--ag-line); border-bottom: 1px solid var(--ag-line);
  transform: rotate(45deg);
}
.agent-guide-title { font-size: 13px; font-weight: 600; color: #4A3A2E; }
.agent-guide-desc { font-size: 11.5px; color: #7A6857; line-height: 1.5; margin-top: 4px; }
.agent-guide-ok {
  position: absolute; right: 10px; top: 10px;
  border: none; background: none; padding: 2px 6px;
  font-size: 11px; color: #8F6540; cursor: pointer; font-family: inherit;
}

/* ---------- S9 登录过期态 ---------- */
.agent-auth-expired {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 32px 24px; text-align: center;
}
.agent-auth-title { font-size: 15px; font-weight: 600; color: #4A3A2E; }
.agent-auth-desc { font-size: 12.5px; color: #7A6857; line-height: 1.6; }
.agent-auth-btn {
  margin-top: 4px; padding: 8px 20px;
  border: none; border-radius: 999px;
  background: #8F6540; color: #FFFFFF;
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.agent-auth-btn:hover { background: #7C5536; }
