/* ========================================
       CSS Variables
       ======================================== */
    :root {
      --color-aws-dark: #232F3E;
      --color-aws-orange: #dc7600;
      --color-aws-orange-original: #FF9900;
      --color-text-primary: #374151;
      --color-text-secondary: #6B7280;
      --color-text-white: #FFFFFF;
      --color-bg-light: #F9FAFB;
      --color-bg-white: #FFFFFF;
      --color-border-light: #E5E7EB;
      --color-success: #10B981;
      --color-warning: #F59E0B;
      --color-error: #EF4444;
      --color-info: #3B82F6;
      --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
      --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
      --radius-md: 8px;
      --radius-lg: 15px;
      --radius-xl: 20px;
      --transition-base: 0.3s ease;
      --header-height: 60px;
      --container-max-width: 1200px;
    }

    /* ========================================
       Reset & Base
       ======================================== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
      font-size: 20px;
      line-height: 1.8;
      color: var(--color-text-primary);
      background-color: var(--color-bg-light);
    }

    /* ========================================
       Progress Bar & Header
       ======================================== */
    .progress-bar {
      position: fixed;
      top: 0;
      left: 0;
      width: 0%;
      height: 4px;
      background: linear-gradient(90deg, var(--color-aws-orange-original), var(--color-aws-orange));
      z-index: 1001;
      transition: width 0.1s linear;
    }

    .site-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--header-height);
      background: linear-gradient(135deg, var(--color-aws-dark), #374151);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      box-shadow: var(--shadow-md);
    }

    .site-header h1 {
      color: var(--color-text-white);
      font-size: 22px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .site-header h1 span {
      color: var(--color-aws-orange-original);
    }

    /* ========================================
       Navigation
       ======================================== */
    .toc-nav {
      position: fixed;
      top: var(--header-height);
      left: 0;
      right: 0;
      background: var(--color-bg-white);
      border-bottom: 1px solid var(--color-border-light);
      z-index: 999;
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
    }

    .toc-nav ul {
      list-style: none;
      display: flex;
      gap: 0;
      max-width: var(--container-max-width);
      margin: 0 auto;
      padding: 0 20px;
    }

    .toc-nav a {
      display: block;
      padding: 12px 18px;
      font-size: 14px;
      font-weight: 600;
      color: var(--color-text-secondary);
      text-decoration: none;
      border-bottom: 3px solid transparent;
      transition: var(--transition-base);
    }

    .toc-nav a:hover,
    .toc-nav a.active {
      color: var(--color-aws-orange);
      border-bottom-color: var(--color-aws-orange);
    }

    /* ========================================
       Main Content
       ======================================== */
    main {
      max-width: var(--container-max-width);
      margin: 0 auto;
      padding: 140px 20px 60px;
    }

    section {
      margin-bottom: 60px;
    }

    /* ========================================
       Hero Section
       ======================================== */
    .hero {
      background: linear-gradient(135deg, #232F3E 0%, #374151 60%, #4B5563 100%);
      border-radius: var(--radius-xl);
      padding: 50px 40px;
      color: var(--color-text-white);
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
    }

    .hero::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -20%;
      width: 500px;
      height: 500px;
      background: radial-gradient(circle, rgba(255,153,0,0.15), transparent 70%);
      pointer-events: none;
    }

    .hero-badge {
      display: inline-block;
      background: rgba(255,153,0,0.2);
      border: 1px solid rgba(255,153,0,0.4);
      color: var(--color-aws-orange-original);
      font-size: 14px;
      font-weight: 700;
      padding: 6px 16px;
      border-radius: 30px;
      margin-bottom: 20px;
    }

    .hero h2 {
      font-size: 32px;
      font-weight: 800;
      margin-bottom: 16px;
      line-height: 1.3;
    }

    .hero p {
      font-size: 20px;
      opacity: 0.9;
      max-width: 800px;
      line-height: 1.7;
    }

    /* ========================================
       Key Takeaways
       ======================================== */
    .takeaways {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
      margin-top: 30px;
    }

    .takeaway-card {
      background: rgba(255,255,255,0.1);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: var(--radius-lg);
      padding: 20px 24px;
      backdrop-filter: blur(10px);
    }

    .takeaway-card .takeaway-num {
      display: inline-block;
      background: var(--color-aws-orange-original);
      color: var(--color-aws-dark);
      font-size: 14px;
      font-weight: 800;
      width: 30px;
      height: 30px;
      line-height: 30px;
      text-align: center;
      border-radius: 50%;
      margin-bottom: 10px;
    }

    .takeaway-card h3 {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 6px;
    }

    .takeaway-card p {
      font-size: 16px;
      opacity: 0.85;
      line-height: 1.6;
    }

    /* ========================================
       Section Headers
       ======================================== */
    .section-header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 30px;
    }

    .section-icon {
      width: 52px;
      height: 52px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      flex-shrink: 0;
    }

    .section-header h2 {
      font-size: 28px;
      font-weight: 800;
      color: var(--color-aws-dark);
    }

    .section-header p {
      font-size: 16px;
      color: var(--color-text-secondary);
      margin-top: 4px;
    }

    /* ========================================
       Analogy Section
       ======================================== */
    .analogy-banner {
      background: linear-gradient(135deg, #FFF7ED, #FFFBEB);
      border: 2px solid #FDBA74;
      border-radius: var(--radius-xl);
      padding: 36px 40px;
      margin-bottom: 30px;
    }

    .analogy-banner h3 {
      font-size: 24px;
      font-weight: 800;
      color: #92400E;
      margin-bottom: 12px;
    }

    .analogy-banner p {
      font-size: 20px;
      color: #78350F;
      line-height: 1.8;
    }

    .analogy-table {
      width: 100%;
      border-collapse: collapse;
      background: var(--color-bg-white);
      border-radius: var(--radius-lg);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .analogy-table th {
      background: var(--color-aws-dark);
      color: var(--color-text-white);
      font-size: 16px;
      font-weight: 700;
      padding: 16px 20px;
      text-align: left;
    }

    .analogy-table td {
      padding: 16px 20px;
      font-size: 18px;
      border-bottom: 1px solid var(--color-border-light);
      vertical-align: top;
    }

    .analogy-table tr:nth-child(even) td {
      background: var(--color-bg-light);
    }

    .analogy-table .emoji-col {
      font-size: 24px;
      text-align: center;
      width: 60px;
    }

    /* ========================================
       Feature Cards (均等グリッド)
       ======================================== */
    .card-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 24px;
    }

    .card-grid-3 {
      grid-template-columns: repeat(3, 1fr);
    }

    .feature-card {
      background: var(--color-bg-white);
      border-radius: var(--radius-lg);
      padding: 28px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--color-border-light);
      transition: var(--transition-base);
    }

    .feature-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }

    .feature-card .card-icon {
      font-size: 32px;
      margin-bottom: 14px;
    }

    .feature-card h3 {
      font-size: 20px;
      font-weight: 700;
      color: var(--color-aws-dark);
      margin-bottom: 10px;
    }

    .feature-card p {
      font-size: 18px;
      color: var(--color-text-secondary);
      line-height: 1.7;
    }

    /* ========================================
       Comparison Table
       ======================================== */
    .comparison-wrapper {
      background: var(--color-bg-white);
      border-radius: var(--radius-xl);
      overflow: hidden;
      box-shadow: var(--shadow-md);
    }

    .comparison-table {
      width: 100%;
      border-collapse: collapse;
    }

    .comparison-table thead th {
      background: var(--color-aws-dark);
      color: var(--color-text-white);
      font-size: 16px;
      font-weight: 700;
      padding: 18px 20px;
      text-align: center;
    }

    .comparison-table thead th:first-child {
      text-align: left;
    }

    .comparison-table td {
      padding: 16px 20px;
      font-size: 18px;
      border-bottom: 1px solid var(--color-border-light);
      text-align: center;
    }

    .comparison-table td:first-child {
      text-align: left;
      font-weight: 600;
      color: var(--color-aws-dark);
    }

    .comparison-table tr:nth-child(even) td {
      background: var(--color-bg-light);
    }

    .badge-yes {
      display: inline-block;
      background: #ECFDF5;
      color: #065F46;
      font-size: 14px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 20px;
    }

    .badge-no {
      display: inline-block;
      background: #FEF2F2;
      color: #991B1B;
      font-size: 14px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 20px;
    }

    .badge-neutral {
      display: inline-block;
      background: #EEF2FF;
      color: #3730A3;
      font-size: 14px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 20px;
    }

    /* ========================================
       SVG Diagrams
       ======================================== */
    .diagram-container {
      background: var(--color-bg-white);
      border-radius: var(--radius-xl);
      padding: 30px;
      box-shadow: var(--shadow-md);
      margin: 30px 0;
      overflow-x: auto;
    }

    .diagram-container svg {
      display: block;
      margin: 0 auto;
      max-width: 100%;
      height: auto;
    }

    /* ========================================
       Code Tabs
       ======================================== */
    .code-section {
      background: var(--color-bg-white);
      border-radius: var(--radius-xl);
      overflow: hidden;
      box-shadow: var(--shadow-md);
    }

    .code-tabs {
      display: flex;
      background: #1E293B;
      gap: 0;
    }

    .code-tab {
      padding: 14px 24px;
      font-size: 14px;
      font-weight: 600;
      color: #94A3B8;
      cursor: pointer;
      border: none;
      background: transparent;
      border-bottom: 3px solid transparent;
      transition: var(--transition-base);
    }

    .code-tab:hover { color: #E2E8F0; }

    .code-tab.active {
      color: var(--color-aws-orange-original);
      border-bottom-color: var(--color-aws-orange-original);
    }

    .code-panel {
      display: none;
      padding: 0;
    }

    .code-panel.active { display: block; }

    .code-panel pre {
      background: #0F172A;
      color: #E2E8F0;
      padding: 24px 28px;
      font-size: 15px;
      font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
      line-height: 1.7;
      overflow-x: auto;
      margin: 0;
    }

    .code-panel pre .comment { color: #64748B; }
    .code-panel pre .keyword { color: #818CF8; }
    .code-panel pre .string { color: #34D399; }
    .code-panel pre .param { color: #F59E0B; }

    /* ========================================
       Best Practices / Anti-patterns
       ======================================== */
    .practice-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 24px;
    }

    .practice-col h3 {
      font-size: 22px;
      font-weight: 700;
      margin-bottom: 16px;
      padding: 12px 20px;
      border-radius: var(--radius-md);
    }

    .practice-col.good h3 {
      background: #ECFDF5;
      color: #065F46;
    }

    .practice-col.bad h3 {
      background: #FEF2F2;
      color: #991B1B;
    }

    .practice-item {
      background: var(--color-bg-white);
      border-radius: var(--radius-md);
      padding: 18px 20px;
      margin-bottom: 12px;
      box-shadow: var(--shadow-sm);
      border-left: 4px solid;
      font-size: 18px;
      line-height: 1.6;
    }

    .practice-col.good .practice-item { border-color: var(--color-success); }
    .practice-col.bad .practice-item { border-color: var(--color-error); }

    /* ========================================
       Troubleshooting
       ======================================== */
    .trouble-card {
      background: var(--color-bg-white);
      border-radius: var(--radius-lg);
      padding: 24px 28px;
      margin-bottom: 16px;
      box-shadow: var(--shadow-sm);
      border-left: 5px solid var(--color-warning);
    }

    .trouble-card h3 {
      font-size: 20px;
      font-weight: 700;
      color: var(--color-aws-dark);
      margin-bottom: 8px;
    }

    .trouble-card .cause {
      font-size: 18px;
      color: var(--color-text-secondary);
      margin-bottom: 6px;
    }

    .trouble-card .fix {
      font-size: 18px;
      color: var(--color-success);
      font-weight: 600;
    }

    /* ========================================
       Exam Tips
       ======================================== */
    .exam-box {
      background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
      border: 2px solid #818CF8;
      border-radius: var(--radius-xl);
      padding: 32px 36px;
    }

    .exam-box h3 {
      font-size: 22px;
      font-weight: 800;
      color: #3730A3;
      margin-bottom: 16px;
    }

    .exam-tip {
      background: var(--color-bg-white);
      border-radius: var(--radius-md);
      padding: 16px 20px;
      margin-bottom: 12px;
      font-size: 18px;
      line-height: 1.7;
      border-left: 4px solid #818CF8;
    }

    .exam-tip strong {
      color: #4338CA;
    }

    /* ========================================
       FAQ Accordion
       ======================================== */
    .faq-item {
      background: var(--color-bg-white);
      border-radius: var(--radius-md);
      margin-bottom: 12px;
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }

    .faq-question {
      width: 100%;
      padding: 20px 24px;
      font-size: 20px;
      font-weight: 600;
      color: var(--color-aws-dark);
      background: transparent;
      border: none;
      text-align: left;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: var(--transition-base);
    }

    .faq-question:hover { background: var(--color-bg-light); }

    .faq-question .toggle-icon {
      font-size: 24px;
      transition: transform var(--transition-base);
      flex-shrink: 0;
      margin-left: 16px;
    }

    .faq-item.open .faq-question .toggle-icon {
      transform: rotate(45deg);
    }

    .faq-answer {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.4s ease;
    }

    .faq-answer-inner {
      padding: 0 24px 20px;
      font-size: 18px;
      color: var(--color-text-secondary);
      line-height: 1.8;
    }

    /* ========================================
       Cheat Sheet
       ======================================== */
    .cheatsheet {
      background: var(--color-aws-dark);
      border-radius: var(--radius-xl);
      padding: 36px 40px;
      color: var(--color-text-white);
    }

    .cheatsheet h3 {
      font-size: 24px;
      font-weight: 800;
      color: var(--color-aws-orange-original);
      margin-bottom: 20px;
    }

    .cheat-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }

    .cheat-item {
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: var(--radius-md);
      padding: 16px 20px;
    }

    .cheat-item dt {
      font-size: 14px;
      font-weight: 600;
      color: var(--color-aws-orange-original);
      margin-bottom: 6px;
    }

    .cheat-item dd {
      font-size: 18px;
      color: #E2E8F0;
      line-height: 1.6;
    }

    /* ========================================
       Scroll to Top
       ======================================== */
    .scroll-top {
      position: fixed;
      bottom: 30px;
      right: 30px;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: var(--color-aws-orange);
      color: var(--color-text-white);
      border: none;
      font-size: 24px;
      cursor: pointer;
      box-shadow: var(--shadow-md);
      opacity: 0;
      transform: translateY(20px);
      transition: var(--transition-base);
      z-index: 900;
    }

    .scroll-top.visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* ========================================
       Responsive
       ======================================== */
    @media (max-width: 768px) {
      body { font-size: 18px; }
      .hero { padding: 30px 24px; }
      .hero h2 { font-size: 24px; }
      .takeaways { grid-template-columns: 1fr; }
      .card-grid, .card-grid-3, .practice-grid, .cheat-grid { grid-template-columns: 1fr; }
      .toc-nav a { padding: 10px 14px; font-size: 13px; }
      main { padding: 130px 16px 40px; }
      .section-header h2 { font-size: 22px; }
    }