/* ============================================
   校园失物招领 - 网页版样式
   复刻微信小程序视觉风格
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4A90E2;
  --primary-dark: #357ABD;
  --danger: #FF6B6B;
  --success: #51CF66;
  --warning: #E6A700;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #eee;
  --shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-height: 60px;
  --fab-size: 52px;
  --marquee-h: 32px;
  --userbar-h: 48px;
  --searchbar-h: 56px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ============================================
   页面容器
   ============================================ */
.page {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: visible;
  position: relative;
  padding-bottom: 90px;
}

.page.active {
  display: flex;
}

/* ============================================
   用户信息栏
   ============================================ */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--userbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-info .avatar {
  font-size: 18px;
}

.user-info .class {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.logout-btn {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 10px;
  border: 1px solid var(--danger);
  border-radius: 20px;
  cursor: pointer;
  background: none;
  user-select: none;
}

.logout-btn:active {
  opacity: 0.7;
}

/* ============================================
   搜索栏
   ============================================ */
.search-bar {
  padding: 10px 14px;
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 22px;
  padding: 8px 14px;
  box-shadow: 0 2px 12px rgba(74,144,226,0.2);
}

.search-wrap .icon {
  display: flex;
  align-items: center;
  opacity: 0.4;
  margin-right: 8px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.search-wrap .icon svg { width: 16px; height: 16px; }

.search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  line-height: 1;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: none;
}

.search-clear.visible {
  display: block;
}

/* ============================================
   统计栏
   ============================================ */
.stats-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--card-bg);
  margin: 12px 14px;
  padding: 14px 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

/* 公告栏 */
.announcement-bar {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #FFF3CD, #FFF8E1);
  border-left: 4px solid #FFB300;
  margin: 10px 14px 0;
  padding: 10px 14px;
  border-radius: 8px;
  gap: 8px;
  flex-shrink: 0;
}
.ann-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #ff4757;
}
.ann-icon svg { width: 16px; height: 16px; }

.btn-icon { width: 16px; height: 16px; margin-right: 6px; flex-shrink: 0; }

.user-tip-icon { display: flex; align-items: center; color: var(--text-muted); }
.user-tip-icon svg { width: 16px; height: 16px; }

.cat-svg { width: 16px; height: 16px; flex-shrink: 0; }

.section-title-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--primary); }

.school-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  border-radius: 8px;
}

.avatar { display: flex; align-items: center; color: var(--text-muted); }
.avatar svg { width: 20px; height: 20px; }

.profile-avatar { display: flex; align-items: center; justify-content: center; color: var(--primary); }
.profile-avatar svg { width: 56px; height: 56px; }
.ann-text {
  flex: 1;
  font-size: 13px;
  color: #7A5C00;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ann-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ann-edit-btn, .ann-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.7;
}
.ann-edit-btn:hover, .ann-close-btn:hover { opacity: 1; }

/* 分类筛选 */
.category-bar {
  margin: 10px 14px 0;
  flex-shrink: 0;
}
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}
.cat-chip.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.cat-chip:active { transform: scale(0.95); }

/* 物品分类选择 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cat-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}
.cat-option.active-cat {
  background: #E8F0FE;
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.cat-option:active { transform: scale(0.96); }

/* 列表卡片分类标签 */
.item-cat-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(74,144,226,0.1);
  color: var(--primary-color);
  border: 1px solid rgba(74,144,226,0.3);
  flex-shrink: 0;
}

/* 分享按钮 */
.modal-btn-share {
  background: linear-gradient(135deg, #00C853, #00E676);
  color: #fff;
  border: none;
}
.modal-btn-share:active { opacity: 0.85; }

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stats-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stats-label {
  font-size: 12px;
  color: var(--text-light);
}

.stats-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* ============================================
   物品列表
   ============================================ */
.item-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  padding-bottom: calc(var(--tab-height) + var(--fab-size) + var(--marquee-h) + 20px);
  -webkit-overflow-scrolling: touch;
}

/* 物品卡片 */
.item-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}

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

.item-card.lost {
  border-left: 3px solid var(--danger);
}

.item-card.found {
  border-left: 3px solid var(--success);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.item-type {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.item-type.lost {
  background: #FFE8E8;
  color: var(--danger);
}

.item-type.found {
  background: #E8FFE8;
  color: var(--success);
}

.item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.item-content {
  display: flex;
  gap: 12px;
}

.item-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-muted);
  opacity: 0.35;
}
.item-thumb svg { width: 32px; height: 32px; }

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

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 4px 0;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.meta-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 4px;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-icon svg { width: 64px; height: 64px; }

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   底部 Tab 栏
   ============================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
  user-select: none;
}

.tab-item .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tab-item .tab-icon svg { width: 22px; height: 22px; }

.tab-item.active {
  color: var(--primary);
}

/* ============================================
   悬浮发布按钮
   ============================================ */
.fab {
  position: absolute;
  bottom: 65px;
  right: 16px;
  width: var(--fab-size);
  height: var(--fab-size);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: #fff;
  box-shadow: 0 6px 20px rgba(74,144,226,0.4);
  cursor: pointer;
  z-index: 101;
  transition: transform 0.15s, opacity 0.15s;
}

.fab:active {
  transform: scale(0.93);
  opacity: 0.9;
}

/* ============================================
   底部滚动字幕
   ============================================ */
.marquee-bar {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--marquee-h);
  background: #FFF8E6;
  border-top: 1px solid #F0E0B0;
  overflow: hidden;
  z-index: 99;
  display: flex;
  align-items: center;
}

