/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .canvas-container {
        padding: 2rem 1.5rem;
        margin: 1.5rem auto;
    }
    
    .demo-flex {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .demo-section, .demo-explain {
        min-width: unset;
        width: 100%;
    }
    
    .canvas-container h1 {
        font-size: 2rem;
    }
}

/* メディアクエリ: 768px以下の画面サイズ（タブレット） */
@media (max-width: 768px) {
  #hero-header {
    font-size: 2em;
  }

  .upheader {
    height: 300px;
    font-size: 40px;
  }

  .image-container {
    width: 45%; /* 画像の幅を調整 */
  }

  .hover-apng, .hover-apng2 {
    width: 100px; /* 表示サイズを調整 */
  }

  .works-flex {
    flex-direction: column; /* 縦並びに変更 */
    align-items: center; /* 中央揃え */
  }

  .works-programming, .works-text, .works-portfolio, .works-loadrunner, .works-dot {
    width: 100%; /* 幅を100%に設定 */
    margin-bottom: 30px; /* 下に余白を追加 */
  }

  .contents {
        padding: 30px 20px;
        margin: 10px;
    }

    .contents h1 {
        font-size: 2em;
    }

    .contents h1::before,
    .contents h1::after {
        display: none;
    }

    .contents li {
        padding: 15px 20px 15px 50px;
        font-size: 1em;
    }

     .contents li::before {
        width: 25px;
        height: 25px;
        left: 15px;
        font-size: 0.8em;
    }

    .contents li::after {
        right: 15px;
        font-size: 1.1em;
    }

    .Introduction {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .Introduction h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .Introduction p {
        font-size: 0.9rem;
    }
    
    .Introduction summary {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .Introduction code {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .Introduction button {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        margin: 0.5rem 0 0 0.5rem;
    }

    .canvas-container {
        padding: 1.5rem 1rem;
        margin: 1rem auto;
        border-radius: 15px;
    }

    canvas {
        width: 360px;
        height: 270px;
    }

     #treeCanvas {
        width: 400px;
        height: 300px;
    }
    
    .demo-section {
        padding: 1rem;
    }
    
    .demo-explain {
        padding: 1.5rem;
    }
    
    .demo-section canvas {
        max-width: 100%;
        height: auto;
    }
    
    .canvas-container h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .info {
        font-size: 1rem;
    }
    
    .demo-explain code {
        font-size: 0.8rem;
        padding: 1rem;
    }

    .time-section, .reference-content {
        padding: 2rem 1rem;
        margin: 2rem auto;
        border-radius: 15px;
    }
    
    .time-section h1, .reference-content h1 {
        font-size: 2rem;
    }
    
    .time-section p {
        font-size: 2.5rem;
    }
    
    .time-section::after, .reference-content::after {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
    
    .reference-content li {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .reference-content h3 {
        font-size: 1.2rem;
    }
    
    .reference-content p {
        font-size: 0.9rem;
    }
    
    .reference-content .reference-link {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
        margin-left: 0;
        margin-top: 0.5rem;
        display: block;
        text-align: center;
    }

}

/* メディアクエリ: 480px以下の画面サイズ（スマホ） */
@media (max-width: 480px) {
  #hero-header {
    font-size: 1.5em;
  }

  .upheader {
    height: 200px;
    font-size: 30px;
  }

   #treeCanvas {
        width: 360px;
        height: 270px;
    }

  .image-container {
    width: 100%; /* 画像の幅を調整 */
  }

  .hover-apng, .hover-apng2 {
    width: 80px; /* 表示サイズを調整 */
  }

  .works img {
    max-width: 100%; /* 画像の最大幅を100%に設定 */
    height: auto; /* 高さを自動調整 */
  }

  .works-flex {
    flex-direction: column; /* 縦並びに変更 */
    align-items: center; /* 中央揃え */
  }

  .works-programming, .works-text, .works-portfolio, .works-loadrunner, .works-dot {
    width: 100%; /* 幅を100%に設定 */
    margin-bottom: 20px; /* 下に余白を追加 */
  }

  .contents {
        padding: 20px 15px;
    }

    .contents h1 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    .contents li {
        padding: 12px 15px 12px 45px;
        margin: 15px 0;
    }

    .contents li::before {
        width: 22px;
        height: 22px;
        left: 12px;
    }

     .canvas-container {
        padding: 1rem 0.5rem;
        margin: 0.5rem auto;
    }
    
    .canvas-container::after {
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }

    canvas {
        width: 280px;
        height: 210px;
    }
    
    .demo-section, .demo-explain {
        padding: 1rem;
    }
    
    .canvas-container h1 {
        font-size: 1.5rem;
    }
    
    .demo-explain summary {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .demo-explain button {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        margin: 0.5rem 0 0 0.5rem;
    }

    .time-section, .reference-content {
        padding: 1.5rem 0.8rem;
        margin: 1.5rem auto;
    }
    
    .time-section h1, .reference-content h1 {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }
    
    .time-section p {
        font-size: 2rem;
    }
    
    .reference-content li {
        padding: 1.2rem;
    }
    
    .reference-content li::after {
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
    
    .reference-content h3 {
        font-size: 1.1rem;
        padding-left: 0.8rem;
    }
    
    .reference-content p {
        font-size: 0.85rem;
        padding-left: 0.8rem;
    }
    
    .reference-content .reference-link {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .Introduction {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .Introduction h2 {
        color: #ecf0f1;
    }
    
    .Introduction p {
        color: #bdc3c7;
    }
    
    .Introduction details {
        background: rgba(52, 73, 94, 0.7);
    }
    
    .Introduction details[open] {
        background: rgba(52, 73, 94, 0.9);
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .canvas-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .demo-section {
        background: rgba(52, 73, 94, 0.9);
        color: #ecf0f1;
    }
    
    .demo-explain {
        background: rgba(52, 73, 94, 0.95);
        color: #ecf0f1;
        border-left-color: #e74c3c;
    }
    
    .demo-explain p {
        color: #bdc3c7;
    }
    
    .demo-section canvas {
        background: linear-gradient(45deg, #34495e, #2c3e50);
    }
}

/* ダークモード対応 - 統一カラー */
@media (prefers-color-scheme: dark) {
    .time-section {
        background: linear-gradient(135deg, #c44569 0%, #ff6b9d 100%);
    }
    
    .reference-content {
        background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    }
    
    .reference-content li {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .reference-content h3 {
        color: #ecf0f1;
        border-left-color: #ff69b4;
    }
    
    .reference-content p {
        color: #bdc3c7;
    }
    
    .reference-content .reference-link {
        color: #ff69b4;
        background: rgba(255, 105, 180, 0.1);
        border-color: rgba(255, 105, 180, 0.2);
    }
    
    .reference-content .reference-link:hover {
        background: rgba(255, 105, 180, 0.2);
        border-color: rgba(255, 105, 180, 0.4);
        color: #ff1493;
    }
}   