@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --pink-light: #FFE8EE;
  --pink: #FF8FAB;
  --pink-deep: #F06292;
  --blue-light: #E3F2FF;
  --blue: #90CAF9;
  --blue-deep: #64B5F6;
  --yellow: #FFD54F;
  --green-light: #E8F5E9;
  --green: #A5D6A7;
  --purple-light: #F3E5F5;
  --bg-gradient: linear-gradient(135deg, #FFF0F5 0%, #E8F4FF 100%);
  --card-bg: rgba(255,255,255,0.85);
  --shadow: 0 4px 20px rgba(255,143,171,0.15);
  --shadow-hover: 0 8px 30px rgba(255,143,171,0.28);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #444;
}

.site-icp-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 34px auto 0;
  padding: 12px 16px 0;
  text-align: center;
  color: rgba(64, 76, 104, 0.78);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  word-break: break-word;
}

.site-icp-footer a {
  color: inherit;
  text-decoration: none;
}

.site-icp-footer a:hover {
  color: var(--site-primary-deep, #F06292);
  text-decoration: underline;
}

.home-app .site-icp-footer,
.site-icp-footer.site-icp-auth {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  margin: 0;
  padding: 0 18px;
}

.site-icp-footer.site-icp-auth {
  z-index: 20;
}

@media (max-width: 760px) {
  .site-icp-footer {
    margin-top: 24px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .home-app .site-icp-footer,
  .site-icp-footer.site-icp-auth {
    bottom: 8px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8f8f8; }
::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 3px; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--pink-light);
  padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 12px rgba(255,143,171,0.1);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: var(--pink-deep);
  text-decoration: none;
}
.logo-icon { font-size: 28px; }

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 7px 16px; border-radius: 20px;
  text-decoration: none; color: #666; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--pink-light); color: var(--pink-deep);
}

.nav-user {
  display: flex; align-items: center; gap: 12px;
}
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white;
  box-shadow: 0 2px 8px rgba(255,143,171,0.3);
  transition: transform 0.2s;
  overflow: hidden;
}
.avatar-btn img { width: 86%; height: 86%; object-fit: contain; display: block; }
.avatar-btn:hover { transform: scale(1.08); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 25px;
  border: none; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: white;
  box-shadow: 0 4px 12px rgba(240,98,146,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(240,98,146,0.45); }
.btn-outline {
  background: white; color: var(--pink-deep);
  border: 2px solid var(--pink);
}
.btn-outline:hover { background: var(--pink-light); }
.btn-blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
  box-shadow: 0 4px 12px rgba(100,181,246,0.35);
}
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.7);
  transition: all 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ===== VIDEO CARD ===== */
.video-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s;
  cursor: pointer;
}
.video-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #FFE8EE, #E3F2FF);
  overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.65); color: white;
  padding: 2px 8px; border-radius: 8px; font-size: 12px;
}
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background 0.2s;
}
.video-card:hover .play-overlay { background: rgba(0,0,0,0.15); }
.play-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0;
  transform: scale(0.8); transition: all 0.2s;
}
.video-card:hover .play-icon { opacity: 1; transform: scale(1); }
.video-info { padding: 14px 16px; }
.video-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; line-height: 1.4; }
.video-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.tag-pink { background: var(--pink-light); color: var(--pink-deep); }
.tag-blue { background: var(--blue-light); color: #2196F3; }
.tag-green { background: var(--green-light); color: #4CAF50; }
.tag-yellow { background: #FFF8E1; color: #F57F17; }

/* ===== GRADE CARD ===== */
.grade-card {
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 8px; cursor: pointer;
  transition: all 0.25s; border: 2px solid transparent;
  text-decoration: none;
}
.grade-card:hover { transform: translateY(-5px) scale(1.03); border-color: var(--pink); }
.grade-card .emoji { font-size: 36px; }
.grade-card .label { font-size: 15px; font-weight: 700; }

/* ===== CATEGORY PILL ===== */
.category-pill {
  padding: 8px 20px; border-radius: 25px;
  cursor: pointer; transition: all 0.2s;
  font-size: 14px; font-weight: 500;
  border: 2px solid var(--pink-light); background: white; color: #666;
}
.category-pill:hover, .category-pill.active {
  background: var(--pink); color: white; border-color: var(--pink);
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 16px;
  border: 2px solid #F0E0E8; border-radius: 12px;
  font-family: var(--font); font-size: 14px; color: #333;
  background: white; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255,143,171,0.15);
}
.form-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  z-index: 999; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 24px;
  padding: 32px; max-width: 480px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: none; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--pink-deep); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f5f5f5; border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--pink-light); }

