/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #8b5cf6;
  --bg: #f0f2f8;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card: #ffffff;
  --text: #1e2433;
  --text-secondary: #8a90a0;
  --text-light: #b0b6c4;
  --border: #e8eaf0;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.06);
  --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 12px 40px rgba(99, 102, 241, 0.15);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

/* ===== Auth View ===== */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

/* 背景装饰圆 */
.auth-view::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  top: -100px;
  right: -80px;
}
.auth-view::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  bottom: -60px;
  left: -50px;
}

.auth-card {
  background: var(--card);
  border-radius: 24px;
  padding: 40px 28px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
  animation: cardIn 0.5s ease-out;
}

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

.auth-logo {
  text-align: center;
  margin-bottom: 12px;
}
.auth-logo img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(180, 30, 30, 0.25);
  border: 3px solid #fff;
}

.auth-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 28px;
  letter-spacing: 0.5px;
}

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 11px 0;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  padding-left: 2px;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
  background: #fafbfe;
  color: var(--text);
}

.form-group input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 500;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--bg-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ===== Main View ===== */
.main-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-gradient);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user {
  font-size: 14px;
  opacity: 0.95;
  font-weight: 500;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 20px;
}

.btn-logout {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-logout:active {
  background: rgba(255,255,255,0.35);
}

/* ===== Pages ===== */
.page {
  display: none;
  flex: 1;
  padding: 18px 16px;
  padding-bottom: 90px;
  animation: pageIn 0.3s ease-out;
}

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

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 18px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

/* ===== Checkin ===== */
.checkin-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 24px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.checkin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--bg-gradient);
}

