/* ============ Databricks 簡易マニュアル ============ */
:root {
  --db-red: #FF3621;
  --db-red-soft: #FF5F46;
  --navy: #1B3139;
  --side-bg: #11171D;
  --side-bg-hover: #1E2730;
  --side-text: #D5DCE3;
  --side-muted: #7D8CA0;
  --side-border: #232D38;
  --top-bg: #0D1117;
  --content-bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --border: #E4E7EB;
  --text: #1B3139;
  --text-sub: #5A6C77;
  --link: #2272B4;
  --chip-bg: #EEF4F9;
  --tip-bg: #FFF7ED;
  --tip-border: #FDBA74;
  --topbar-h: 56px;
  --sidebar-w: 264px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }
body {
  height: 100%;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  color: var(--text);
  background: var(--content-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- トップバー ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--top-bg);
  border-bottom: 1px solid var(--side-border);
}
.menu-btn {
  display: none;
  background: none; border: none; color: var(--side-text);
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.menu-btn:hover { background: var(--side-bg-hover); }
.brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: #fff; flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--side-muted); margin-left: 4px; }
.top-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: #1A222B; border: 1px solid var(--side-border);
  border-radius: 8px; padding: 7px 12px;
  width: min(360px, 42vw);
  color: var(--side-muted);
}
.top-search:focus-within { border-color: #3B82C4; }
.top-search input {
  flex: 1; background: none; border: none; outline: none;
  color: #E8EDF2; font-size: 13px; min-width: 0;
}
.top-search input::placeholder { color: var(--side-muted); }

/* ---------- レイアウト ---------- */
.layout { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }

/* ---------- サイドバー ---------- */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--side-bg);
  overflow-y: auto;
  padding: 10px 8px 24px;
  z-index: 30;
  scrollbar-width: thin;
  scrollbar-color: #2C3946 transparent;
}
.side-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .6px;
  color: var(--side-muted);
  padding: 16px 12px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; margin: 1px 0;
  border-radius: 7px;
  color: var(--side-text); text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
}
.side-item:hover { background: var(--side-bg-hover); }
.side-item.active { background: #26303C; color: #fff; }
.side-item .si-icon {
  width: 20px; text-align: center; font-size: 14px;
  color: transparent; text-shadow: 0 0 0 #C9D4DF;
  flex-shrink: 0;
}
.side-item.active .si-icon, .side-item:hover .si-icon { text-shadow: 0 0 0 #FFFFFF; }
.side-item .si-ja { margin-left: auto; font-size: 10.5px; color: var(--side-muted); white-space: nowrap; }
.side-item.side-new {
  background: #33191A; color: #fff; font-weight: 600;
  margin-bottom: 8px;
}
.side-item.side-new:hover { background: #43201F; }
.side-item.side-new .si-icon { color: var(--db-red); text-shadow: none; font-weight: 700; font-size: 16px; }
.side-item.side-new.active { outline: 1px solid var(--db-red); }
.side-divider { height: 1px; background: var(--side-border); margin: 16px 10px 2px; }
.side-section-title.side-current { color: #8FA3B8; font-size: 10.5px; }

/* サイドバーのプロダクト切り替え */
.prod-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 2px 0;
  border-radius: 7px; text-decoration: none;
  color: var(--side-text);
}
.prod-item:hover { background: var(--side-bg-hover); }
.prod-item.active { background: #26303C; }
.prod-item.active .pi-name { color: #fff; }
.prod-item .pi-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.pi-body { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pi-name { font-size: 12.5px; font-weight: 600; }
.pi-ja { font-size: 10px; color: var(--side-muted); }
.sidebar-backdrop { display: none; }

/* ---------- メイン ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px clamp(20px, 4vw, 48px) 64px;
  max-width: 1200px;
}

/* ホーム */
.hero { margin-bottom: 30px; }
.hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.hero p { color: var(--text-sub); font-size: 14px; line-height: 1.9; max-width: 720px; }
.hero .hero-note { font-size: 12.5px; margin-top: 6px; }

.cat-block { margin-bottom: 34px; }
.cat-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; margin-bottom: 14px;
}
.cat-title::before {
  content: ""; display: block; width: 5px; height: 20px;
  background: var(--db-red); border-radius: 3px;
}
.cat-count { font-size: 12px; font-weight: 500; color: var(--text-sub); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.feature-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 14px;
  text-decoration: none; color: var(--text);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.feature-card:hover {
  border-color: #C9D4DC;
  box-shadow: 0 6px 18px rgba(27, 49, 57, .10);
  transform: translateY(-2px);
}
.fc-head { display: flex; align-items: center; gap: 10px; }
.fc-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--chip-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.fc-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.fc-en { display: block; font-size: 11px; font-weight: 500; color: var(--text-sub); }
.fc-short { font-size: 12.5px; color: var(--text-sub); line-height: 1.75; flex: 1; }
.fc-more { font-size: 12px; color: var(--link); font-weight: 600; }
.fc-more::after { content: " →"; }

.no-hit { color: var(--text-sub); font-size: 14px; padding: 24px 4px; }

/* プロダクト選択カード */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.prod-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-left: 4px solid var(--db-red);
  border-radius: 0 12px 12px 0;
  padding: 18px 20px 16px;
  text-decoration: none; color: var(--text);
  transition: box-shadow .15s, transform .15s;
}
.prod-card:hover {
  box-shadow: 0 6px 18px rgba(27, 49, 57, .10);
  transform: translateY(-2px);
}
.pc-head { display: flex; align-items: center; gap: 12px; }
.pc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--chip-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.pc-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.pc-en { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-sub); }
.pc-tag { font-size: 13px; color: var(--text-sub); line-height: 1.75; flex: 1; }
.pc-count { font-size: 12.5px; color: var(--link); font-weight: 600; }

.switcher-note {
  background: var(--chip-bg); border: 1px solid #D8E4EE;
  border-radius: 10px; padding: 15px 18px;
  font-size: 13px; line-height: 1.9; color: var(--text-sub);
  margin-bottom: 30px;
}
.switcher-note strong {
  display: block; color: var(--text); font-size: 13.5px; margin-bottom: 4px;
}

.chip-prod {
  margin-left: 7px; font-size: 10px; font-weight: 600;
  background: var(--navy); color: #fff;
  border-radius: 20px; padding: 2px 8px;
}

/* 詳細ページ */
.breadcrumb { font-size: 12.5px; color: var(--text-sub); margin-bottom: 18px; }
.breadcrumb a { color: var(--link); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 7px; color: #B2BEC7; }

.detail-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 10px;
}
.detail-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; flex-shrink: 0;
}
.detail-title h1 { font-size: 24px; font-weight: 700; line-height: 1.3; }
.detail-title .en { font-size: 13px; color: var(--text-sub); font-weight: 500; }
.cat-badge {
  display: inline-block; margin-left: 10px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--navy); border-radius: 20px; padding: 3px 10px;
  vertical-align: 2px;
}
.plain-box {
  background: #EFF6FC;
  border: 1px solid #CBE0F2;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0 14px;
}
.plain-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  color: var(--link); margin-bottom: 6px;
}
.plain-text { font-size: 15px; font-weight: 700; line-height: 1.9; }
.plain-ex { font-size: 13px; color: var(--text-sub); line-height: 1.9; margin-top: 6px; }

.detail-overview {
  font-size: 14.5px; line-height: 2.0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-left: 4px solid var(--db-red);
  border-radius: 10px; padding: 16px 20px;
  margin: 18px 0 30px;
}

.detail-sec { margin-bottom: 32px; }
.detail-sec h2 {
  font-size: 16.5px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 9px;
}
.detail-sec h2::before {
  content: ""; display: block; width: 5px; height: 18px;
  background: var(--db-red); border-radius: 3px;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cap-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.cap-card h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.cap-card p { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; }

.usecase-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.usecase-list li {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 14px;
  font-size: 13.5px; line-height: 1.7;
  display: flex; gap: 10px; align-items: baseline;
}
.usecase-list li::before { content: "✓"; color: var(--db-red); font-weight: 700; flex-shrink: 0; }

.steps-list { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.steps-list li {
  counter-increment: step;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.8;
}
.steps-list li::before {
  content: counter(step);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

.tip-item {
  background: var(--tip-bg); border: 1px solid var(--tip-border);
  border-radius: 9px; padding: 11px 14px; margin-bottom: 8px;
  font-size: 13px; line-height: 1.8;
  display: flex; gap: 9px; align-items: baseline;
}
.tip-item::before { content: "💡"; flex-shrink: 0; }

.related-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.related-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--chip-bg); border: 1px solid #D8E4EE;
  color: var(--navy); text-decoration: none;
  font-size: 12.5px; font-weight: 600;
  border-radius: 20px; padding: 7px 14px;
}
.related-chip:hover { background: #E0ECF5; }

/* 用語集 */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.term-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 15px 17px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.term-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px; }
.term-ja { font-size: 15px; font-weight: 700; }
.term-en { font-size: 12px; color: var(--text-sub); }
.term-def { font-size: 13px; line-height: 1.9; }
.term-ex {
  font-size: 12.5px; color: var(--text-sub); line-height: 1.85;
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border);
}
.term-card.hl {
  border-color: var(--db-red);
  box-shadow: 0 0 0 3px rgba(255, 54, 33, .14);
}

.detail-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
}
.detail-nav a {
  font-size: 13px; color: var(--link); text-decoration: none; font-weight: 600;
  max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-nav a:hover { text-decoration: underline; }

.site-footer {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-sub); line-height: 1.9;
}
.site-footer a { color: var(--link); }

/* ---------- モバイル ---------- */
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .brand-sub { display: none; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(10, 15, 20, .5); z-index: 25;
  }
  .main { margin-left: 0; padding: 22px 16px 48px; }
  .hero h1 { font-size: 21px; }
  .detail-title h1 { font-size: 20px; }
  .top-search { width: min(240px, 52vw); }
  /* iOS Safariは16px未満の入力にフォーカスすると画面を自動拡大し元に戻さない */
  .top-search input { font-size: 16px; }
}
