:root {
  --theme-bg: #f4f6f9;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f8fafc;
  --theme-text: #172033;
  --theme-muted: #64748b;
  --theme-muted-2: #94a3b8;
  --theme-border: #e4e8ef;
  --theme-border-strong: #d5dce7;
  --theme-primary: #b51f1f;
  --theme-primary-dark: #921919;
  --theme-blue: #1f6fa8;
  --theme-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --theme-shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --theme-radius: 18px;
  --theme-width-pc: 88%;
  --theme-width-tablet: 92%;
  --theme-width-sp: 100%;
  --theme-max: 1680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; vertical-align: middle; }
button, input, select, textarea { font: inherit; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 18px 0 10px;
  background: linear-gradient(180deg, rgba(244, 246, 249, .96), rgba(244, 246, 249, .70));
  backdrop-filter: blur(12px);
}
.site-header__inner,
.site-footer__inner,
.home-hero__inner,
.gallery-section,
.page-container {
  width: var(--theme-width-pc);
  max-width: var(--theme-max);
  margin: 0 auto;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid rgba(228, 232, 239, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--theme-shadow-sm);
}
.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--theme-text);
}
.site-logo img,
.footer-logo img,
.custom-logo {
  max-height: 34px;
  width: auto;
}
.site-logo__mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--theme-primary);
  color: #fff;
  font-weight: 900;
}
.site-logo__text { font-size: 14px; }
.menu-toggle {
  appearance: none;
  border: 1px solid var(--theme-border);
  background: #fff;
  color: var(--theme-text);
  border-radius: 999px;
  min-height: 42px;
  padding: 8px 12px 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: var(--theme-shadow-sm);
}
.menu-toggle__icon {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--theme-text);
}
.menu-toggle__icon span {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}
.menu-toggle__icon span:first-child { top: 11px; }
.menu-toggle__icon span:last-child { top: 17px; }

