@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #1d4ed8;
  --sub: #0ea5a4;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #000000;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --line: #d7e5f6;
  --line-strong: #c5d7f1;
  --sidebar-width: 280px;
}

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

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

body {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

em,
i {
  font-style: normal;
}

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

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

a:hover {
  color: #1e3a8a;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #0f172a;
  color: #fff;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 32px 24px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-header .logo {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sidebar-header .project-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 0;
}

.sidebar-nav .nav-group {
  margin-bottom: 16px;
}

.sidebar-nav .nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 8px 24px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: #1e293b;
}

.sidebar-nav a.active {
  border-left-color: #fff;
}

.sidebar-nav .nav-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #1e293b;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #94a3b8;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  background:
    radial-gradient(circle at 2% 0%, rgba(59, 130, 246, 0.08), transparent 25%),
    radial-gradient(circle at 100% 10%, rgba(20, 184, 166, 0.08), transparent 22%);
}

.doc-header {
  background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 58%, #0ea5a4 100%);
  color: #f8fafc;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
  margin: 24px 24px 18px;
}

.doc-header .doc-category {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #dbeafe;
  margin-bottom: 10px;
}

.doc-header .doc-title {
  color: #f8fafc;
  font-size: clamp(1.45rem, 2vw, 1.95rem);
  line-height: 1.3;
  margin-bottom: 12px;
}

.doc-header .doc-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: #dbeafe;
  font-size: 13px;
}

.doc-header .doc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-body {
  padding: 0 24px 64px;
  max-width: 1040px;
}

.section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  padding: 16px;
  margin-bottom: 16px;
}

.section-title {
  border-left: 6px solid var(--sub);
  padding-left: 10px;
  color: var(--text);
  font-size: 1.15rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #1e40af;
  font-weight: 700;
}

.fill-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fcfdff;
  padding: 12px;
  margin-top: 12px;
}

.fill-label {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.fill-label .required {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
}

.fill-label .optional {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--text-light);
  padding: 2px 8px;
  border-radius: 999px;
}

.fill-hint {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 8px;
}

.fill-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.fill-content p {
  margin-bottom: 8px;
}

.fill-content p:last-child {
  margin-bottom: 0;
}

