@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

/* 视频网格 - 保持原有布局逻辑，仅调整整体容器宽度 */
.video-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    align-items: start; 
    max-width: 1200px; /* 限制网格最大宽度 */
    margin: 0 auto;    /* 居中显示 */
}
.four-col-grid { grid-template-columns: repeat(4, 1fr); }
.three-col-grid { grid-template-columns: repeat(3, 1fr); }
.three-one-col-grid { grid-template-columns: repeat(3, 1fr) 1.4fr; }
.one-three-col-grid { grid-template-columns: 0.4fr repeat(3, 1fr); }
.two-col-grid { grid-template-columns: 2.4fr 1fr; }

.video-item video { 
    width: 100%; 
    height: auto; 
    border-radius: 10px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    background: #000; 
}
.video-item img { 
    width: 100%; 
    height: auto; 
    border-radius: 10px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    background: #000; 
}
.image-item img { width: 100%; height: auto; }
.image-item { align-self: center; transform: translateY(-25px); }

.video-caption {
    text-align: center;
    margin-top: 6px;     
    margin-bottom: 6px;  
    font-size: 0.95rem;
    color: #555;
}

/* 响应式网格调整 */
@media (max-width: 1024px) { 
    .video-grid { 
        grid-template-columns: repeat(2, 1fr); 
        max-width: 900px; /* 平板端缩小最大宽度 */
    } 
}
@media (max-width: 600px)  { 
    .video-grid { 
        grid-template-columns: 1fr; 
        max-width: 100%; /* 移动端占满可用宽度 */
    } 
}

/* Requested size and styling changes */
.header-text { font-size: calc(2rem * 1.2); }
.author-block { font-size: 24px; }
/*.tldr-section { font-size: calc(16px * 1.5); }*/
.text-container p, .instruction { font-size: 1.0rem; }
.text-container-small p, .instruction { font-size: 0.8rem; }
.video-caption { font-size: 1.2rem; }

/* Instruction callout (bold, yellow) */
.instruction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 20px;
  padding: 12px 14px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-left: 6px solid #d39e00;
  border-radius: 10px;
  color: #3a2e00;
  font-weight: 700;
  line-height: 1.55;
  max-width: 1200px; /* 限制提示框宽度 */
  margin-left: auto; /* 居中 */
  margin-right: auto;
}
.instruction .instruction-label {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ffe08a;
  color: #5a4100;
  letter-spacing: 0.2px;
  margin-right: 6px;
}

/* Task callout (bold, dark green) */
.task-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #2e7d32;         /* dark green */
  border: 1px solid #2e7d32;
  border-left: 6px solid #1b5e20;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 30px;              /* you can tweak to 28–32px */
  line-height: 1.25;
  max-width: 1200px; /* 限制任务框宽度 */
  margin-left: auto; /* 居中 */
  margin-right: auto;
}
.task-callout .task-badge {
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.18); /* subtle contrast pill */
  color: #ffffff;
  letter-spacing: 0.3px;
}

/* General Body Styles */
body {
    font-family: "Arial Rounded MT Bold", sans-serif;
    font-weight: 300;
    font-size: 16px;
    margin: 0 auto;
    max-width: 1280px; /* 核心修改：限制页面最大宽度，不再铺满屏 */
    padding: 20px;     /* 增加页面内边距，留出留白 */
    color: #666;
    background-color: #f8f9fa; /* 增加页面背景色，区分内容区和空白区 */
}

h1 {
    color: #000;
    font-size: 40px;
    max-width: 1200px; /* 限制标题宽度 */
    margin-left: auto;
    margin-right: auto;
}

h2 {
    color: #444;
    font-size: 35px;
    max-width: 1200px; /* 限制标题宽度 */
    margin-left: auto;
    margin-right: auto;
}

h3 {
    color: #444;
    font-size: 30px;
    font-family: 'Arial Rounded MT Bold', sans-serif;
    max-width: 1200px; /* 限制标题宽度 */
    margin-left: auto;
    margin-right: auto;
}

h1, h2, h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

p {
    margin-bottom: 0.75rem;
    max-width: 1200px; /* 限制段落文本宽度，提升阅读体验 */
    margin-left: auto;
    margin-right: auto;
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    max-width: 1200px; /* 限制分割线宽度 */
    margin-left: auto;
    margin-right: auto;
}

