/* ============ 变量 & 全局 ============ */
:root {
  --primary: #4A90D9;
  --primary-light: #6aa6e8;
  --primary-dark: #3570b0;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
  --vote-color: #e74c3c;
  --flower-color: #e91e63;
  --like-color: #e91e63;
  --border: #e8e8e8;
  --bg: #f5f6f8;
  --card-bg: #fff;
  --text: #333;
  --text-light: #888;
  --gradient: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --radius: 12px;
}

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

body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 20px;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ============ Loading ============ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
}
.loading i { font-size: 2em; margin-bottom: 12px; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ============ Header ============ */
.header {
  background: var(--gradient);
  color: white;
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.logo {
  font-size: 1.2em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}
.guest-label {
  font-size: 0.9em;
  opacity: 0.85;
  padding: 2px 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
}
.username { font-weight: 600; }

/* ============ Navigation Tabs ============ */
.nav-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-size: 0.85em;
  opacity: 0.8;
  color: white;
  user-select: none;
}
.tab.active {
  opacity: 1;
  border-bottom-color: white;
  font-weight: 600;
}

/* ============ Main Content ============ */
.main-content, .page-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
}

/* ============ Section Title ============ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1em;
  font-weight: 700;
  margin: 16px 0 10px;
  color: var(--text);
}
.section-title span { display: flex; align-items: center; gap: 6px; }

/* ============ Cards ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 1.05em;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #f5f5f5; }
.btn-sm { padding: 6px 12px; font-size: 0.82em; }
.card-btn { padding: 3px 5px; border:none; border-radius:6px; background:#f5f5f5; cursor:pointer; font-size:0.9em; color:#555; line-height:1.4; }
.card-btn:hover { background:#e8e8e8; }
.btn-lg { padding: 14px 24px; font-size: 1em; }

/* ============ Forms ============ */
.form-input, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  box-sizing: border-box;
}

/* ============ Avatar ============ */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* ============ Video Grid ============ */
.video-grid { display: flex; flex-direction: column; gap: 12px; }
.video-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card video { width: 100%; display: block; max-height: 240px; }
.video-info { padding: 12px 14px; }
.video-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.video-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ============ Comments ============ */
.video-comments { margin-top: 8px; border-top: 1px solid #f0f0f0; padding-top: 8px; }

/* ============ Scroll Notice ============ */
.scroll-notice {
  background:none; border:none; border-radius:0;
  padding:4px 0; margin-bottom:6px;
  font-size:0.8em; color:#666;
  display:flex; align-items:center; gap:6px;
  min-height:24px; border-bottom:1px solid #eee;
}
.scroll-text { flex:1; font-weight:600; opacity:0; transition:opacity 0.35s ease; }
.scroll-notice .fas.fa-bullhorn { flex-shrink:0; color:#999; }

/* ============ Ranking ============ */
.ranking-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 1.05em; }
.close, .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.modal-body { padding: 16px 20px; }

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  top: 70px;
  right: 12px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}
.toast.success { background: rgba(39,174,96,0.95); }
.toast.error { background: rgba(231,76,60,0.95); }
.toast.info { background: rgba(74,144,217,0.95); }

/* ============ Empty State ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}
.empty-state i { font-size: 2.5em; color: #ddd; display: block; margin-bottom: 12px; }

/* ============ Admin Table ============ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.admin-table th { background: #f5f5f5; padding: 8px 6px; text-align: left; border-bottom: 2px solid #e8e8e8; font-weight: 600; }
.admin-table td { padding: 8px 6px; border-bottom: 1px solid #f0f0f0; }
.admin-table tr:hover { background: #fafafa; }

/* ============ Announcement Banner ============ */
.announcement-banner {
  background: linear-gradient(135deg, #fff7e6, #fffbe6);
  border: 1px solid #ffd591;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

/* ============ Upload ============ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  background: #fafafa;
}

/* ============ Footer ============ */
.footer-bar { text-align: center; padding: 20px; color: #bbb; font-size: 0.8em; }



/* ============ 我投票了的显示 ============ */
.scroll-voted {
  display: inline-flex; align-items: center;
  flex-shrink: 0; margin-left: auto;
}
.scroll-voted-loading {
  font-size: 0.8em; color: #999; white-space: nowrap;
}
.scroll-voted-badge {
  display: inline-flex; align-items: center;
  font-size: 0.8em; cursor: pointer; white-space: nowrap;
  padding: 2px 12px; border-radius: 20px;
  transition: all 0.25s ease;
  font-weight: 600; letter-spacing: 0.3px;
}
.scroll-voted-badge.voted {
  color: #e74c3c;
  background: linear-gradient(135deg, #fff5f5, #ffe8e8);
  border: 1px solid #ffcdd2;
  box-shadow: 0 1px 3px rgba(231,76,60,0.08);
}
.scroll-voted-badge.voted:hover {
  background: linear-gradient(135deg, #ffe8e8, #ffd4d4);
  border-color: #e74c3c;
  box-shadow: 0 2px 8px rgba(231,76,60,0.2);
  transform: translateY(-1px);
}
.scroll-voted-badge.remaining {
  color: #5c6bc0;
  background: linear-gradient(135deg, #f5f7ff, #e8ecff);
  border: 1px solid #c5cae9;
  box-shadow: 0 1px 3px rgba(92,107,192,0.08);
}
.scroll-voted-badge.remaining:hover {
  background: linear-gradient(135deg, #e8ecff, #dde2ff);
  border-color: #5c6bc0;
  box-shadow: 0 2px 8px rgba(92,107,192,0.2);
  transform: translateY(-1px);
}
