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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo UI', Meiryo, sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #e50040, #9b002b);
  color: #fff;
  padding: 16px 24px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
}

.site-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-header p {
  font-size: 0.85rem;
  margin-top: 4px;
  opacity: 0.85;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: #fce4eb;
  padding: 10px 24px;
  font-size: 0.8rem;
  color: #5f6368;
}

.breadcrumb a {
  color: #e50040;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span + span::before {
  content: ' › ';
  color: #9aa0a6;
}

/* ===== Main Layout ===== */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== Section Card ===== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e50040;
  border-left: 4px solid #e50040;
  padding-left: 12px;
  margin-bottom: 16px;
}

/* ===== Step Badge ===== */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e50040;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-right: 10px;
}

/* ===== Step Row ===== */
.step-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 0;
}

.step-row .step-content {
  flex: 1;
}

.step-row .step-content p {
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ===== Note Box ===== */
.note-box {
  background: #fff8e1;
  border-left: 4px solid #f9a825;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: #5d4037;
}

.note-box p + p {
  margin-top: 6px;
}

/* ===== Warning Box ===== */
.warning-box {
  background: #fce4ec;
  border-left: 4px solid #e53935;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: #b71c1c;
}

/* ===== LED Indicator ===== */
.led-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  margin: 6px 0;
}

.led {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
}

.led-green { background: #43a047; }
.led-green-blink { background: #43a047; animation: blink 0.8s infinite; }
.led-red { background: #e53935; }
.led-red-blink { background: #e53935; animation: blink 0.8s infinite; }
.led-orange { background: #fb8c00; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ===== Image Block ===== */
.img-block {
  text-align: center;
  margin: 16px 0;
}

.img-block img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  display: block;
  margin: 0 auto;
}

.img-block figcaption {
  font-size: 0.78rem;
  color: #757575;
  margin-top: 6px;
}

/* ===== Video Block ===== */
.video-block {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-block iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Choice Cards (Top Page) ===== */
.choice-section {
  margin-bottom: 32px;
}

.choice-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e50040;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.choice-desc {
  font-size: 0.85rem;
  color: #5f6368;
  margin-bottom: 14px;
  margin-left: 38px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

.choice-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.choice-card:hover {
  border-color: #e50040;
  box-shadow: 0 4px 16px rgba(229,0,64,0.15);
  transform: translateY(-2px);
}

.choice-card.selected {
  border-color: #e50040;
  background: #fce4eb;
}

.choice-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e50040;
  background: #fce4eb;
  border-radius: 4px;
  padding: 2px 8px;
  display: inline-block;
  width: fit-content;
}

.choice-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
}

.choice-card ul {
  list-style: none;
  font-size: 0.82rem;
  color: #5f6368;
  margin-top: 4px;
}

.choice-card ul li::before {
  content: '✓ ';
  color: #43a047;
}

.choice-card .arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-size: 1.2rem;
  color: #e50040;
  opacity: 0;
  transition: opacity 0.2s;
}

.choice-card:hover .arrow {
  opacity: 1;
}

/* ===== Pattern Tag ===== */
.pattern-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.pattern-a { background: #e8f5e9; color: #2e7d32; }
.pattern-b { background: #e3f2fd; color: #1565c0; }
.pattern-c { background: #fff3e0; color: #e65100; }
.pattern-d { background: #f3e5f5; color: #6a1b9a; }

/* ===== CTA Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #e50040;
  color: #fff;
  box-shadow: 0 2px 6px rgba(229,0,64,0.35);
}

.btn-primary:hover {
  background: #b5002f;
  box-shadow: 0 4px 12px rgba(229,0,64,0.45);
}

.btn-secondary {
  background: #fff;
  color: #e50040;
  border: 2px solid #e50040;
}

.btn-secondary:hover {
  background: #fce4eb;
}

/* ===== Footer ===== */
.site-footer {
  background: #2c3e50;
  color: #9aa0a6;
  text-align: center;
  padding: 24px 20px 20px;
  font-size: 0.8rem;
}

.footer-logo {
  display: block;
  height: 28px;
  width: auto;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 5px;
  padding: 3px 8px;
}

.site-footer a {
  color: #9aa0a6;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ===== Divider ===== */
.divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 20px 0;
}

/* ===== Connection Check Banner ===== */
.check-banner {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid #a5d6a7;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.check-banner .check-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.check-banner h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 6px;
}

/* ===== Numbered List ===== */
.step-list {
  list-style: none;
  counter-reset: step-counter;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 14px 14px 14px 52px;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e50040;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-list li strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
  color: #1a1a1a;
}

.step-list .note-box {
  margin-top: 8px;
}

/* ===== Back Link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e50040;
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===== Page Title ===== */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: #5f6368;
  margin-bottom: 24px;
}

/* ===== Completion Banner ===== */
.complete-banner {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 8px;
}

.complete-banner p {
  font-size: 1rem;
  color: #2e7d32;
  font-weight: 700;
}

.complete-banner small {
  display: block;
  font-size: 0.83rem;
  color: #5f6368;
  margin-top: 6px;
  font-weight: 400;
}

/* ===== Sensitivity Table ===== */
.sensitivity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 10px;
}

.sensitivity-table th,
.sensitivity-table td {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.sensitivity-table th {
  background: #f5f7fa;
  font-weight: 700;
  color: #2c3e50;
}

.sensitivity-table tr:nth-child(even) {
  background: #fafafa;
}

/* ===== Nav Tabs ===== */
.pattern-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pattern-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.pattern-nav a.pattern-a { border-color: #a5d6a7; color: #2e7d32; background: #e8f5e9; }
.pattern-nav a.pattern-b { border-color: #90caf9; color: #1565c0; background: #e3f2fd; }
.pattern-nav a.pattern-c { border-color: #ffcc80; color: #e65100; background: #fff3e0; }
.pattern-nav a.pattern-d { border-color: #ce93d8; color: #6a1b9a; background: #f3e5f5; }

.pattern-nav a:hover,
.pattern-nav a.active {
  opacity: 0.7;
}