.disclaimerbox {
    background-color: #eee;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 20px;
    max-width: 1200px; /* 限制声明框宽度 */
    margin-left: auto;
    margin-right: auto;
}

img.header-img, img.rounded {
    border: 1px solid #eeeeee;
    border-radius: 10px;
    max-width: 1200px; /* 限制图片宽度 */
    margin-left: auto;
    margin-right: auto;
    display: block; /* 确保居中 */
}

a:link,
a:visited {
    color: #1367a7;
    text-decoration: none;
}

a:hover {
    color: #208799;
}

.paper-btn {
    position: relative;
    text-align: center;
    display: inline-block;
    margin: 8px;
    padding: 8px 8px;
    border-width: 0;
    outline: none;
    border-radius: 2px;
    color: #3b66a7 !important;
    font-size: 20px;
    width: 100px;
    font-weight: 600;
}

.paper-btn:hover {
    opacity: 0.85;
}

.paper-btn-parent {
    display: flex;
    justify-content: center;
    margin: 16px 0px;
    max-width: 1200px; /* 限制按钮容器宽度 */
    margin-left: auto;
    margin-right: auto;
}

/* Layout Container */
.container {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1280px; /* 调整容器最大宽度 */
}

/* Header Text */
.header-text {
    display: inline-block;
    max-width: 1200px; /* 限制头部文本宽度 */
    padding: 0 1rem;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: #000;
    word-wrap: break-word;
    margin-left: auto;
    margin-right: auto;
}

/* Navbar Heading */
.navbar-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Adds space between title and button */
    padding: 10px;
    background-color: #d6e2f6;
    font-size: 2rem;
    text-align: center;
    color: #000;
    max-width: 1280px; /* 限制导航栏宽度 */
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px; /* 增加圆角，提升视觉效果 */
}

.navbar-heading-demo {
  display: flex;
  flex-direction: column;    
  align-items: center;        
  justify-content: center;
  gap: 15 px;                   
  padding: 10px 10px;         
  background-color: #d6e2f6;
  text-align: center;
  color: #000;
  max-width: 1280px; /* 限制演示导航栏宽度 */
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px; /* 增加圆角 */
}

/* Demo + 按鈕那一行保持原本水平置中 */
.title-row {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 1200px; /* 限制标题行宽度 */
  margin-left: auto;
  margin-right: auto;
}

.subtitle-hint {
  margin: 0;
  font-size: 20px;           
  color: #c90f0f;           
  line-height: 1.4;
}

/* Docs Section */
.docs-section {
    margin: 2.5rem auto;
    padding: 1rem;
    max-width: 1200px; /* 限制文档区域宽度 */
    background-color: #f9f9f9;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: justify;
}

/* Text Container for Problem Statement, Overview */
.text-container {
    padding: 0 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    text-align: justify;
    max-width: 1200px; /* 限制文本容器宽度 */
    margin-left: auto;
    margin-right: auto;
}

/* Constrain Teaser Image Width */
#overview-image {
    display: block;
    margin: 0 auto;
    max-width: 1200px; /* 限制概览图片宽度 */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Image Container */
.image-container {
    margin: 2rem auto;
    max-width: 1200px; /* 限制图片容器宽度 */
}

.image-container img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* 限制轮播图宽度 */
    margin: auto;
}

