:root {
  --study-ink: #071f4d;
  --study-muted: #52627b;
  --study-teal: #078987;
  --study-teal-dark: #056b6d;
  --study-amber: #f29b19;
  --study-blue: #0d4fa6;
  --study-red: #d84444;
  --study-line: #d5dfec;
  --study-soft: #f2f8fb;
  --study-warm: #fffaf0;
  --study-paper: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.study-exam-page {
  margin: 0;
  color: var(--study-ink);
  background: linear-gradient(180deg, #ffffff 0, #f6fbfb 54%, #fff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 18px;
  line-height: 1.78;
}

a { color: inherit; }

.study-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--study-line);
  background: rgba(255,255,255,.98);
}

.study-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--study-ink);
  text-decoration: none;
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 950;
}

.study-brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--study-teal);
  font-size: 24px;
  font-weight: 950;
}

.study-nav {
  display: flex;
  gap: 22px;
  font-size: 16px;
  font-weight: 850;
}

.study-nav a { text-decoration: none; }

.study-search {
  display: flex;
  align-items: center;
  width: min(340px, 28vw);
  height: 44px;
  border: 1px solid var(--study-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.study-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

.study-search button {
  width: 48px;
  height: 44px;
  border: 0;
  color: #fff;
  background: var(--study-ink);
  font-size: 20px;
  font-weight: 950;
}

.study-hero {
  padding: clamp(28px, 4.8vw, 66px) clamp(18px, 4vw, 56px) 28px;
  background:
    linear-gradient(95deg, rgba(242,248,251,.96), rgba(255,255,255,.94) 52%, rgba(255,250,240,.88)),
    #fff;
}

.study-hero-grid {
  max-width: 1520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(500px, .9fr);
  gap: clamp(30px, 4vw, 62px);
  align-items: start;
}

.study-breadcrumb {
  color: var(--study-muted);
  font-size: 15px;
  font-weight: 850;
}

.study-chip {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  margin-top: 24px;
  padding: 5px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--study-blue);
  font-size: 15px;
  font-weight: 950;
}

.study-hero h1 {
  margin: 14px 0 10px;
  color: var(--study-ink);
  font-size: clamp(45px, 5.25vw, 82px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 950;
}

.study-subtitle {
  margin: 0 0 12px;
  color: var(--study-ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.34;
  font-weight: 950;
}

.study-lead {
  max-width: 760px;
  margin: 0;
  color: #33445d;
  font-size: 18px;
  font-weight: 680;
}

.study-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}

.study-action {
  min-height: 120px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  justify-items: center;
  padding: 16px;
  border: 2px solid var(--study-line);
  border-radius: 8px;
  background: #fff;
  color: var(--study-ink);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 14px 36px rgba(7,31,77,.08);
}

.study-action.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--study-teal), var(--study-teal-dark));
  border-color: var(--study-teal);
}

.study-action.warn { border-color: #f4c16d; }

.study-action-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  border: 2px solid currentColor;
  font-size: 22px;
  font-weight: 950;
}

.study-action b {
  display: block;
  font-size: clamp(18px, 1.25vw, 21px);
  line-height: 1.22;
  word-break: keep-all;
  overflow-wrap: normal;
}

.study-action p {
  margin: 5px 0 0;
  color: inherit;
  opacity: .86;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 750;
}

.study-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.study-tags span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid #bfd4df;
  border-radius: 8px;
  color: var(--study-blue);
  background: #fff;
  font-size: 15px;
  font-weight: 850;
}

.study-worksheet {
  border: 1px solid var(--study-line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255,255,255,.99);
  box-shadow: 0 18px 46px rgba(7,31,77,.10);
}

.study-worksheet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.study-worksheet h2 {
  margin: 0;
  font-size: clamp(25px, 2vw, 32px);
  line-height: 1.25;
  letter-spacing: 0;
}

.study-print {
  min-width: 48px;
  height: 48px;
  border: 1px solid var(--study-line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--study-ink);
  background: #fff;
  font-size: 24px;
  font-weight: 950;
}

.study-sheet-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid #e6edf5;
}

.study-sheet-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--study-teal);
  font-weight: 950;
}

.study-sheet-row b {
  display: block;
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 7px;
}

.study-line-fill {
  min-height: 42px;
  border: 1px solid var(--study-line);
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.study-copy {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--study-teal);
  font-size: 17px;
  font-weight: 950;
  cursor: pointer;
}

.study-page {
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px 18px 76px;
}

