/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a90d9;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --pick-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #f0f0f0;
  --shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-container {
  flex: 1;
  padding-bottom: 60px;
}

.hidden {
  display: none !important;
}

/* ==================== 底部导航栏 ==================== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--card-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-item.active .tab-icon {
  transform: scale(1.1);
}

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

.tab-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

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

/* ==================== 登录页 ==================== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #4a90d9 0%, #6bb6ff 50%, #a8d8ff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
}

.logo-icon {
  font-size: 80px;
  margin-bottom: 15px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.logo-title {
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.logo-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.login-section {
  width: 100%;
  padding: 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-btn {
  width: 100%;
  max-width: 300px;
  height: 48px;
  background: #fff;
  color: var(--primary-color);
  font-size: 17px;
  font-weight: bold;
  border-radius: 24px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s;
}

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

.login-btn:disabled {
  opacity: 0.7;
}

.login-tip {
  margin-top: 15px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== 首页 ==================== */
.home-page {
  padding: 15px;
}

.user-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(74, 144, 217, 0.1);
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e0e0;
  margin-right: 12px;
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.nickname {
  font-size: 17px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.role-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
}

.role-tag.user {
  background: #e8f4fd;
  color: var(--primary-color);
}

.role-tag.admin {
  background: #fff3e0;
  color: #ff9800;
}

.action-section {
  margin-top: 10px;
}

.action-card {
  display: flex;
  align-items: center;
  border-radius: 12px;
  padding: 20px 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.throw-card {
  background: var(--primary-gradient);
}

.pick-card {
  background: var(--pick-gradient);
}

.action-card .action-icon,
.action-card .action-title,
.action-card .action-desc,
.action-card .action-arrow {
  color: #fff;
}

.action-icon {
  font-size: 32px;
  margin-right: 12px;
}

.action-content {
  flex: 1;
}

.action-title {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 4px;
}

.action-desc {
  font-size: 12px;
  opacity: 0.9;
}

.action-arrow {
  font-size: 20px;
  opacity: 0.8;
}

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

/* ==================== 投放页 ==================== */
.throw-page {
  padding: 15px;
  padding-bottom: 100px;
}

.section {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 10px;
}

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

.input-wrapper {
  position: relative;
}

.content-input {
  width: 100%;
  min-height: 100px;
  background: #f8f8f8;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.6;
  border: none;
  resize: vertical;
  font-family: inherit;
}

.content-input:focus {
  outline: none;
  background: #f0f0f0;
}

.char-count {
  position: absolute;
  right: 10px;
  bottom: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

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

.add-btn {
  width: 100px;
  height: 100px;
  background: #f8f8f8;
  border: 2px dashed #ddd;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.add-btn:active {
  background: #f0f0f0;
}

.add-icon {
  font-size: 24px;
  color: #ccc;
  margin-bottom: 4px;
}

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

.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.video-preview {
  width: 100%;
  max-height: 180px;
  background: #000;
}

.submit-section {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  padding: 15px;
  background: var(--card-bg);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.submit-btn {
  width: 100%;
  height: 48px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

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

.submit-btn:disabled {
  opacity: 0.5;
}

/* ==================== 拾取页 ==================== */
.pick-page {
  background: var(--bg-color);
  min-height: 100vh;
}

.pick-section {
  display: flex;
  justify-content: center;
  padding: 30px 0;
  background: var(--pick-gradient);
}

.pick-bottle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.2s;
}

.pick-bottle:active {
  transform: scale(0.95);
}

.bottle-icon {
  font-size: 60px;
  margin-bottom: 10px;
}

.bottle-icon.shaking {
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.pick-text {
  font-size: 15px;
  color: #fff;
  font-weight: bold;
}

.list-section {
  margin: 15px;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-primary);
}

.section-count {
  font-size: 12px;
  color: var(--text-muted);
}

.bottle-list {
  max-height: calc(100vh - 350px);
  overflow-y: auto;
}

.bottle-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

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

.bottle-item:active {
  background: #f8f8f8;
}

.item-icon {
  font-size: 24px;
  margin-right: 10px;
}

.item-content {
  flex: 1;
  overflow: hidden;
}

.item-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.item-time {
  margin-right: 10px;
}

.item-arrow {
  font-size: 18px;
  color: #ccc;
  margin-left: 5px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
}

.empty-icon {
  font-size: 50px;
  margin-bottom: 10px;
}

.empty-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

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

/* ==================== 详情页 ==================== */
.detail-page {
  min-height: 100vh;
  background: var(--bg-color);
  padding-bottom: 20px;
}

.header-section {
  display: flex;
  align-items: center;
  padding: 20px 15px;
  background: var(--primary-gradient);
  color: #fff;
}

.header-icon {
  font-size: 40px;
  margin-right: 12px;
}

.header-info {
  flex: 1;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
}

.header-time {
  font-size: 12px;
  opacity: 0.8;
}

.content-section {
  margin: 15px;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.text-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 15px;
}

.section-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.images-content, .video-content {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-grid img {
  width: calc((100% - 12px) / 3);
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}

.video-player {
  width: 100%;
  max-height: 200px;
  border-radius: 6px;
  background: #000;
}

.footer-section {
  margin: 0 15px;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.footer-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
}

.footer-item .label {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-item .value {
  font-size: 13px;
  color: var(--text-secondary);
}

.back-section {
  margin: 20px 15px;
}

.back-btn {
  width: 100%;
  height: 45px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.loading-container, .error-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-icon, .error-icon {
  font-size: 50px;
  margin-bottom: 10px;
}

.loading-text, .error-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ==================== 我的页面 ==================== */
.profile-page {
  min-height: 100vh;
  background: var(--bg-color);
}

.user-card {
  position: relative;
  margin-bottom: 15px;
  overflow: hidden;
}

.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
}

.card-content {
  position: relative;
  display: flex;
  align-items: center;
  padding: 30px 15px 20px;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #e0e0e0;
  margin-right: 15px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-nickname {
  font-size: 19px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
}

.profile-role-tag.user {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.profile-role-tag.admin {
  background: rgba(255, 193, 7, 0.9);
  color: #333;
}

.menu-section {
  margin: 0 15px;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f5f5f5;
}

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

.menu-icon {
  font-size: 20px;
  margin-right: 12px;
}

.menu-content {
  flex: 1;
}

.menu-title {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

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

.logout-section {
  margin: 20px 15px;
}

.logout-btn {
  width: 100%;
  height: 45px;
  background: var(--card-bg);
  color: #ff4d4f;
  font-size: 15px;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logout-btn:active {
  background: #f5f5f5;
}

/* ==================== 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: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ==================== 模态框 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.modal {
  background: var(--card-bg);
  border-radius: 12px;
  width: 80%;
  max-width: 300px;
  overflow: hidden;
}

.modal-header {
  padding: 15px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 20px 15px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.modal-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 15px;
  cursor: pointer;
  border: none;
  background: none;
}

.modal-btn.cancel {
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
}

.modal-btn.confirm {
  color: var(--primary-color);
  font-weight: bold;
}

.modal-btn:active {
  background: #f5f5f5;
}
