/* =========================================
 * 用户端 CSS - 手机优先
 * ========================================= */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 70px;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
}

/* ===== Top bar ===== */
.top-bar {
  background: var(--gradient-primary);
  color: #fff;
  padding: 18px 16px 14px;
  border-radius: 0 0 24px 24px;
}
.top-bar .top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-bar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}
.top-bar .brand .logo {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.top-bar .user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 13px;
}
.top-bar .user-pill .avatar { background: rgba(255, 255, 255, 0.3); }

/* ===== Top scroll text ===== */
.top-scroll {
  background: var(--gradient-warm);
  padding: 6px 12px;
  font-size: 12px;
  color: #5a3a1c;
  overflow: hidden;
  position: relative;
  font-weight: 500;
}
.top-scroll-inner {
  white-space: nowrap;
  display: inline-block;
  animation: marquee 22s linear infinite;
  padding-left: 100%;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ===== Carousel ===== */
.carousel {
  margin: 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 160px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.carousel .slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  background-size: cover;
  background-position: center;
  background-color: #ffd6e5;
  opacity: 0;
  transition: opacity 0.5s;
  color: #fff;
}
.carousel .slide.active { opacity: 1; }
.carousel .slide-title {
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}
.carousel .dots {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.carousel .dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
}
.carousel .dot.active {
  width: 18px;
  border-radius: 999px;
  background: #fff;
}

/* ===== Main actions (盲盒) ===== */
.tabs-bar {
  display: flex;
  margin: 14px;
  background: #fff;
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.tabs-bar button {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}
.tabs-bar button.active {
  background: var(--gradient-primary);
  color: #fff;
}

/* ===== 盲盒主页 ===== */
.treasure-area {
  margin: 0 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.treasure-area .balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fff5d4, #ffe082);
  padding: 8px 14px;
  border-radius: 999px;
  color: #8a6300;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}
.treasure-area .balance strong {
  color: #c2410c;
  font-size: 15px;
}

.box-stage {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 18px;
}
.box-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.4) 0%, transparent 70%);
  animation: glow 2s ease-in-out infinite alternate;
  filter: blur(20px);
}
@keyframes glow {
  from { opacity: 0.5; }
  to { opacity: 1; }
}
.box-image {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  z-index: 2;
  transition: transform 0.5s;
  cursor: pointer;
  animation: float 3s ease-in-out infinite;
}
.box-image.shake {
  animation: shake 0.4s ease-in-out, float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-10px) rotate(-5deg); }
  75% { transform: translateX(10px) rotate(5deg); }
}

.draw-btn {
  background: var(--gradient-primary);
  color: #fff;
  padding: 14px 38px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.4);
  transition: transform 0.15s;
}
.draw-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.draw-btn:active { transform: scale(0.96); }
.draw-cost {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

/* ===== Place note (投放) ===== */
.place-area {
  margin: 0 14px 14px;
}
.note-input-box {
  background: linear-gradient(135deg, #fff8e1, #fff);
  border: 1px solid #ffe082;
  border-radius: var(--radius-lg);
  padding: 16px;
}
.note-input-box textarea {
  width: 100%;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  min-height: 100px;
  color: var(--text);
}

/* ===== Filter (筛选) ===== */
.filter-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 14px 14px;
}

/* ===== Drawn card (抽到的纸条) ===== */
.drawn-card {
  margin: 0 14px 14px;
  background: linear-gradient(135deg, #fff8e1, #fffbe6);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid #ffe082;
  position: relative;
}
.drawn-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.drawn-card .content {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-all;
}
.drawn-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #ffd97a;
  padding-top: 12px;
  font-size: 12px;
  color: var(--text-soft);
}

/* ===== 我的 (Profile) ===== */
.profile-header {
  background: var(--gradient-primary);
  padding: 24px 16px 30px;
  border-radius: 0 0 32px 32px;
  color: #fff;
  text-align: center;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 3px solid rgba(255, 255, 255, 0.5);
}
.profile-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.profile-sign {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 14px;
  padding: 0 24px;
}
.profile-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 14px;
}
.profile-balance strong { font-size: 18px; }

.section {
  background: #fff;
  margin: 12px 14px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 12px 16px 8px;
  background: #fff;
}
.section-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.section-item .icon { font-size: 18px; margin-right: 12px; }
.section-item .arrow { margin-left: auto; color: var(--text-muted); font-size: 14px; }

/* ===== Records list ===== */
.record-list {
  background: #fff;
  border-radius: var(--radius);
  margin: 0 14px 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.record-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.record-item:last-child { border-bottom: 0; }
.record-item .info { flex: 1; min-width: 0; }
.record-item .info .text {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-item .info .time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px;
}
.bottom-nav .nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
}
.bottom-nav .nav-item.active {
  color: var(--primary);
}
.bottom-nav .nav-item.active .nav-icon {
  filter: drop-shadow(0 2px 6px rgba(255, 107, 157, 0.4));
}

/* ===== Popup announcement ===== */
.popup-announce {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.popup-announce .box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  animation: zoomin 0.3s;
}
.popup-announce .box .head {
  background: var(--gradient-primary);
  color: #fff;
  text-align: center;
  padding: 18px 14px 14px;
  font-weight: 600;
  font-size: 17px;
}
.popup-announce .box .body {
  padding: 20px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  max-height: 60vh;
  overflow: auto;
}
.popup-announce .box .body img {
  width: 100%;
  border-radius: 8px;
  margin-top: 10px;
}
.popup-announce .close {
  width: 100%;
  padding: 14px;
  border: 0;
  background: #f8f8fa;
  color: var(--text-soft);
  font-size: 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

/* ===== 服务客服 ===== */
.service-area {
  margin: 14px;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-lg);
  text-align: center;
}
.service-area .emoji { font-size: 56px; margin-bottom: 14px; }
.service-area h3 { margin: 0 0 8px; }
.service-area p { color: var(--text-soft); margin-bottom: 18px; }

/* ===== Loading ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
