/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  overflow: hidden;
}

/* 加载页面 */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: #666;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: #8b7355;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

/* 主应用 */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 2px;
}

.user-info {
  font-size: 12px;
}

.guest-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 12px;
}

.user-badge {
  background: rgba(255,215,0,0.3);
  padding: 4px 10px;
  border-radius: 12px;
  color: #ffd700;
}

/* 主内容区 */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* 顶部选项卡 */
.tab-switcher {
  display: flex;
  background: white;
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-option {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: 16px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  background: transparent;
  white-space: nowrap;
}

.tab-option.active {
  background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
  color: white;
}

/* 图片展示区域 */
.display-area {
  background: white;
  border-radius: 16px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  padding: 10px;
}

/* 主图片 */
.main-image {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

/* 走马灯文字容器 */
.marquee-container {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

/* 隶书风格走马灯文字 */
.marquee-text {
  font-family: "LiSu", "隶书", "SimLi", "STLiSu", serif;
  font-size: 28px;
  color: rgba(139, 115, 85, 0.9);
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  white-space: nowrap;
  animation: marquee 8s linear infinite;
  display: inline-block;
  padding-left: 100%;
}

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

/* 静态纪念文字（提交后显示） */
.memorial-text {
  font-family: "LiSu", "隶书", "SimLi", "STLiSu", serif;
  font-size: 24px;
  color: #8b7355;
  text-align: center;
  margin-top: 10px;
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

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

/* 纸灰累积显示 */
.ash-counter {
  position: absolute;
  bottom: 10px;
  right: 15px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
}

/* 点击图片提示 */
.click-hint {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(139, 115, 85, 0.9);
  color: white;
  padding: 6px 16px;
  border-radius: 15px;
  font-size: 13px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 表单区 */
.form-area {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

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

.form-label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.3s;
  text-align: center;
  font-family: "LiSu", "隶书", "SimLi", "STLiSu", serif;
}

.form-input:focus {
  outline: none;
  border-color: #8b7355;
}

.form-input::placeholder {
  color: #bbb;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
  margin-top: 10px;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.nav-item.active {
  color: #8b7355;
}

.nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.nav-text {
  font-size: 11px;
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* 个人中心样式 */
.profile-header {
  text-align: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
  background: white;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 10px;
}

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

.profile-phone {
  font-size: 13px;
  color: #999;
}

.profile-status {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.profile-status.guest {
  background: #fff3e0;
  color: #e65100;
}

.profile-status.formal {
  background: #e8f5e9;
  color: #2e7d32;
}

/* 菜单列表 */
.menu-list {
  list-style: none;
  background: white;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  background: white;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.menu-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.menu-arrow {
  color: #ccc;
}

/* 记录列表 */
.record-list, .log-list {
  max-height: 400px;
  overflow-y: auto;
}

.record-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.record-icon {
  font-size: 28px;
  margin-right: 12px;
}

.record-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.record-content {
  flex: 1;
}

.record-title {
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
}

.record-desc {
  font-size: 12px;
  color: #999;
}

.record-time {
  font-size: 12px;
  color: #bbb;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* 返回按钮 */
.back-btn {
  background: none;
  border: none;
  color: #8b7355;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 10px;
}

.back-btn:hover {
  text-decoration: underline;
}

/* 升级表单 */
.upgrade-form {
  padding: 10px 0;
}

.captcha-group {
  display: flex;
  gap: 10px;
}

.captcha-input {
  flex: 1;
}

.captcha-text {
  min-width: 120px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid #e0e0e0;
  background: #f5f5f5;
  font-family: 'Courier New', monospace;
  user-select: none;
  padding: 0 15px;
  font-size: 18px;
  letter-spacing: 8px;
  color: #8b7355;
}

.captcha-text:hover {
  background: #e8e8e8;
}

.hint-text {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* 响应式 */
@media (max-width: 375px) {
  .main-image {
    width: 150px;
    height: 150px;
  }
  
  .marquee-text {
    font-size: 24px;
  }
}