.checkin-icon {
  font-size: 60px;
  margin-bottom: 14px;
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

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

.checkin-card h2 {
  font-size: 21px;
  margin-bottom: 22px;
  font-weight: 700;
}

.streak-display {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border-radius: 16px;
}

.streak-number {
  font-size: 64px;
  font-weight: 900;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.streak-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

.checkin-status-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 500;
}

.btn-checkin {
  max-width: 220px;
  margin: 0 auto;
  display: block;
}

.btn-checkin:disabled {
  background: var(--success);
  cursor: default;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* ===== Ranking ===== */
.ranking-section {
  margin-top: 0;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}
.ranking-title {
  text-align: center;
  font-size: 18px;
  color: var(--text-primary);
  margin: 0 0 18px;
  font-weight: 700;
}
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #f8f9fb;
  border-radius: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ranking-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.ranking-item.top1 {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border: 1px solid #ffd700;
}
.ranking-item.top2 {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  border: 1px solid #c0c0c0;
}
.ranking-item.top3 {
  background: linear-gradient(135deg, #fef0e6 0%, #fde0cc 100%);
  border: 1px solid #cd7f32;
}
.rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
}
.ranking-item.top1 .rank-badge { background: linear-gradient(135deg, #ffd700, #ffb700); color: #7a5c00; }
.ranking-item.top2 .rank-badge { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #fff; }
.ranking-item.top3 .rank-badge { background: linear-gradient(135deg, #cd7f32, #b87333); color: #fff; }
.rank-user {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-stats {
  text-align: right;
  flex-shrink: 0;
}
.rank-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}
.rank-total-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.rank-streak {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}
.ranking-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px 0;
  font-size: 14px;
}

/* ===== Messages ===== */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.message-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary-light);
  animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.message-nickname {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

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

.message-content {
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  color: #374151;
}

.message-input-bar {
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 70px;
  background: var(--bg);
  padding: 10px 0;
  z-index: 50;
}

.message-input-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 15px;
  outline: none;
  background: var(--card);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.message-input-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-send {
  padding: 0 22px;
  background: var(--bg-gradient);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn-send:active {
  transform: scale(0.95);
}

/* ===== Files ===== */
.upload-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-upload {
  display: inline-block;
  padding: 11px 20px;
  background: var(--bg-gradient);
  color: #fff;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
  transition: transform 0.15s;
}
.btn-upload:active {
  transform: scale(0.96);
}

.upload-progress {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.file-item:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.file-icon {
  font-size: 12px;
  font-weight: 800;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.icon-pdf { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.icon-doc { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.icon-xls { background: linear-gradient(135deg, #22c55e, #15803d); }
.icon-ppt { background: linear-gradient(135deg, #f97316, #c2410c); }
.icon-html { background: linear-gradient(135deg, #f59e0b, #b45309); }
.icon-zip { background: linear-gradient(135deg, #eab308, #a16207); }
.icon-audio { background: linear-gradient(135deg, #ec4899, #be185d); }
.icon-video { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.icon-img { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.icon-txt { background: linear-gradient(135deg, #6b7280, #374151); }
.icon-default { background: linear-gradient(135deg, #6366f1, #4338ca); }

.file-info {
  flex: 1;
  min-width: 0;
}

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

.file-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-icon {
  font-size: 24px;
  transition: transform 0.2s;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
}

/* 在线预览按钮 */
.file-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
  margin-top: 4px;
}

.btn-small {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: transform 0.15s;
}
.btn-small:active {
  transform: scale(0.95);
}

.btn-preview {
  background: var(--bg-gradient);
  color: #fff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
  flex: 1;
}

/* ===== 分类标签栏 ===== */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar {
  display: none;
}
.cat-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--bg-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}
.cat-tab:active {
  transform: scale(0.95);
}
/* ===== 响应式适配 ===== */

/* 基础：移动端优先，body 作为内容容器 */
body {
  transition: max-width 0.3s ease;
}

/* 平板竖屏 / 大屏手机 */
@media (min-width: 540px) and (max-width: 767px) {
  body { max-width: 520px; }
  .bottom-nav { max-width: 520px; }
  .auth-card { max-width: 380px; }
}

/* 平板横屏 / 小笔记本 */
@media (min-width: 768px) and (max-width: 1023px) {
  body {
    max-width: 620px;
    margin: 24px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.1);
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: var(--card);
  }
  .main-view {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .page {
    flex: 1;
    overflow-y: auto;
    padding: 24px 22px;
    padding-bottom: 24px;
  }
  .bottom-nav {
    position: relative;
    max-width: 100%;
    left: auto;
    transform: none;
    bottom: auto;
    border-radius: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
    border: none;
    border-top: 1px solid var(--border);
  }
  .auth-view {
    border-radius: 20px;
    height: 100%;
    min-height: auto;
  }
  .auth-card { max-width: 400px; padding: 44px 32px 36px; }
  .auth-title { font-size: 30px; }
  .file-icon { width: 64px; height: 64px; font-size: 13px; border-radius: 18px; }
  .file-name { font-size: 16px; }
  .streak-number { font-size: 72px; }
  .message-input-bar {
    position: relative;
    bottom: auto;
    padding: 12px 0 4px;
  }
}

/* 桌面 / 大屏笔记本 */
@media (min-width: 1024px) {
  body {
    max-width: 720px;
    margin: 32px auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(99, 102, 241, 0.12);
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: var(--card);
  }
  .main-view {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .page {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px;
    padding-bottom: 28px;
  }
  .bottom-nav {
    position: relative;
    max-width: 100%;
    left: auto;
    transform: none;
    bottom: auto;
    border-radius: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
    border: none;
    border-top: 1px solid var(--border);
  }
  .auth-view {
    border-radius: 24px;
    height: 100%;
    min-height: auto;
  }
  .auth-card {
    max-width: 420px;
    padding: 48px 36px 40px;
  }
  .auth-logo { font-size: 56px; }
  .auth-title { font-size: 32px; }
  .auth-subtitle { font-size: 14px; margin: 10px 0 30px; }
  .form-group input { padding: 14px 18px; font-size: 15px; }
  .btn-primary { padding: 15px; font-size: 17px; }
  .page { padding: 28px 28px; padding-bottom: 110px; }
  .page-header h2 { font-size: 24px; }
  .topbar { padding: 18px 28px; }
  .topbar-title { font-size: 20px; }
  .file-item { padding: 18px 20px; gap: 16px; }
  .file-icon { width: 68px; height: 68px; font-size: 14px; border-radius: 20px; }
  .file-name { font-size: 16px; }
  .file-meta { font-size: 13px; }
  .btn-small { padding: 9px 22px; font-size: 14px; }
  .message-item { padding: 16px 18px; }
  .message-content { font-size: 16px; line-height: 1.7; }
  .message-input-bar { position: relative; bottom: auto; padding: 12px 0 4px; }
  .checkin-card { padding: 52px 32px 40px; border-radius: 22px; }
  .checkin-icon { font-size: 64px; }
  .streak-number { font-size: 76px; }
  .streak-display { padding: 28px; border-radius: 18px; }
  .cat-tab { padding: 9px 20px; font-size: 14px; }
  .btn-upload { padding: 12px 24px; font-size: 15px; }
  .nav-icon { font-size: 26px; }
  .nav-item { font-size: 12px; padding: 8px 0; }
}

/* 超宽屏 */
@media (min-width: 1440px) {
  body { max-width: 780px; }
  .bottom-nav { max-width: 780px; }
}

/* 超小屏手机 */
@media (max-width: 360px) {
  html, body { font-size: 15px; }
  .auth-card { padding: 28px 20px 24px; border-radius: 18px; }
  .auth-logo { font-size: 42px; }
  .auth-title { font-size: 24px; }
  .auth-subtitle { font-size: 12px; margin: 6px 0 20px; }
  .form-group { margin-bottom: 14px; }
  .form-group input { padding: 11px 12px; font-size: 14px; }
  .btn-primary { padding: 12px; font-size: 15px; }
  .topbar { padding: 12px 14px; }
  .topbar-title { font-size: 17px; }
  .page { padding: 14px 12px; padding-bottom: 76px; }
  .page-header h2 { font-size: 19px; }
  .file-item { padding: 12px; gap: 10px; }
  .file-icon { width: 48px; height: 48px; font-size: 10px; border-radius: 12px; }
  .file-name { font-size: 14px; }
  .file-meta { font-size: 11px; }
  .btn-small { padding: 6px 14px; font-size: 12px; }
  .streak-number { font-size: 48px; }
  .checkin-card { padding: 28px 18px 24px; }
  .checkin-icon { font-size: 48px; }
  .cat-tab { padding: 6px 14px; font-size: 12px; }
  .nav-icon { font-size: 20px; }
  .nav-item { font-size: 10px; }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .auth-view { padding: 10px; }
  .auth-card { padding: 20px 28px; }
  .auth-logo { font-size: 36px; margin-bottom: 4px; }
  .auth-title { font-size: 22px; }
  .auth-subtitle { margin: 4px 0 14px; }
  .form-group { margin-bottom: 10px; }
  .form-group input { padding: 10px 14px; }
}

/* ===== Admin ===== */
.admin-header { text-align: center; margin-bottom: 20px; }
.admin-header h2 { margin: 0; font-size: 22px; color: var(--text-primary); }
.admin-subtitle { color: var(--text-secondary); font-size: 13px; margin: 6px 0 0; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: rgba(255,255,255,0.95); border-radius: 16px; padding: 18px 10px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.stat-icon { font-size: 28px; margin-bottom: 6px; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; background: rgba(255,255,255,0.6); padding: 5px; border-radius: 12px; }
.admin-tab { flex: 1; padding: 10px 8px; border: none; background: transparent; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.admin-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(102,126,234,0.3); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item { background: rgba(255,255,255,0.95); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-title { font-weight: 600; font-size: 14px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.admin-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; margin-left: 6px; }
.admin-del-btn { padding: 7px 14px; border: none; background: #fee2e2; color: #dc2626; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: all 0.2s; }
.admin-del-btn:hover { background: #dc2626; color: #fff; }
.admin-empty { text-align: center; color: var(--text-secondary); padding: 30px 0; font-size: 14px; }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.review-header h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.review-badge { background: #f59e0b; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 12px; min-width: 24px; text-align: center; }
.review-item { border-left: 4px solid #f59e0b; }
.review-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-approve { padding: 7px 16px; border: none; background: #dcfce7; color: #16a34a; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-approve:hover { background: #16a34a; color: #fff; }
.btn-reject { padding: 7px 16px; border: none; background: #fee2e2; color: #dc2626; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-reject:hover { background: #dc2626; color: #fff; }
.nav-admin .nav-icon { color: #f59e0b; }

@media (max-width: 480px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 20px; }
}

.topbar-logo {
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.topbar-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

/* ===== Home (综合页) ===== */
.home-top { margin-bottom: 28px; }
.checkin-card-mini {
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.checkin-mini-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px; }
.checkin-mini-icon { font-size: 36px; }
.checkin-mini-title { font-weight: 700; font-size: 16px; color: var(--text-primary); }
.checkin-mini-streak { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.checkin-mini-streak span { font-size: 20px; font-weight: 800; color: var(--primary); }
.btn-checkin-mini {
  padding: 10px 22px;
  border: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
  transition: transform 0.15s;
}
.btn-checkin-mini:hover { transform: translateY(-1px); }
.btn-checkin-mini:disabled { background: var(--success); cursor: default; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.checkin-mini-status { width: 100%; margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }

.home-section {
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* 资源网格 */
.resource-grid { display: flex; flex-direction: column; gap: 16px; }
.resource-category {
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
}
.resource-cat-header {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.resource-items { padding: 8px 0; }
.resource-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
  gap: 10px;
}
.resource-item:hover { background: #f5f7fa; }
.resource-item-icon { font-size: 18px; flex-shrink: 0; }
.resource-item-info { flex: 1; min-width: 0; }
.resource-item-name { font-weight: 600; font-size: 14px; }
.resource-item-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-item-arrow { color: #ccc; font-size: 14px; flex-shrink: 0; }

@media (max-width: 480px) {
  .checkin-card-mini { padding: 14px 16px; }
  .home-section { padding: 16px; }
}

/* 留言搜索 */
.message-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.message-search-bar .search-icon { font-size: 16px; }
.message-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-primary);
}
.message-search-bar input::placeholder { color: #aaa; }
.message-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 0;
  font-size: 14px;
}


/* 考试信息栏 */
.exam-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(102,126,234,.3);
}
.exam-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.exam-date {
  font-size: 15px;
  font-weight: 600;
}
.exam-countdown {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.countdown-num {
  font-size: 22px;
  font-weight: 700;
  background: rgba(255,255,255,.2);
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}
.countdown-unit {
  font-size: 12px;
  margin-right: 4px;
  opacity: .9;
}
.daily-quote {
  font-size: 13px;
  line-height: 1.6;
  opacity: .95;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.2);
  font-style: italic;
}
@media (max-width: 400px) {
  .exam-info { flex-direction: column; gap: 8px; align-items: flex-start; }
  .countdown-num { font-size: 18px; }
}

/* ===== 真题套卷分组 ===== */
.paper-group {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.paper-group-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #fef3f2 0%, #fff 100%);
  gap: 10px;
  transition: background 0.2s;
}
.paper-group-header:hover {
  background: linear-gradient(135deg, #fee2e2 0%, #fff 100%);
}
.paper-group.expanded .paper-group-header {
  background: linear-gradient(135deg, #fee2e2 0%, #fef3f2 100%);
  border-bottom: 1px solid var(--border);
}
.group-arrow {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s;
  width: 16px;
  flex-shrink: 0;
}
.group-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.group-count {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 12px;
  flex-shrink: 0;
}
.group-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.group-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.tag-pdf {
  background: #dbeafe;
  color: #1d4ed8;
}
.tag-audio {
  background: #fce7f3;
  color: #be185d;
}
.paper-group-content {
  display: none;
  padding: 8px 0;
}
.paper-group.expanded .paper-group-content {
  display: block;
}
.paper-group-content .file-item {
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.paper-group-content .file-item:last-child {
  border-bottom: none;
}
