/* === Reset & Base === */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:80px}
body{
  font-family:'Noto Sans JP',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:#f5f5f7;color:#1d1d1f;line-height:1.8;font-size:16px;
}
a{color:#0071e3;text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto}

/* === Header === */
.site-header{
  background:#fff;border-bottom:1px solid #d2d2d7;
  position:sticky;top:0;z-index:200;
}
.header-inner{
  max-width:1200px;margin:0 auto;padding:14px 24px;
  display:flex;justify-content:space-between;align-items:center;
}
.logo a{font-size:20px;font-weight:700;color:#1d1d1f;text-decoration:none}
.logo a span{color:#0071e3}
.header-nav{display:flex;gap:20px}
.header-nav a{color:#6e6e73;font-size:14px;font-weight:500}
.header-nav a:hover{color:#0071e3;text-decoration:none}

/* === Course Hero === */
.course-hero{
  background:linear-gradient(135deg,#0071e3 0%,#00b4d8 100%);
  color:#fff;padding:48px 24px;
}
.course-hero-inner{max-width:1200px;margin:0 auto}
.course-hero .category-badge{
  display:inline-block;background:rgba(255,255,255,.2);
  padding:4px 14px;border-radius:20px;font-size:13px;font-weight:500;
  margin-bottom:12px;
}
.course-hero h1{font-size:32px;line-height:1.3;margin-bottom:12px}
.course-hero .hero-desc{font-size:16px;opacity:.9;max-width:700px;margin-bottom:16px}
.course-hero .hero-stats{font-size:14px;opacity:.85}
.course-hero .hero-stats span+span{margin-left:20px}

/* === Layout === */
.course-layout{
  max-width:1200px;margin:0 auto;padding:32px 24px;
  display:flex;gap:32px;align-items:flex-start;
}

/* === Sidebar === */
.sidebar{
  width:280px;min-width:280px;
  background:#fff;border-radius:12px;border:1px solid #d2d2d7;
  padding:20px;position:sticky;top:80px;
  max-height:calc(100vh - 100px);overflow-y:auto;
  font-size:14px;
}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:#d2d2d7;border-radius:4px}
.sidebar-module{
  font-size:13px;font-weight:700;color:#6e6e73;
  letter-spacing:.3px;
  padding:12px 0 6px;border-top:1px solid #f0f0f0;
}
.sidebar-module:first-child{border-top:none;padding-top:0}
.sidebar-lectures{list-style:none}
.sidebar-lectures li a{
  display:flex;align-items:baseline;gap:6px;
  padding:6px 8px;border-radius:6px;color:#1d1d1f;font-size:14px;
  transition:background .15s;
}
.sidebar-lectures li a:hover{background:#f5f5f7;text-decoration:none}
.sidebar-lectures li a .lec-num{color:#6e6e73;font-size:13px;min-width:22px}
.sidebar-lectures li a .dur{
  margin-left:auto;color:#6e6e73;font-size:12px;white-space:nowrap;
}

/* === Main Content === */
.main-content{flex:1;min-width:0}
.lecture-section{
  background:#fff;border-radius:12px;border:1px solid #d2d2d7;
  padding:32px;margin-bottom:24px;
}
.lecture-section h2{
  font-size:24px;line-height:1.4;margin-bottom:8px;
  padding-bottom:12px;border-bottom:2px solid #f0f0f0;
}
.lecture-number{
  display:inline-block;background:#0071e3;color:#fff;
  font-size:12px;font-weight:700;padding:2px 10px;border-radius:12px;
  margin-right:10px;vertical-align:middle;
}
.lecture-duration{
  display:flex;align-items:center;gap:4px;
  color:#6e6e73;font-size:14px;margin-bottom:20px;
}
.lecture-duration svg{flex-shrink:0}

/* === Video Player === */
.video-container{margin-bottom:24px}
.video-container video{
  width:100%;border-radius:8px;background:#000;
  display:block;
}

/* === Lecture Body Typography === */
.lecture-body h1{font-size:26px;margin:28px 0 12px;color:#1d1d1f}
.lecture-body h2{font-size:22px;margin:24px 0 10px;color:#1d1d1f}
.lecture-body h3{font-size:18px;margin:20px 0 8px;color:#1d1d1f}
.lecture-body h4{font-size:16px;margin:16px 0 6px;color:#1d1d1f}
.lecture-body p{margin:10px 0}
.lecture-body ul,.lecture-body ol{margin:10px 0 10px 24px}
.lecture-body li{margin:4px 0}
.lecture-body blockquote{
  border-left:4px solid #0071e3;padding:8px 16px;margin:12px 0;
  background:#f5f5f7;color:#424245;border-radius:0 8px 8px 0;
}
.lecture-body strong{color:#1d1d1f}

/* Code blocks (Pygments inline styles via codehilite) */
.lecture-body .codehilite{
  border-radius:8px;padding:16px;margin:12px 0;
  overflow-x:auto;font-size:14px;line-height:1.6;
}
.lecture-body code{
  font-family:'SF Mono',SFMono-Regular,Consolas,'Liberation Mono',Menlo,monospace;
  font-size:0.9em;
}
.lecture-body p code,.lecture-body li code,.lecture-body td code{
  background:#f0f0f3;padding:2px 6px;border-radius:4px;
  color:#e8364e;font-size:0.88em;
}
.lecture-body pre{margin:12px 0;border-radius:8px;overflow-x:auto}
.lecture-body pre code{background:transparent;padding:0;color:inherit;font-size:14px}

/* Tables */
.lecture-body table{
  width:100%;border-collapse:collapse;margin:16px 0;font-size:14px;
}
.lecture-body th,.lecture-body td{
  border:1px solid #d2d2d7;padding:10px 14px;text-align:left;
}
.lecture-body th{background:#f5f5f7;font-weight:700;color:#1d1d1f}
.lecture-body tr:nth-child(even) td{background:#fafafa}

/* Horizontal rule */
.lecture-body hr{border:none;border-top:1px solid #d2d2d7;margin:24px 0}

/* === Footer === */
.site-footer{
  background:#1d1d1f;color:rgba(255,255,255,.7);
  padding:32px 24px;text-align:center;margin-top:16px;font-size:14px;
}
.site-footer a{color:rgba(255,255,255,.9)}
.site-footer a:hover{color:#fff}

/* === Mobile Module Tabs === */
.mobile-tabs{
  display:none;
  background:#fff;border-bottom:1px solid #d2d2d7;
  overflow-x:auto;white-space:nowrap;padding:8px 16px;
  -webkit-overflow-scrolling:touch;
}
.mobile-tabs::-webkit-scrollbar{display:none}
.mobile-tab{
  display:inline-block;padding:6px 14px;border-radius:20px;
  font-size:13px;font-weight:500;color:#6e6e73;
  background:#f5f5f7;margin-right:8px;cursor:pointer;
  border:1px solid transparent;transition:all .15s;
}
.mobile-tab:hover,.mobile-tab.active{
  color:#0071e3;border-color:#0071e3;background:#e8f4fd;
}

/* === Back to Top === */
.back-to-top{
  position:fixed;bottom:24px;right:24px;
  width:44px;height:44px;border-radius:50%;
  background:#0071e3;color:#fff;border:none;cursor:pointer;
  font-size:20px;box-shadow:0 4px 12px rgba(0,0,0,.2);
  opacity:0;pointer-events:none;transition:opacity .3s;
  display:flex;align-items:center;justify-content:center;
  z-index:100;
}
.back-to-top.visible{opacity:1;pointer-events:auto}

/* === Responsive === */
@media(max-width:900px){
  .course-hero h1{font-size:24px}
  .course-layout{flex-direction:column;padding:16px}
  .sidebar{display:none}
  .mobile-tabs{display:block}
  .lecture-section{padding:20px;margin-bottom:16px}
  .lecture-section h2{font-size:20px}
}
@media(max-width:480px){
  .course-hero{padding:32px 16px}
  .course-hero h1{font-size:20px}
  .lecture-section{padding:16px;border-radius:8px}
  .lecture-body .codehilite{font-size:13px;padding:12px}
}

/* === Breadcrumb === */
.breadcrumb{
  background:#f5f5f7;border-bottom:1px solid #e0e0e0;
  padding:8px 0;font-size:13px;
}
.breadcrumb ol{
  list-style:none;display:flex;flex-wrap:wrap;gap:0;
  max-width:1200px;margin:0 auto;padding:0 24px;
}
.breadcrumb li{display:flex;align-items:center;color:#6e6e73}
.breadcrumb li+li::before{content:"›";margin:0 8px;color:#b0b0b8}
.breadcrumb a{color:#0071e3;text-decoration:none}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb li[aria-current]{color:#1d1d1f;font-weight:500}
@media(max-width:480px){
  .breadcrumb li[aria-current]{
    max-width:180px;overflow:hidden;
    text-overflow:ellipsis;white-space:nowrap;
  }
}

/* === Rating Widget === */
.rating-widget{
  margin-top:20px;padding:20px;
  background:#f5f5f7;border-radius:10px;
  border:1px solid #e0e0e0;display:none;
}
.rating-widget.visible{display:block}
.rating-widget h4{font-size:15px;margin-bottom:10px;color:#1d1d1f}
.rating-stars{display:flex;gap:4px;margin-bottom:12px}
.rating-stars .star{
  font-size:28px;cursor:pointer;color:#d2d2d7;
  transition:color .15s;user-select:none;
}
.rating-stars .star:hover,.rating-stars .star.active{color:#ffd700}
.rating-comment{
  width:100%;padding:8px 12px;border:1px solid #d2d2d7;
  border-radius:8px;font-family:inherit;font-size:14px;
  resize:vertical;min-height:60px;margin-bottom:10px;
}
.rating-submit{
  padding:8px 20px;background:#0071e3;color:#fff;
  border:none;border-radius:8px;font-size:14px;
  font-weight:600;cursor:pointer;font-family:inherit;
}
.rating-submit:hover{background:#005bb5}
.rating-submit:disabled{opacity:.5;cursor:default}
.rating-thanks{color:#34c759;font-weight:600;font-size:14px;display:none}

/* === Quiz Widget === */
.quiz-widget{
  margin-top:20px;padding:24px;
  background:#f0f4ff;border-radius:10px;
  border:1px solid #c0d4ff;display:none;
}
.quiz-widget.visible{display:block}
.quiz-widget h4{font-size:16px;font-weight:700;margin-bottom:4px;color:#1d1d1f}
.quiz-progress{font-size:13px;color:#6e6e73;margin-bottom:14px}
.quiz-question-text{font-size:15px;font-weight:600;margin-bottom:12px;color:#1d1d1f;line-height:1.5}
.quiz-options-list{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
.quiz-option{
  padding:10px 14px;border:2px solid #d2d2d7;border-radius:8px;
  background:#fff;cursor:pointer;font-size:14px;text-align:left;
  transition:all .15s;font-family:inherit;line-height:1.4;
}
.quiz-option:hover:not(.disabled){border-color:#0071e3;background:#e8f4fd}
.quiz-option.correct{border-color:#34c759;background:#f0fff5;color:#1d1d1f}
.quiz-option.wrong{border-color:#ff3b30;background:#fff5f5;color:#1d1d1f}
.quiz-option.disabled{cursor:default;opacity:.9}
.quiz-explanation{
  padding:10px 14px;background:#fff;border-left:3px solid #0071e3;
  border-radius:0 8px 8px 0;font-size:13px;color:#424245;
  margin-bottom:14px;display:none;line-height:1.6;
}
.quiz-nav-btn{
  padding:8px 20px;background:#0071e3;color:#fff;
  border:none;border-radius:8px;font-size:14px;
  font-weight:600;cursor:pointer;font-family:inherit;
  display:none;margin-right:8px;
}
.quiz-nav-btn:hover{background:#005bb5}
.quiz-score-banner{
  text-align:center;padding:16px;border-radius:8px;
  font-size:16px;font-weight:700;display:none;margin-top:12px;
}
.quiz-score-banner.pass{background:#f0fff5;color:#1b7340;border:1px solid #34c759}
.quiz-score-banner.fail{background:#fff5f5;color:#cc1b1b;border:1px solid #ff3b30}
.quiz-retry-btn{
  display:inline-block;margin-top:10px;padding:6px 16px;
  background:#6e6e73;color:#fff;border:none;border-radius:8px;
  font-size:13px;cursor:pointer;font-family:inherit;
}
.quiz-retry-btn:hover{background:#424245}

/* === Learning Path === */
.learning-path-section{
  background:#fff;border-top:3px solid #0071e3;
  padding:32px 20px;
}
.lp-header{
  display:flex;align-items:center;gap:12px;
  flex-wrap:wrap;margin-bottom:20px;
}
.lp-icon{font-size:22px}
.lp-title{font-size:17px;font-weight:700;color:#1d1d1f;margin:0}
.lp-progress{
  font-size:12px;color:#6e6e73;background:#f5f5f7;
  padding:3px 10px;border-radius:12px;margin-left:auto;
}
.lp-steps-scroll{overflow-x:auto;padding-bottom:8px}
.lp-steps{
  display:flex;align-items:stretch;
  border:1px solid #d2d2d7;border-radius:10px;
  overflow:hidden;min-width:max-content;
}
.lp-steps a{text-decoration:none;display:block}
.lp-step{
  padding:14px 18px;background:#f5f5f7;
  border-right:1px solid #d2d2d7;min-width:150px;
  transition:background .15s;
}
.lp-steps>a:last-child .lp-step,.lp-step:last-child{border-right:none}
.lp-steps a:hover .lp-step{background:#e8f4fd}
.lp-step.current{background:#0071e3}
.lp-step-num{
  display:block;font-size:11px;font-weight:700;
  color:#0071e3;margin-bottom:4px;letter-spacing:.05em;
}
.lp-step.current .lp-step-num{color:rgba(255,255,255,.75)}
.lp-step-title{
  display:block;font-size:13px;font-weight:600;
  color:#1d1d1f;line-height:1.4;
}
.lp-step.current .lp-step-title{color:#fff}
.lp-badge{
  display:inline-block;margin-top:6px;
  font-size:11px;padding:2px 7px;border-radius:10px;
  background:#e8f4fd;color:#0071e3;font-weight:600;
}
.lp-badge.current{background:rgba(255,255,255,.2);color:#fff}
.lp-next-btn{
  display:inline-block;margin-top:16px;
  padding:10px 20px;background:#0071e3;color:#fff;
  border-radius:8px;font-size:14px;font-weight:600;
  text-decoration:none;transition:background .15s;
}
.lp-next-btn:hover{background:#005bb5;text-decoration:none}

/* === Speed Control === */
.speed-control{display:flex;align-items:center;gap:6px;padding:8px 0 16px;flex-wrap:wrap}
.speed-label{font-size:12px;color:#6e6e73;margin-right:2px}
.speed-btn{padding:4px 10px;border:1px solid #d2d2d7;border-radius:20px;
  background:#fff;font-size:12px;cursor:pointer;transition:all .15s;font-family:inherit}
.speed-btn.active{background:#0071e3;color:#fff;border-color:#0071e3}
.speed-btn:hover:not(.active){background:#f5f5f7}

/* === Course Reviews === */
.course-reviews-section{background:#fff;margin-top:0;border-top:1px solid #e0e0e0}
.cr-inner{max-width:1200px;margin:0 auto;padding:40px 24px}
.cr-heading{font-size:22px;font-weight:700;margin-bottom:24px;color:#1d1d1f}
.cr-summary{display:flex;gap:32px;align-items:flex-start;flex-wrap:wrap;margin-bottom:28px;
  padding-bottom:24px;border-bottom:1px solid #f0f0f0}
.cr-avg-block{text-align:center;min-width:90px}
.cr-avg-num{font-size:52px;font-weight:700;color:#1d1d1f;line-height:1}
.cr-avg-denom{font-size:18px;color:#6e6e73}
.cr-avg-label{font-size:13px;color:#6e6e73;margin-top:6px}
.cr-bars{flex:1;min-width:180px}
.cr-bar-row{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.cr-bar-label{font-size:13px;color:#1d1d1f;width:28px;text-align:right;white-space:nowrap}
.cr-bar-track{flex:1;height:8px;background:#f0f0f3;border-radius:4px;overflow:hidden}
.cr-bar-fill{height:100%;background:#ffd700;border-radius:4px;transition:width .3s}
.cr-bar-pct{font-size:12px;color:#6e6e73;width:30px}
.cr-login-cta{margin-bottom:24px}
.cr-login-btn{display:inline-block;padding:10px 24px;background:#0071e3;color:#fff;
  border-radius:8px;font-size:14px;font-weight:600;text-decoration:none}
.cr-login-btn:hover{background:#005bb5;text-decoration:none}
.cr-form{margin-bottom:28px;padding:20px;background:#f5f5f7;border-radius:10px}
.cr-form-title{font-size:15px;font-weight:700;margin-bottom:12px}
.cr-form-stars{display:flex;gap:6px;margin-bottom:12px;font-size:30px;cursor:pointer}
.cr-form-star{color:#d2d2d7;transition:color .15s;user-select:none}
.cr-form-star.active,.cr-form-star:hover{color:#ffd700}
.cr-textarea{width:100%;padding:10px 14px;border:1px solid #d2d2d7;border-radius:8px;
  font-family:inherit;font-size:14px;resize:vertical;min-height:80px;margin-bottom:12px}
.cr-submit-btn{padding:9px 22px;background:#0071e3;color:#fff;border:none;
  border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit}
.cr-submit-btn:hover{background:#005bb5}
.cr-submit-btn:disabled{opacity:.5;cursor:default}
.cr-list-section{border-top:1px solid #f0f0f0;padding-top:20px}
.cr-list-heading{font-size:15px;font-weight:700;margin-bottom:14px;color:#1d1d1f}
.cr-item{padding:14px 0;border-bottom:1px solid #f0f0f0}
.cr-item:last-child{border-bottom:none}
.cr-item-header{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.cr-item-stars{color:#ffd700;font-size:15px}
.cr-item-date{font-size:12px;color:#6e6e73}
.cr-item-text{font-size:14px;color:#424245;line-height:1.6;margin:0}
.cr-empty{color:#6e6e73;font-size:14px}

/* === Hero Wishlist === */
.hero-wishlist-btn{
  display:inline-flex;align-items:center;gap:6px;
  margin-top:14px;padding:9px 20px;
  background:rgba(255,255,255,.15);color:#fff;
  border:1.5px solid rgba(255,255,255,.5);border-radius:24px;
  font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;
  transition:all .2s;backdrop-filter:blur(4px);
}
.hero-wishlist-btn:hover{background:rgba(255,255,255,.25);border-color:#fff}
.hero-wishlist-btn.active{background:rgba(255,59,48,.8);border-color:#ff3b30}
