* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Microsoft YaHei', -apple-system, sans-serif;
  background: #0a0a14;
  padding-top: 80px;
  min-height: 100vh;
  color: #e0e0e0;
  overflow-y: auto;
}
:root {
  --bg-dark: #0a0a14;
  --bg-card: rgba(255,255,255,0.06);
  --bg-card-hover: rgba(255,255,255,0.10);
  --border-subtle: rgba(255,255,255,0.08);
  --text-primary: #e8e8e8;
  --text-secondary: #999;
  --accent: #5CFF6D;
  --accent-dim: rgba(92,255,109,0.15);
  --blue: #4a9eff;
  --orange: #ff8a3c;
}

.layui-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== NAVIGATION (from original) ===== */
header {
  background-color: rgba(10, 10, 20, 0.95);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 12px 0;
  box-shadow: 0 4px 20px rgba(92, 255, 109, 0.2);
  backdrop-filter: blur(10px);
}
.nav-container { width: 100%; padding: 0 20px; }
.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
nav { flex: 1; display: flex; justify-content: center; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-icon {
  width: 45px; height: 45px;
  margin-right: 12px;
  position: relative;
  animation: pulse 2s infinite;
}
.logo-icon img { width: 50px; height: 50px; border-radius: 50%; }
.logo-text {
  font-size: 1.4rem;
  color: var(--mc-light, #F0F0F0);
  text-shadow: 0 0 10px rgba(92, 255, 109, 0.7);
  font-weight: bold;
  display: flex;
  align-items: center;
}
.logo-text span { color: var(--accent); }
nav ul { display: flex; list-style: none; gap: 4px; }
nav li { margin: 0; }
nav a {
  color: var(--mc-light, #F0F0F0);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  white-space: nowrap;
}
nav a:hover {
  color: var(--accent);
  background: rgba(92, 255, 109, 0.1);
  text-shadow: 0 0 8px rgba(92, 255, 109, 0.8);
}
.login-nickname {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  gap: 6px;
  color: var(--accent);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 20px;
  transition: background 0.2s;
}
.login-nickname:hover { background: rgba(92, 255, 109, 0.08); }
#avatar_img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
#login_regist { font-size: 0.9rem; padding: 6px 14px; }
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--mc-light, #F0F0F0);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
}
#mobileNav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 20, 0.98);
  box-shadow: 0 4px 20px rgba(92, 255, 109, 0.2);
  backdrop-filter: blur(10px);
  padding: 12px 0;
  z-index: 99;
}
#mobileNav.active { display: block; }
#mobileNav ul { flex-direction: column; align-items: center; }
#mobileNav li { margin: 4px 0; width: 100%; text-align: center; }
#mobileNav a { display: block; padding: 10px 20px; font-size: 1rem; }

@media (max-width: 768px) {
  #desktopNav { display: none; }
  .mobile-menu-toggle { display: block; }
  .logo-text { font-size: 1.1rem; }
  .login-nickname { font-size: 0.78rem; }
  #avatar_img { width: 24px; height: 24px; }
  body { padding-top: 80px; }
}
@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}
/* Dropdown */
.dropdown { position: relative; }
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  color: #ccc;
}
.dropdown-content a:hover { color: var(--accent); background: rgba(92,255,109,0.08); }
.dropdown:hover .dropdown-content { display: block; }
.dropbtn i { font-size: 0.7rem; margin-left: 2px; }

/* ===== PROFILE BANNER ===== */
.profile-banner {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.profile-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.profile-banner-inner {
  position: relative;
  z-index: 1;
  padding: 40px 32px 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.2);
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.profile-avatar:hover { transform: scale(1.05); }
.profile-info { flex: 1; min-width: 200px; }
.profile-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.profile-name .teacher-badge {
  font-size: 0.7rem;
  background: var(--orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
  font-weight: 600;
}
.profile-motto {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-top: 6px;
  font-style: italic;
  max-width: 500px;
}
.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 18px;
  backdrop-filter: blur(4px);
  min-width: 70px;
}
.stat-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.stat-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-header i {
  font-size: 1.2rem;
  color: var(--accent);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 8px;
}
.section-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.section-header .count-badge {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 2px 12px;
  border-radius: 20px;
}

/* ===== COURSE CARDS ===== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}
.course-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(92,255,109,0.2);
  box-shadow: 0 8px 30px rgba(92,255,109,0.08);
}
.course-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: #1a1a2e;
}
.course-body { padding: 12px 14px 14px; }
.course-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.course-type {
  background: rgba(74,158,255,0.15);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
}
.course-heat i { margin-right: 3px; }

/* ===== WORKS GRID ===== */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}
.work-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(92,255,109,0.15);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.work-cover {
  width: 100%;
  aspect-ratio: 16/12;
  object-fit: cover;
  display: block;
  background: #12121e;
}
.work-body { padding: 10px 12px 12px; }
.work-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.work-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.work-meta span { display: flex; align-items: center; gap: 3px; }
.work-meta i { font-size: 0.65rem; }
.work-tag {
  font-size: 0.6rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ===== LAYOUT: Main + Sidebar ===== */
.page-layout { display: flex; gap: 24px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ===== SIDEBAR CARDS ===== */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.sidebar-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-card-title i { color: var(--accent); }

/* Hot works */
.hot-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-radius: 6px;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { background: rgba(255,255,255,0.03); }
.hot-thumb {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #12121e;
}
.hot-info { flex: 1; min-width: 0; }
.hot-title {
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot-views {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 3px;
}
.hot-rank {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.hot-rank.top3 { background: var(--accent-dim); color: var(--accent); }

/* ===== INLINE COMMENT ===== */
.msg-input-area { margin-bottom: 16px; }
.msg-input-inner {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.3s;
}
.msg-input-inner:focus-within { border-color: rgba(92,255,109,0.3); }
.msg-textarea {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}
.msg-textarea::placeholder { color: #555; }
.msg-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.msg-char-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.msg-char-count.warn { color: var(--orange); }
.msg-char-count.over { color: #ff4757; }
.msg-submit-btn {
  background: var(--accent-dim);
  color: var(--accent);
  border: none;
  padding: 5px 18px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.msg-submit-btn:hover { background: rgba(92,255,109,0.25); }
.msg-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Comment cards */
.msg-card {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.msg-card:last-child { border-bottom: none; }
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-body { flex: 1; min-width: 0; }
.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.msg-nick {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.msg-nick:hover { text-decoration: underline; }
.msg-time {
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.msg-content {
  font-size: 0.82rem;
  color: #ccc;
  line-height: 1.5;
  word-break: break-word;
}
.msg-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== PAGINATION ===== */
.pagination-wrap { display: flex; justify-content: center; margin: 20px 0; }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 30px 0;
  color: #444;
  font-size: 0.8rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { width: 240px; }
}
@media (max-width: 768px) {
  .page-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .profile-banner-inner { padding: 24px 16px 20px; flex-direction: column; align-items: center; text-align: center; }
  .profile-info { text-align: center; }
  .profile-stats { justify-content: center; }
  .profile-avatar { width: 80px; height: 80px; }
  .profile-name { font-size: 1.3rem; }
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .works-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 480px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .course-grid { grid-template-columns: 1fr; }
}

/* ===== TOAST ===== */
.hp-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hp-toast i { font-size: 1.1rem; }
.hp-toast.success i { color: var(--accent); }
.hp-toast.error i { color: #ff4757; }
.hp-toast.warn i { color: var(--orange); }

/* Disabled message */
.msg-disabled {
  text-align: center;
  padding: 30px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.msg-disabled i { font-size: 1.5rem; margin-bottom: 8px; display: block; color: #444; }