/* ===== TOAST ===== */
.toast {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  background: #333; color: white;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateX(120%); transition: transform 0.3s;
}
.toast.show { transform: none; }
.toast.success { background: #4CAF50; }
.toast.error { background: #f44336; }

/* ===== DECORATIONS ===== */
.deco-star {
  position: absolute; pointer-events: none;
  opacity: 0.6; animation: float 3s ease-in-out infinite;
}
.deco-star:nth-child(2) { animation-delay: 1s; }
.deco-star:nth-child(3) { animation-delay: 2s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

/* ===== SECTION ===== */
.section { padding: 40px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: 20px; font-weight: 700; color: #333;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 4px; height: 22px;
  background: linear-gradient(var(--pink), var(--pink-deep));
  border-radius: 2px;
}

/* ===== GRID ===== */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 20px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; background: #f8f9fc; }
.sidebar {
  width: 220px; background: white; border-right: 1.5px solid #f0e0e8;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  box-shadow: 2px 0 12px rgba(255,143,171,0.08);
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1.5px solid var(--pink-light);
  font-size: 16px; font-weight: 700; color: var(--pink-deep);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.sidebar-group-title {
  font-size: 11px; font-weight: 700; color: #bbb; letter-spacing: 1px;
  text-transform: uppercase; padding: 12px 8px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: #666; font-size: 14px; font-weight: 500;
  margin-bottom: 2px; transition: all 0.2s;
}
.sidebar-link:hover { background: var(--pink-light); color: var(--pink-deep); }
.sidebar-link.active { background: var(--pink-light); color: var(--pink-deep); font-weight: 600; }
.sidebar-link .icon { font-size: 18px; width: 24px; text-align: center; }

.admin-main { margin-left: 220px; flex: 1; }
.admin-topbar {
  background: white; border-bottom: 1.5px solid #f0e0e8;
  padding: 0 32px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar-title { font-size: 16px; font-weight: 700; color: #333; }

.admin-content { padding: 28px 32px; }

/* ===== STAT CARD ===== */
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1.5px solid #f5f5f5;
  display: flex; align-items: center; gap: 18px;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.stat-info { flex: 1; }
.stat-num { font-size: 28px; font-weight: 800; color: #333; }
.stat-label { font-size: 13px; color: #888; margin-top: 2px; }

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #fafafa; padding: 12px 16px;
  text-align: left; font-size: 13px; font-weight: 700; color: #666;
  border-bottom: 2px solid #f0e0e8;
}
.data-table td {
  padding: 14px 16px; border-bottom: 1px solid #f8f0f4;
  font-size: 14px; color: #444;
}
.data-table tr:hover td { background: #fff8fb; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-pink { background: var(--pink-light); color: var(--pink-deep); }
.badge-blue { background: var(--blue-light); color: #1976D2; }
.badge-green { background: var(--green-light); color: #388E3C; }
.badge-gray { background: #f5f5f5; color: #888; }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; align-items: center; gap: 0;
  background: white; border: 2px solid var(--pink-light);
  border-radius: 25px; overflow: hidden; padding: 0 8px 0 16px;
  box-shadow: 0 2px 10px rgba(255,143,171,0.1);
}
.search-bar input {
  flex: 1; border: none; outline: none;
  padding: 10px 8px; font-family: var(--font); font-size: 14px; color: #333;
}
.search-bar button {
  background: var(--pink); color: white; border: none;
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  font-size: 14px; transition: background 0.2s;
}
.search-bar button:hover { background: var(--pink-deep); }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; align-items: center; }
.page-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid #f0e0e8;
  background: white; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: #666;
}
.page-btn:hover, .page-btn.active {
  background: var(--pink); color: white; border-color: var(--pink);
}

/* ===== CAROUSEL ===== */
.carousel {
  border-radius: var(--radius);
  overflow: hidden; position: relative;
  background: linear-gradient(135deg, #FFE0EC, #BBDEFB);
}
.carousel-inner { display: flex; transition: transform 0.5s ease; }
.carousel-slide {
  min-width: 100%;
  aspect-ratio: 16/5;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 60px;
  position: relative; overflow: hidden;
}
.carousel-slide:nth-child(1) { background: linear-gradient(135deg, #FFD6E7, #C8E6FF); }
.carousel-slide:nth-child(2) { background: linear-gradient(135deg, #C8E6FF, #D7F7D7); }
.carousel-slide:nth-child(3) { background: linear-gradient(135deg, #FFF8CC, #FFD6E7); }
.carousel-text { position: absolute; left: 60px; }
.carousel-text h2 { font-size: 28px; font-weight: 800; color: #333; margin-bottom: 8px; }
.carousel-text p { font-size: 15px; color: #666; margin-bottom: 18px; }
.carousel-emoji { font-size: 120px; opacity: 0.5; }
.carousel-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5);
  cursor: pointer; transition: all 0.3s;
}
.carousel-dot.active { width: 24px; border-radius: 4px; background: white; }
.carousel-prev, .carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.8); border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-prev:hover, .carousel-next:hover { background: white; }

/* ===== 手机端响应式优化 ===== */
@media (max-width: 768px) {
  .container { padding: 0 12px; }

  /* 导航栏 */
  .nav-container { padding: 0 12px; }
  .nav-links { gap: 8px; }
  .nav-link { font-size: 13px; padding: 5px 8px; }

  /* 视频网格 */
  .video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  /* 年级快速入口 */
  .grade-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .grade-btn { padding: 10px 6px; font-size: 12px; }

  /* 课程按钮 */
  .category-pill { font-size: 13px; padding: 7px 14px; }

  /* 轮播图 */
  .banner-text-title { font-size: 20px !important; }
  .banner-text-sub   { font-size: 13px !important; }

  /* 播放页 */
  .player-layout  { grid-template-columns: 1fr !important; gap: 14px; }
  .side-list      { max-height: 300px; }

  /* 后台管理 */
  .admin-layout   { grid-template-columns: 1fr !important; }
  .sidebar        { display: none; }
  .data-table th,
  .data-table td  { padding: 8px 6px; font-size: 12px; }
  .modal          { width: 95vw !important; max-width: 95vw !important; padding: 20px 14px; }

  /* 个人中心 */
  .profile-layout { grid-template-columns: 1fr !important; }
  .profile-card   { margin-bottom: 16px; }

  /* 视频卡片 */
  .video-card .title    { font-size: 13px; }
  .video-card .meta-row { font-size: 11px; }

  /* 表单 */
  .form-input { font-size: 15px; } /* 防 iOS 自动缩放 */
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr 1fr !important; }
  .grade-grid { grid-template-columns: repeat(2, 1fr) !important; }
  h1, .page-title { font-size: 18px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .nav-logo span { font-size: 16px; }
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