.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
}
.overlay-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}
.overlay-menu__bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .62);
  opacity: 0;
}
.overlay-menu__panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(560px, calc(100% - 32px));
  border-radius: 28px;
  padding: clamp(22px, 4vw, 44px);
  background: #101827;
  color: #fff;
  overflow: hidden;
  transform: translateX(110%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .30);
}
.overlay-menu__panel::before {
  content: "";
  position: absolute;
  right: -140px;
  top: -140px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 31, 31, .55), rgba(181, 31, 31, 0) 68%);
}
.overlay-menu__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(44px, 8vw, 90px);
}
.overlay-menu__label {
  color: rgba(255,255,255,.46);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.overlay-menu__close {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.overlay-menu__nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}
.overlay-menu__link {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 92px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  opacity: 0;
  transform: translateY(24px);
}
.overlay-menu__link span {
  color: rgba(255,255,255,.36);
  font-size: 12px;
  font-weight: 900;
}
.overlay-menu__link strong {
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1;
  letter-spacing: .02em;
}
.overlay-menu__link:hover strong { color: #ffdddd; }

.home-hero {
  padding: clamp(58px, 9vw, 120px) 0 clamp(38px, 6vw, 80px);
}
.home-hero__inner {
  min-height: 420px;
  display: grid;
  align-content: center;
  border-radius: 34px;
  padding: clamp(28px, 6vw, 84px);
  background:
    radial-gradient(circle at 82% 18%, rgba(181, 31, 31, .18), transparent 32%),
    linear-gradient(135deg, #fff 0%, #f6f8fb 46%, #eef3f8 100%);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow);
}
.home-hero__eyebrow,
.section-head p,
.page-header__eyebrow {
  margin: 0 0 12px;
  color: var(--theme-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.home-hero__title {
  margin: 0;
  font-size: clamp(34px, 6vw, 78px);
  line-height: 1.05;
  letter-spacing: .02em;
  color: var(--theme-text);
}
.home-hero__lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--theme-muted);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 600;
}
.home-hero__actions { margin-top: 34px; }
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(181, 31, 31, .24);
}
.primary-link::after {
  content: "→";
  margin-left: 14px;
}

.gallery-section {
  padding: 0 0 clamp(60px, 8vw, 110px);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.2;
}
.ptdb-gallery {
  overflow: visible;
}
.ptdb-gallery .swiper-slide {
  width: min(76vw, 720px);
}
.gallery-card {
  position: relative;
  min-height: clamp(360px, 48vw, 560px);
  border-radius: 30px;
  overflow: hidden;
  background: #111827;
  color: #fff;
  box-shadow: var(--theme-shadow);
}
.gallery-card__image {
  position: absolute;
  inset: 0;
  transform: scale(1.08);
  background-size: cover;
  background-position: center;
}
.gallery-card__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.68));
}
.gallery-card__image--01 { background-image: linear-gradient(135deg, #172033, #b51f1f); }
.gallery-card__image--02 { background-image: linear-gradient(135deg, #0f766e, #1f6fa8); }
.gallery-card__image--03 { background-image: linear-gradient(135deg, #6C3483, #172033); }
.gallery-card__image--04 { background-image: linear-gradient(135deg, #334155, #f59e0b); }
.gallery-card__body {
  position: absolute;
  left: clamp(22px, 4vw, 44px);
  right: clamp(22px, 4vw, 44px);
  bottom: clamp(22px, 4vw, 44px);
}
.gallery-card__body span {
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 900;
}
.gallery-card__body h3 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 5vw, 58px);
  line-height: 1;
}
.gallery-card__body p {
  max-width: 460px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-weight: 700;
}
.gallery-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}
.gallery-arrows { display: flex; gap: 8px; }
.gallery-arrow {
  appearance: none;
  border: 1px solid var(--theme-border);
  background: #fff;
  color: var(--theme-text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.swiper-pagination { position: static; text-align: left; }
.swiper-pagination-bullet-active { background: var(--theme-primary); }

.page-container {
  padding: clamp(32px, 5vw, 70px) 0 clamp(56px, 8vw, 100px);
}
.page-header {
  margin-bottom: 18px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--theme-border);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--theme-shadow-sm);
}
.page-title {
  margin: 0;
  color: var(--theme-text);
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.15;
}
.page-content {
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow-sm);
  padding: clamp(10px, 1.5vw, 32px);
}
.page-content > *:first-child { margin-top: 0; }
.page-content > *:last-child { margin-bottom: 0; }
.page-content h2,
.page-content h3,
.page-content h4 {
  line-height: 1.35;
  color: var(--theme-text);
}
.page-content p,
.page-content li {
  color: var(--theme-muted);
  font-weight: 500;
}
.page-content a:not(.ptdb-btn) {
  color: var(--theme-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--theme-border);
}

.site-footer {
  padding: 34px 0;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--theme-border);
}
.site-footer__copy {
  margin: 0;
  color: var(--theme-muted-2);
  font-size: 12px;
  font-weight: 700;
}

/* System plugin wrapper support */
.page-content .ptdb-app {
  margin: -16px;
  border-radius: 20px;
}

@media (max-width: 1024px) {
  .site-header__inner,
  .site-footer__inner,
  .home-hero__inner,
  .gallery-section,
  .page-container {
    width: var(--theme-width-tablet);
    max-width: none;
  }
  .home-hero__inner { min-height: 360px; }
}
@media (max-width: 768px) {
  .site-header { padding-top: 10px; }
  .site-header__inner { min-height: 56px; padding: 10px 12px; }
  .site-logo__text { font-size: 13px; }
  .menu-toggle__text { display: none; }
  .overlay-menu__panel { inset: 10px; width: auto; border-radius: 24px; }
  .overlay-menu__link { min-height: 76px; }
  .section-head { display: block; }
  .gallery-ui { align-items: flex-start; flex-direction: column; }
  .site-footer__inner { align-items: flex-start; flex-direction: column; }
  .page-content .ptdb-app { margin: -10px; }
}
@media (max-width: 480px) {
  .site-header__inner,
  .site-footer__inner,
  .home-hero__inner,
  .gallery-section,
  .page-container {
    width: var(--theme-width-sp);
  }
  .home-hero { padding-top: 38px; }
  .home-hero__inner { border-radius: 24px; min-height: 320px; }
  .primary-link { width: 100%; }
  .ptdb-gallery .swiper-slide { width: 88vw; }
  .gallery-card { border-radius: 22px; }
  .page-header, .page-content { border-radius: 18px; }
}

/* Dealer system generic support */
.page-content > .dealer-management-tabs,
.page-content > .dealer-auth,
.page-content > .dtm-app,
.page-content > .dlm-app,
.page-content > .dem-app {
  margin-top: 0;
}

.page-content:has(.dealer-management-tabs),
.page-content:has(.dealer-auth),
.page-content:has(.dtm-app),
.page-content:has(.dlm-app),
.page-content:has(.dem-app) {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .site-header { padding-top: 10px; }
  .site-header__inner { min-height: 54px; }
  .page-container { width: 100%; }
}
