* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #F0EBE1;
  min-height: 100vh;
  color: #1A1A1A;
}

.page { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #1A1A1A;
}

main { display: flex; flex-direction: column; gap: 24px; }

.upload-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

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

.upload-card .subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
  line-height: 1.5;
}

.upload-card .subtitle code {
  background: #F0EBE1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #2E6E6A;
}

.drop-zone {
  border: 2px dashed #C5D5D4;
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 20px;
}

.drop-zone.drag-over {
  border-color: #2E6E6A;
  background: #F0F7F6;
}

.drop-icon { margin-bottom: 12px; }

.drop-zone > p {
  font-size: 14px;
  color: #888;
  margin-bottom: 20px;
}

.file-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #F5F5F5;
  color: #444;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: 1.5px solid #E0E0E0;
}

.file-btn:hover { background: #EBEBEB; }

.file-btn.selected {
  background: #E8F4F3;
  border-color: #2E6E6A;
  color: #2E6E6A;
  font-weight: 500;
}

.progress-area {
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: #EEEEEE;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2E6E6A;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.upload-btn {
  width: 100%;
  padding: 14px;
  background: #2E6E6A;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.upload-btn:hover:not(:disabled) { background: #3A8A85; }
.upload-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.history-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #444;
  margin-bottom: 12px;
}

.session-list { display: flex; flex-direction: column; gap: 8px; }

.session-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  gap: 8px;
}

.session-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.session-info:hover .session-name { color: #2E6E6A; }

.session-name {
  flex: 1;
  font-size: 14px;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.session-date {
  font-size: 12px;
  color: #AAA;
  white-space: nowrap;
  flex-shrink: 0;
}

.session-delete {
  background: none;
  border: none;
  color: #CCC;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

.session-delete:hover { color: #E55; }

/* ── Header 用户信息 ── */
.header-user {
  font-size: 13px;
  color: #666;
  padding: 0 4px;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #D8D3CA;
  background: #fff;
  color: #555;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.header-icon-btn:hover { border-color: #2E6E6A; color: #2E6E6A; background: #F0F7F6; }

/* ── 主题切换按钮 ── */
.theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid #D8D3CA;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.theme-btn:hover { border-color: #2E6E6A; color: #2E6E6A; background: #F0F7F6; }

/* ── 主题面板 ── */
.theme-panel {
  position: absolute;
  top: 72px;
  right: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid #E8E4DD;
  padding: 18px;
  width: 340px;
  z-index: 100;
}
.theme-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 14px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ── 主题卡片 ── */
.theme-card {
  border-radius: 10px;
  border: 2px solid #E8E4DD;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.theme-card:hover { border-color: #2E6E6A; }
.theme-card.active { border-color: #2E6E6A; box-shadow: 0 0 0 2px rgba(46,110,106,0.15); }

/* 预览缩略图 */
.theme-preview {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  height: 64px;
  display: flex;
  flex-direction: column;
}
.tp-bar {
  height: 14px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.tp-dot { width: 6px; height: 6px; border-radius: 50%; }
.tp-body {
  flex: 1;
  padding: 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tp-card {
  border-radius: 3px;
  flex: 1;
}

.theme-name { font-size: 13px; font-weight: 600; color: #1A1A1A; }
.theme-desc { font-size: 11px; color: #999; margin-top: 1px; }
.theme-check { font-size: 11px; color: #2E6E6A; font-weight: 600; margin-top: 3px; }

/* 让 .page 相对定位以便面板绝对定位 */
.page { position: relative; }

/* ══════════════════════════════════════
   管理员 header 右侧按钮组
   ══════════════════════════════════════ */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════
   普通用户视图
   ══════════════════════════════════════ */
.user-page {
  min-height: 100vh;
  background: #F0EBE1;
  display: flex;
  flex-direction: column;
}

/* 用户 Header */
.user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-logo-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
}

.user-logo-sub {
  font-size: 11px;
  color: #888;
  font-weight: 400;
}

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

.user-name-badge {
  font-size: 13px;
  font-weight: 500;
  color: #2E6E6A;
  background: #E8F4F3;
  padding: 4px 10px;
  border-radius: 20px;
}

.user-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1.5px solid #D8D3CA;
  background: #fff;
  color: #888;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.user-logout-btn:hover { border-color: #E55; color: #E55; }

/* 内容区 */
.user-body {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 12px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #999;
}
.empty-sub {
  font-size: 13px;
  color: #BBB;
}

/* 视频库 */
.library-label {
  font-size: 12px;
  font-weight: 600;
  color: #AAA;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 0 2px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 视频卡片 */
.video-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1.5px solid transparent;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,110,106,0.12);
  border-color: rgba(46,110,106,0.2);
}
.video-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 播放图标圆圈 */
.vc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2E6E6A, #3A8A85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(46,110,106,0.3);
}

/* 文字区域 */
.vc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vc-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.vc-ep {
  font-size: 12px;
  color: #AAA;
}

/* 右箭头 */
.vc-arrow {
  color: #CCC;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.video-card:hover .vc-arrow {
  color: #2E6E6A;
  transform: translateX(2px);
}
