:root{
  --bg:#0b1220;
  --panel:#0f1a30;
  --card:#111f3a;
  --text:#e8eefc;
  --muted:#a8b3cf;
  --line:rgba(255,255,255,.08);
  --accent:#7aa7ff;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:linear-gradient(180deg,var(--bg),#060b14);
  color:var(--text);
}

.main-header{
  width:100%;
  background:rgba(15,26,48,.92);
  border-bottom:1px solid var(--line);
  padding:40px 20px;
}

.header-container{
  max-width:1100px;
  margin:0 auto;
  text-align:center;
}

.header-title{
  font-size:42px;
  font-weight:900;
  letter-spacing:1px;
  margin-bottom:8px;
  color:#ffffff;
}

.header-sub{
  font-size:18px;
  font-weight:600;
  color:#c8d2ff;
  margin-bottom:22px;
}

.course-desc{
  font-family:"Times New Roman", Times, serif;
  font-size:12pt;
  font-weight:normal;
  margin:8px 0 16px 0;
  line-height:1.5;
}

.top-nav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:50px;
  flex-wrap:wrap;
}

.main-header .top-nav a{
  color:#ffffff;
  font-size:22px;
  font-weight:800;
  letter-spacing:.4px;
  text-decoration:none;
  padding:10px 14px;
  position:relative;
}

.pill-row{
    color:#c8d2ff;
    font-weight:600;
}

.main-header .top-nav a:hover{
  color:#7aa7ff;
}

.main-header .top-nav a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-5px;
  width:100%;
  height:2px;
  background:#7aa7ff;
  transform:scaleX(0);
  transition:transform .25s ease;
}

.main-header .top-nav a:hover::after,
.main-header .top-nav a.active::after{
  transform:scaleX(1);
}

.slide-card{
  background:#f8fbff;
  border:1px solid #dbeafe;
  border-radius:16px;
  padding:12px;
  text-align:center;
  max-width:220px;
  margin:20px auto;
}

.slide-card img,
.slide-image{
  width:140px !important;
  max-width:140px !important;
  height:auto !important;
  display:block;
  margin:0 auto;
  border-radius:10px;
}

.layout{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:320px;
  background:rgba(15,26,48,.9);
  border-right:1px solid var(--line);
  padding:18px;
  position:sticky;
  top:170px;
  height:calc(100vh - 170px);
  overflow:auto;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.nav-link{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  color:var(--text);
  text-decoration:none;
}

.nav-link:hover{
  border-color:var(--line);
  background:rgba(122,167,255,.08);
}

.nav-link.active{
  background:rgba(122,167,255,.22);
  border-left:4px solid #7aa7ff;
  color:#ffffff;
  font-weight:700;
  padding-left:14px;
  border-radius:10px;
  box-shadow:inset 0 0 10px rgba(122,167,255,.12);
}

.nav-link.active::before{
  content:"▶ ";
  color:#7aa7ff;
  font-weight:700;
}

.content{
  flex:1;
  padding:20px;
  max-width:1100px;
  min-width:0;
}

.project-title{
  display:block;
}

.card{
  background:rgba(17,31,58,.85);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  margin-bottom:16px;
}

.comments-section{
  margin-top:28px;
  padding:24px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.02);
}

.comments-title{
  margin:0 0 18px 0;
  font-size:20px;
}

.comment-form{
  margin:18px 0 20px 0;
}

.comment-form-row{
  display:grid;
  grid-template-columns:180px 1fr 170px;
  gap:14px;
  align-items:end;
}

.form-group{
  display:flex;
  flex-direction:column;
}

.form-group label{
  margin-bottom:6px;
  font-size:13px;
  color:var(--muted);
  font-weight:600;
}

.name-group input{
  height:46px;
}

.comment-group textarea{
  height:46px;
  min-height:46px;
  resize:none;
  padding-top:12px;
}

.button-group{
  display:flex;
  flex-direction:column;
  justify-content:end;
}

.button-group .btn{
  height:46px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  padding:0 18px;
}