.marquee-text {
  font-size: 12px;
  color: var(--warning);
  white-space: nowrap;
  animation: marquee 14s linear infinite;
  padding-left: 100%;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ============================================
   发布页
   ============================================ */
.publish-page {
  background: var(--bg);
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.publish-page.active {
  display: flex;
}

/* 发布页头部 */
.publish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 46px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.publish-header .back-btn {
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
}

.publish-header .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.publish-header .placeholder {
  width: 40px;
}

/* 发布页用户提示条 */
.publish-user-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #E8F4FD;
  font-size: 12px;
  color: var(--primary);
  flex-shrink: 0;
}

/* 发布表单 */
.publish-form {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

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

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.required {
  color: var(--danger);
  font-size: 12px;
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary);
}

.form-textarea {
  resize: none;
  min-height: 100px;
  line-height: 1.6;
}

.char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 类型选择器 */
.type-selector {
  display: flex;
  gap: 10px;
}

.type-option {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card-bg);
  user-select: none;
}

.type-option:active {
  transform: scale(0.97);
}

.type-option.active-lost {
  border-color: var(--danger);
  background: #FFF5F5;
}

.type-option.active-found {
  border-color: var(--success);
  background: #F5FFF5;
}

.type-option .type-icon {
  display: block;
  margin-bottom: 4px;
}
.type-option .type-icon svg { width: 20px; height: 20px; }

.type-option .type-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* 图片上传 */
.image-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
}

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

.img-del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  cursor: pointer;
}

.add-btn {
  width: 90px;
  height: 90px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  background: var(--card-bg);
  transition: border-color 0.2s;
}

.add-btn:active {
  border-color: var(--primary);
}

.add-btn .add-icon {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 300;
}

.add-btn .add-text {
  font-size: 11px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* 个人信息展示 */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-display {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-light);
}

.info-value {
  color: var(--text);
  font-weight: 500;
}

.info-tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: #FAFAFA;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.5;
}

/* 发布按钮 */
.publish-submit-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 101;
}

.submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: inherit;
}

.submit-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-tip {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================
   登录页
   ============================================ */
.login-page {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.login-page.active {
  display: flex;
}

.login-header {
  text-align: center;
  padding-top: 20px;
  margin-bottom: 24px;
}

.login-logo {
  font-size: 64px;
  display: block;
  margin-bottom: 12px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-item {
  margin-bottom: 14px;
}

.form-item .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-item .form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-item .form-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.form-item .form-input.error {
  border-color: var(--danger);
}

.error-tip {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #F5F7FA;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: inherit;
}

.login-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
}

.login-link:active {
  opacity: 0.7;
}

.switch-user {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}

/* ============================================
   我的页面
   ============================================ */
.mine-page {
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.mine-page.active {
  display: flex;
}

.profile-card {
  display: flex;
  align-items: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  gap: 14px;
  flex-shrink: 0;
}

.profile-avatar {
  font-size: 36px;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.profile-class {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

.profile-count {
  text-align: center;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 8px 14px;
}

.count-num {
  font-size: 20px;
  font-weight: 700;
  display: block;
}

.count-label {
  font-size: 10px;
  color: rgba(255,255,255,0.8);
}

.swipe-tip {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--warning);
  background: #FFF8E6;
  border-bottom: 1px solid #F0E0B0;
  flex-shrink: 0;
}

.mine-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  padding-bottom: calc(var(--tab-height) + 20px);
  -webkit-overflow-scrolling: touch;
}

/* 滑动卡片 */
.swipe-wrapper {
  position: relative;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: visible;
}

.swipe-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
}

.swipe-actions-left {
  right: 0;
  flex-direction: row-reverse;
}

.swipe-actions-right {
  left: 0;
}

.action-btn {
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border-radius: 12px;
  transition: opacity 0.15s;
}

.action-btn:active {
  opacity: 0.8;
}

.action-resolve {
  background: var(--success);
}

.action-delete {
  background: var(--danger);
}

.swipe-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.swipe-content.lost {
  border-left: 3px solid var(--danger);
}

.swipe-content.found {
  border-left: 3px solid var(--success);
}

.swipe-content:active {
  opacity: 0.8;
}

/* ============================================
   详情弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active, .modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.modal-content {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
  word-break: break-all;
}

.modal-content .modal-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.modal-content .modal-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal-content .modal-value {
  color: var(--text);
}

.modal-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--bg);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  font-family: inherit;
}

.modal-btn:active {
  opacity: 0.8;
}

.modal-btn-primary {
  background: var(--primary);
  color: #fff;
}

.modal-btn-default {
  background: var(--bg);
  color: var(--text);
}

.modal-btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  pointer-events: none;
  white-space: nowrap;
  display: none;
}

.toast.success {
  background: rgba(81,207,102,0.9);
}

.toast.error {
  background: rgba(255,107,107,0.9);
}

.toast.active {
  display: block;
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   确认对话框
   ============================================ */
.confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-dialog.active {
  display: flex;
}

.confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.confirm-msg {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-cancel,
.confirm-ok {
  flex: 1;
  padding: 10px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.15s;
}

.confirm-cancel:active,
.confirm-ok:active {
  opacity: 0.8;
}

.confirm-cancel {
  background: var(--bg);
  color: var(--text);
}

.confirm-ok {
  background: var(--primary);
  color: #fff;
}

.confirm-ok.danger {
  background: var(--danger);
}

.confirm-ok.success {
  background: var(--success);
}

/* ============================================
   过渡动画
   ============================================ */
.page-enter {
  animation: page-in 0.25s ease;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   滚动条
   ============================================ */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