.carousel-images {
    display: flex;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.carousel-image {
    display: none;
    width: 95%;
    object-fit: contain;
}

.carousel-image.active {
    display: block;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    padding: 10px;
    background: none;
    color: black;
    font-size: 3rem;
    border: none;
    cursor: pointer;
    transform: translateY(-100%);
    transition: color 0.3s, transform 0.2s;
}

.carousel-arrow:hover {
    color: #208799;
    transform: translateY(-100%) scale(1.1);
}

.left-arrow {
    left: -10px;
}

.right-arrow {
    right: -10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.carousel-dot {
    width: 15px;
    height: 15px;
    margin: 0 5px;
    border-radius: 50%;
    background-color: gray;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background-color: black;
}

/* Author Block */
.author-block {
    font-family: 'Times New Roman', serif;
    font-size: 20px;
    max-width: 1200px; /* 限制作者信息宽度 */
    margin-left: auto;
    margin-right: auto;
}

/* TL;DR Section */
.tldr-section {
    font-size: 24px;
    font-weight: bold;
    color: #444;
    max-width: 1200px; /* 限制TLDR区域宽度 */
    margin-left: auto;
    margin-right: auto;
}

/* Instruction callout (重复定义，保留修改后的版本) */
.instruction {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 20px;
  padding: 12px 14px;
  background: #fff8e1;
  border: 1px solid #ffe0b2;
  border-left: 6px solid #f4b400;
  border-radius: 10px;
  color: #333;
  line-height: 1.55;
  font-size: 2rem;
  max-width: 1200px; /* 限制提示框宽度 */
  margin-left: auto;
  margin-right: auto;
}

.instruction .material-icons {
  font-size: 28px;
  line-height: 1;
  color: #b98500;
  flex: 0 0 auto;
  margin-top: 2px;
}

.instruction .instruction-label {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ffe082;
  color: #5a4100;
  letter-spacing: 0.2px;
  margin-right: 6px;
}

.task-label { font-weight: 700; }

/* Responsive Design */

/* Medium Screens (Tablets) */
@media screen and (max-width: 768px) {
    body {
        font-size: 1rem;
        max-width: 95%; /* 平板端放宽页面宽度限制 */
        padding: 15px;
    }

    h2 {
        font-size: 28px; /* 修正：原0.9rem过小，改为固定值更合理 */
    }

    h3 {
        font-size: 24px; /* 修正：原0.8rem过小 */
    }

    .header-text {
        font-size: 1.2rem;
        max-width: 95%;
    }

    .navbar-heading {
        font-size: 1.1rem;
        max-width: 95%;
    }

    .navbar-heading-demo {
        font-size: 1.1rem;
        max-width: 95%;
    }

    .docs-section {
        padding: 1rem;
        max-width: 95%;
    }

    .text-container {
        padding: 0.5rem;
        font-size: 1rem;
        max-width: 95%;
    }

    .carousel-arrow {
        font-size: 1.7rem;
    }

    .left-arrow {
        left: -20px;
    }
    
    .right-arrow {
        right: -20px;
    }

    .carousel-dot {
        width: 12px;
        height: 12px;
    }

    .image-container {
        margin: 0.7rem auto;
        max-width: 95%;
    }

    .author-block {
        font-size: 18px;
        max-width: 95%;
    }
    
    .tldr-section {
        font-size: 15px;
        max-width: 95%;
    }

    /* 平板端统一调整所有容器宽度 */
    .video-grid, .instruction, .task-callout, h1, h2, h3, p, hr, 
    .disclaimerbox, .paper-btn-parent, .title-row, #overview-image,
    .carousel-container {
        max-width: 95%;
    }
}

/* Small Screens (Mobile) */
@media screen and (max-width: 480px) {
    body {
        font-size: 1rem;
        max-width: 100%; /* 移动端占满屏幕宽度 */
        padding: 10px;
    }

    h2 {
        font-size: 24px; /* 修正：原0.9rem过小 */
    }

    h3 {
        font-size: 20px; /* 修正：原0.8rem过小 */
    }

    .header-text {
        font-size: 1rem;
        max-width: 100%;
    }

    .navbar-heading {
        font-size: 1.4rem;
        max-width: 100%;
    }

    .navbar-heading-demo {
        font-size: 1.4rem;
        max-width: 100%;
    }

    .docs-section {
        padding: 1rem;
        max-width: 100%;
    }

    .text-container {
        font-size: 1rem;
        max-width: 100%;
    }

    .carousel-arrow {
        font-size: 1.5rem;
    }

    .left-arrow {
        left: -25px;
    }
    
    .right-arrow {
        right: -25px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .image-container {
        margin: 0.5rem auto;
        max-width: 100%;
    }

    .author-block {
        font-size: 16px;
        max-width: 100%;
    }
    
    .tldr-section {
        font-size: 14px;
        max-width: 100%;
    }

    /* 移动端统一调整所有容器宽度 */
    .video-grid, .instruction, .task-callout, h1, h2, h3, p, hr, 
    .disclaimerbox, .paper-btn-parent, .title-row, #overview-image,
    .carousel-container {
        max-width: 100%;
    }
}

.play-all-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px; /* Circle size */
  height: 44px; /* Circle size */
  padding: 0;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.play-all-btn:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

.play-all-btn img {
  width: 24px; /* Icon size */
  height: 24px; /* Icon size */
  display: block;
}