input,
textarea{
  width:100%;
  background:rgba(255,255,255,.05);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}

input:focus,
textarea:focus{
  border-color:rgba(122,167,255,.45);
  box-shadow:0 0 0 2px rgba(122,167,255,.12);
}

.alert{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  margin:0 0 18px 0;
  font-size:14px;
}

.alert.success{
  border-color:rgba(244,197,66,.35);
  background:rgba(244,197,66,.08);
  color:#f4c542;
  font-weight:600;
}

.alert.error{
  border-color:rgba(255,120,120,.25);
  background:rgba(255,120,120,.10);
  color:#ffd7d7;
}

.comment-list{
  display:grid;
  gap:14px;
  margin-top:16px;
}

.comment{
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px 16px;
  background:rgba(255,255,255,.03);
}

.comment-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
  flex-wrap:wrap;
}

.comment-body{
  line-height:1.6;
}

.btn{
  display:inline-block;
  border:1px solid rgba(122,167,255,.45);
  padding:6px 14px;
  border-radius:12px;
  text-decoration:none;
  background:#f4c542 !important;
  color:#111827 !important;
  font-weight:700;
}

.primary-action{
  background:#f4c542 !important;
  color:#111827 !important;
  font-weight:700;
  padding:12px 18px;
  border-radius:10px;
  display:inline-block;
  border:none;
  text-decoration:none;
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
  transition:all 0.25s ease;
}

.primary-action:hover{
  background:#e0b437 !important;
  color:#111827 !important;
  transform:translateY(-2px);
}

.project-layout{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:24px;
  align-items:start;
}

.project-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:320px;
}

.project-link{
  display:block;
  width:100%;
  text-decoration:none;
  color:var(--text);
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:12px;
  padding:14px 16px;
  line-height:1.4;
}


/* Hover = clearer separation */
.project-link:hover{
  border-color:rgba(122,167,255,0.45);
  background:rgba(122,167,255,0.08);
  transform:translateY(-2px);
}


.project-link.active{
  border:2px solid #7aa7ff;
  background:rgba(122,167,255,0.12);
  box-shadow:0 0 12px rgba(122,167,255,0.25);
}
.project-link .tag{
  display:inline-block;
  margin-top:8px;
}

.tag{
  font-size:11px;
  color:var(--muted);
  border:1px solid var(--line);
  padding:3px 8px;
  border-radius:999px;
}

.project-view{
  min-width:0;
}

.embed-frame{
  width:100%;
  height:480px;
  border-radius:14px;
  background:#ffffff;
}

.video-wrap{
  position:relative;
  padding-top:56.25%;
}

.video-wrap iframe{
  position:absolute;
  width:100%;
  height:100%;
}

.avatar{
  width:120px;
  height:auto;
  display:block;
  margin:10px auto;
  border-radius:50%;
}

.about-photo img{
  width:120px;
  max-width:120px;
  height:auto;
}

@media (max-width:900px){
  .comment-form-row{
    grid-template-columns:1fr;
  }

  .comment-group textarea{
    height:100px;
    min-height:100px;
    resize:vertical;
  }

  .button-group .btn{
    width:100%;
  }

  .nav-link{
    padding:12px 10px;
    font-size:15px;
    line-height:1.35;
  }

  .layout{
    display:block;
  }

  .sidebar{
    width:100%;
    position:relative;
    top:auto;
    height:auto;
    max-height:none;
    overflow:visible;
    border-right:none;
    border-bottom:1px solid var(--line);
    padding:14px 12px;
    margin-bottom:14px;
  }

  .content{
    width:100%;
    max-width:none;
    min-width:0;
    padding:12px;
  }

  .card{
    margin-left:0;
    margin-right:0;
  }

  .project-layout{
    grid-template-columns:1fr;
    gap:14px;
  }

  .project-list{
    min-width:0;
  }

  .top-nav{
    gap:20px;
  }
}
.project-link{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.03);
  border-radius:14px;
  padding:16px 18px;
  line-height:1.5;
  transition:all .25s ease;
}

.project-link{
  font-weight:600;
}