.study-section {
  margin: 24px 0;
  padding: clamp(22px, 3.2vw, 34px);
  border: 1px solid var(--study-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(7,31,77,.06);
}

.study-section h2 {
  margin: 0 0 16px;
  color: var(--study-ink);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.22;
  letter-spacing: 0;
}

.study-section > p {
  margin: 0 0 16px;
  color: #33445d;
  font-size: 19px;
  font-weight: 720;
}

.study-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.study-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--study-line);
  border-radius: 8px;
  color: var(--study-ink);
  background: #fff;
  font-size: 16px;
  font-weight: 900;
}

.study-tab.active {
  color: #fff;
  border-color: var(--study-teal);
  background: var(--study-teal);
}

.study-example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.study-example-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #cfdce9;
  border-radius: 8px;
  padding: 18px;
  background: #fbfdff;
}

.study-example-card strong {
  display: block;
  color: var(--study-blue);
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.study-example-card p {
  margin: 0;
  color: #20324d;
  font-size: 17px;
  font-weight: 720;
}

.study-read-btn {
  min-height: 40px;
  margin-top: 16px;
  border: 1px solid var(--study-teal);
  border-radius: 8px;
  color: var(--study-teal-dark);
  background: #fff;
  font-size: 15px;
  font-weight: 950;
}

.study-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .55fr);
  gap: 18px;
}

.study-document {
  min-height: 360px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid #ccd9e7;
  border-radius: 8px;
  background:
    linear-gradient(#fff 0 0) padding-box,
    repeating-linear-gradient(180deg, transparent 0 35px, rgba(7,31,77,.08) 36px 37px);
}

.study-document h3 {
  margin: 0 0 12px;
  color: var(--study-ink);
  font-size: 25px;
  line-height: 1.3;
}

.study-document pre {
  white-space: pre-wrap;
  margin: 0;
  color: #152946;
  font: inherit;
  font-size: 18px;
  font-weight: 720;
}

.study-steps {
  display: grid;
  gap: 12px;
}

.study-step-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--study-line);
  border-radius: 8px;
  background: var(--study-soft);
}

.study-step-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--study-blue);
  font-weight: 950;
}

.study-step-card b {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.study-step-card em {
  display: block;
  margin-top: 4px;
  color: var(--study-muted);
  font-style: normal;
  font-size: 15px;
  font-weight: 720;
}

.study-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--study-line);
  border-radius: 8px;
  background: #fff;
}

.study-table th,
.study-table td {
  padding: 15px;
  border-bottom: 1px solid var(--study-line);
  text-align: left;
  vertical-align: top;
  font-size: 17px;
}

.study-table th {
  color: var(--study-ink);
  background: #f0f6fb;
  font-size: 16px;
  font-weight: 950;
}

.study-table tr:last-child td { border-bottom: 0; }
.study-table .bad { color: var(--study-red); font-weight: 850; }
.study-table .good { color: var(--study-teal-dark); font-weight: 850; }

.study-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.study-check-grid li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 62px;
  padding: 13px;
  border: 1px solid #f0d7a4;
  border-radius: 8px;
  background: var(--study-warm);
  color: #3a2c15;
  font-size: 16px;
  font-weight: 820;
}

.study-check-grid span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: var(--study-amber);
  font-size: 16px;
  font-weight: 950;
}

.study-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--study-line);
}

.study-source-strip strong {
  color: var(--study-muted);
  font-size: 15px;
  font-weight: 950;
}

.study-source-strip a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #bfd4df;
  border-radius: 8px;
  color: var(--study-blue);
  background: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 850;
}

.study-footer {
  padding: 34px 18px 44px;
  border-top: 1px solid var(--study-line);
  background: #fff;
  text-align: center;
  color: var(--study-muted);
  font-size: 14px;
  font-weight: 750;
}

@media (max-width: 1050px) {
  .study-hero-grid,
  .study-answer { grid-template-columns: 1fr; }
  .study-worksheet { max-width: 720px; }
  .study-search { display: none; }
}

@media (max-width: 760px) {
  body.study-exam-page { font-size: 17px; }
  .study-topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .study-nav { width: 100%; overflow-x: auto; padding-bottom: 4px; gap: 16px; }
  .study-hero { padding: 26px 16px 20px; }
  .study-hero h1 { font-size: clamp(38px, 11.5vw, 54px); }
  .study-subtitle { font-size: 22px; }
  .study-actions,
  .study-example-grid,
  .study-check-grid { grid-template-columns: 1fr; }
  .study-action { min-height: 104px; }
  .study-action b { white-space: normal; }
  .study-worksheet { padding: 18px; }
  .study-section { padding: 20px 16px; }
  .study-section h2 { font-size: 31px; }
  .study-table { display: block; overflow-x: auto; }
  .study-document pre { font-size: 17px; }
}