.purpose-highlight {
  background: linear-gradient(180deg, #f8fbff 0%, #f0fdfa 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}

.purpose-meta {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e6f0ff;
  border-left: 4px solid #3b82f6;
  color: #0f172a;
  font-weight: 600;
}

.purpose-meta:last-of-type {
  margin-bottom: 10px;
}

.purpose-point {
  margin: 0 0 6px;
  color: #0f172a;
}

.purpose-point:last-child {
  margin-bottom: 0;
}

.external-link-box {
  border: 1px solid #cfe3ff;
  background: linear-gradient(180deg, #f8fbff 0%, #f2fcfb 100%);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
  padding: 14px;
  margin-bottom: 16px;
}

.external-link-box-title {
  color: #1e3a8a;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.external-link-box-desc {
  color: #475569;
  font-size: 14px;
  margin-bottom: 10px;
}

.external-link-input {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.external-link-input input {
  min-width: 280px;
  flex: 1;
  border: 1px solid #b7cff7;
  background: #fff;
  border-radius: 10px;
  color: #0f172a;
  padding: 9px 10px;
  font: inherit;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 9px 12px;
  font-weight: 700;
}

.link-btn:hover {
  color: #fff;
  background: #1e40af;
}

.toc {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.04);
  padding: 14px;
  margin-bottom: 16px;
}

.toc-title {
  color: #1e3a8a;
  font-weight: 700;
  margin-bottom: 8px;
}

.toc-list {
  list-style: decimal;
  padding-left: 1.2rem;
}

.toc-list li {
  margin: 6px 0;
}

.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #cfe0f7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
  margin-top: 8px;
}

.doc-table thead th {
  background: linear-gradient(120deg, #dbeafe 0%, #bfdbfe 45%, #93c5fd 100%);
  color: #0b2545;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--line-strong);
  padding: 11px 12px;
  text-align: left;
}

.doc-table tbody td {
  border-bottom: 1px solid #e7eef8;
  padding: 10px 12px;
  vertical-align: top;
}

.doc-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.doc-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.doc-table tbody tr td:first-child {
  background: linear-gradient(90deg, #f3f7ff 0%, #ffffff 85%);
  color: var(--primary);
  font-weight: 700;
}

.doc-table tbody tr:hover td {
  background: #ecfeff;
}

.doc-table .template-row td {
  color: var(--text);
  font-style: normal;
}

.log-entry {
  border: 1px solid #dbe7f6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  padding: 12px;
  margin-top: 14px;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #d8e4f6;
  border-radius: 10px;
  background: linear-gradient(120deg, #eff6ff 0%, #f8fafc 100%);
  margin-bottom: 10px;
}

.log-title {
  font-weight: 700;
  color: #1e3a8a;
}

.log-date {
  font-size: 12px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbdcf5;
  border-radius: 999px;
  padding: 3px 10px;
}

.log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #cfdef3;
  border-radius: 10px;
  overflow: hidden;
}

.log-table th,
.log-table td {
  border-bottom: 1px solid #e2ebf8;
  padding: 10px 12px;
  vertical-align: top;
}

.log-table tr:last-child th,
.log-table tr:last-child td {
  border-bottom: none;
}

.log-table th {
  width: 180px;
  background: #f3f7ff;
  color: #1e3a8a;
  font-weight: 700;
  white-space: nowrap;
}

.log-table td {
  background: #ffffff;
}

.log-input {
  min-height: 56px;
  background: #f8fafc;
  border: 1px dashed #c9d7ea;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.7;
  color: #0f172a;
}

.log-item-table th:nth-child(1),
.log-item-table td:nth-child(1) {
  width: 180px;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.schedule-table {
  table-layout: fixed;
}

.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
  width: 18%;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  width: 14%;
  text-align: center;
  white-space: nowrap;
}

.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) {
  width: 68%;
  line-height: 1.75;
}

.language-table {
  table-layout: fixed;
}

.language-table th:nth-child(1),
.language-table td:nth-child(1) {
  width: 18%;
  white-space: nowrap;
}

.language-table th:nth-child(2),
.language-table td:nth-child(2) {
  width: 14%;
  text-align: center;
  white-space: nowrap;
}

.language-table th:nth-child(3),
.language-table td:nth-child(3) {
  width: 14%;
  text-align: center;
  white-space: nowrap;
}

.language-table th:nth-child(4),
.language-table td:nth-child(4) {
  width: 54%;
  line-height: 1.75;
}

.tech-table {
  font-size: 13px;
}

.tech-table thead th,
.tech-table tbody td {
  padding: 8px 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
}

.badge-must {
  background: #0f172a;
  color: #fff;
}

.badge-should {
  background: #475569;
  color: #fff;
}

.badge-could {
  background: #cbd5e1;
  color: #334155;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: var(--text-light);
}

.contact-form {
  display: grid;
  gap: 10px;
  max-width: 640px;
}

.form-group {
  display: grid;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid #cdddf2;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.form-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.form-actions {
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #1e40af;
}

.subsection {
  margin-bottom: 24px;
}

.subsection-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #0f172a;
}

.ascii-diagram,
.code-block {
  overflow-x: auto;
}

.ascii-diagram pre,
.code-block pre {
  font-family: "Courier New", Courier, monospace;
  white-space: pre;
  font-size: 13px;
  line-height: 1.5;
}

.code-block pre {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  color: #0f172a;
}

.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 48px;
  height: 48px;
  background: #0f172a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
}

.icon-sm {
  font-size: 18px;
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .doc-header {
    margin: 16px 12px 12px;
    padding: 16px;
    border-radius: 12px;
  }

  .doc-body {
    padding: 0 12px 40px;
  }

  .doc-header .doc-meta {
    flex-direction: column;
    gap: 6px;
  }

  .external-link-input input {
    min-width: 100%;
  }

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

  .form-check label {
    align-items: flex-start;
  }

  .schedule-table {
    min-width: 700px;
  }

  .language-table {
    min-width: 760px;
  }

  .log-table {
    min-width: 720px;
  }

  .log-header {
    align-items: flex-start;
  }
}

@media print {
  .sidebar,
  .hamburger {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    background: #fff !important;
  }
}
