:root {
  --navy: #0b2a4a;
  --navy-deep: #071c33;
  --accent: #1e5a8a;
  --line: #d7dee7;
  --bg: #f4f6f9;
  --bg-soft: #e8eef4;
  --text: #1a2332;
  --muted: #5a6a7a;
  --white: #ffffff;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --shadow: 0 1px 3px rgba(11, 42, 74, 0.08);
  --radius: 4px;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--white);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.92;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 0.72rem;
  opacity: 0.75;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.nav a {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.is-active {
  border-bottom-color: #7eb6e0;
  text-decoration: none;
}

.hero {
  background:
    linear-gradient(135deg, rgba(7, 28, 51, 0.92), rgba(11, 42, 74, 0.85)),
    linear-gradient(160deg, var(--navy-deep), var(--accent));
  color: var(--white);
  padding: 4.5rem 1.25rem 4rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hero .brand-name {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
}

.hero p {
  margin: 0;
  max-width: 36rem;
  font-size: 1.02rem;
  opacity: 0.92;
  line-height: 1.8;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

.section-title {
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-left: 4px solid var(--navy);
  padding-left: 0.75rem;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-deep);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--line);
  color: var(--navy);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.news-list li {
  border-bottom: 1px solid var(--line);
}

.news-list a {
  display: flex;
  gap: 1rem;
  padding: 0.95rem 0.25rem;
  color: var(--text);
  text-decoration: none;
}

.news-list a:hover {
  color: var(--accent);
}

.news-day {
  flex: 0 0 7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.machine-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.machine-item:hover {
  border-color: #a8bfd4;
  transform: translateY(-2px);
}

.machine-item a.thumb {
  display: block;
  aspect-ratio: 4/3;
  background: var(--bg-soft);
  overflow: hidden;
}

.machine-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.machine-body {
  padding: 0.95rem 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.machine-body h2 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--navy);
}

.machine-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.machine-price {
  margin-top: auto;
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: end;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(30, 90, 138, 0.25);
  border-color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.flash-ok {
  background: #ecfdf3;
  color: var(--ok);
  border: 1px solid #abe1c2;
}

.flash-error {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #f5c2c0;
}

.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem 1.25rem;
  margin-top: auto;
  font-size: 0.88rem;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer a {
  color: #9ec4e4;
}

.specs {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
}

.specs th,
.specs td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

.specs th {
  width: 28%;
  background: var(--bg-soft);
  color: var(--navy);
  font-weight: 600;
}

.gallery {
  display: grid;
  gap: 0.75rem;
}

.gallery-main {
  position: relative;
  background: #0f1720;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.gallery-actions {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.4rem;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.gallery-thumbs button {
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  flex: 0 0 72px;
  height: 54px;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.75;
}

.gallery-thumbs button.is-active,
.gallery-thumbs button:hover {
  border-color: var(--navy);
  opacity: 1;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 28, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.data th {
  background: var(--bg-soft);
  color: var(--navy);
  white-space: nowrap;
}

table.data tr:hover td {
  background: #fafbfc;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.admin-side {
  background: var(--navy-deep);
  color: #fff;
  padding: 1.25rem 0.85rem;
}

.admin-side .brand-name {
  font-size: 0.98rem;
  padding: 0 0.5rem 1rem;
}

.admin-side nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-side a {
  color: rgba(255, 255, 255, 0.88);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-side a:hover,
.admin-side a.is-active {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.admin-main {
  padding: 1.5rem 1.5rem 3rem;
  background: var(--bg);
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.muted {
  color: var(--muted);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
}

.about-grid dt {
  color: var(--muted);
  font-weight: 600;
}

.about-grid dd {
  margin: 0;
}

.map-wrap {
  margin-top: 1.5rem;
}

.map-wrap iframe {
  width: 100%;
  max-width: 800px;
  height: 420px;
  border: 0;
  border-radius: var(--radius);
}

@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-side {
    padding-bottom: 0.5rem;
  }
  .admin-side nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav {
    gap: 0.5rem 0.85rem;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .news-list a {
    flex-direction: column;
    gap: 0.2rem;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeUp 0.55s ease both;
}

.hero.animate-in {
  animation: fadeUp 0.7s ease both;
}
