:root{
  --bg:#0b1220;
  --card:#0f1b33;
  --card2:#0c1730;
  --text:#e7eefc;
  --muted:#9fb0d3;

  --primary:#60a5fa;
  --accent:#f59e0b;
  --good:#22c55e;
  --bad:#ef4444;

  --border:rgba(255,255,255,.12);
  --radius:16px;
  --shadow:0 18px 44px rgba(0,0,0,.35);

  --max:1100px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Noto Sans JP", system-ui, -apple-system, Segoe UI, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(96,165,250,.22), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(245,158,11,.16), transparent 60%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

.wrap{
  width:min(var(--max), calc(100% - 32px));
  margin:0 auto;
}

.small{ font-size:.9rem; }
.muted{ color:var(--muted); }

.top{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.7);
  border-bottom:1px solid var(--border);
}
.top__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  gap:14px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:220px;
}
.brand__mark{
  width:38px; height:38px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(96,165,250,.9), rgba(245,158,11,.8));
  color:#0b1020;
  font-weight:900;
  letter-spacing:.02em;
}
.brand__text{ display:flex; flex-direction:column; line-height:1.05; }
.brand__title{ font-weight:800; }
.brand__sub{ font-size:.85rem; color:var(--muted); }

.top__nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}
.top__nav a{
  font-size:.92rem;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  color:var(--muted);
}
.top__nav a:hover{
  color:var(--text);
  border-color:var(--border);
  text-decoration:none;
  background: rgba(255,255,255,.04);
}

.hero{
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap:16px;
  padding:18px 0 10px;
}
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
  .top__inner{ flex-direction:column; align-items:flex-start; }
  .top__nav{ justify-content:flex-start; }
}

.hero__card{
  border:1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  padding:18px;
}
.hero__badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  font-size:.9rem;
  color: rgba(255,255,255,.92);
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(255,255,255,.04);
}
.hero__title{
  margin:12px 0 8px;
  font-size: 2.1rem;
  letter-spacing:.02em;
}
.hero__lead{
  margin:0 0 14px;
  color: var(--muted);
  line-height:1.7;
}
.hero__cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 14px;
}
.hero__meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.pill{
  font-size:.85rem;
  color: rgba(255,255,255,.88);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
}

.hero__side{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,27,51,.92), rgba(12,23,48,.88));
  box-shadow: var(--shadow);
  padding:16px;
  margin:14px 0;
}
.card--soft{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}
.card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.card__title{
  margin:0;
  font-size:1.35rem;
  letter-spacing:.02em;
}
.card__subtitle{
  margin:0 0 10px;
  font-size:1.1rem;
}

.sep{
  height:1px;
  background: var(--border);
  margin:12px 0;
}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:700;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ background: rgba(255,255,255,.06); }
.btn:active{ transform: translateY(1px); }
.btn--primary{
  border-color: rgba(96,165,250,.45);
  background: rgba(96,165,250,.16);
}
.btn--ghost{
  background: transparent;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .grid2{ grid-template-columns: 1fr; }
}

.list{
  margin:10px 0 0;
  padding-left: 18px;
  line-height:1.8;
}

.prose{
  line-height:1.9;
  color: rgba(255,255,255,.92);
}
.prose h3{
  margin:18px 0 8px;
  font-size:1.1rem;
}
.prose ul, .prose ol{
  margin:8px 0;
  padding-left: 20px;
}

.timeline{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.tItem{
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding:12px;
}
.tItem__top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.tItem__year{
  font-weight:900;
  color: rgba(255,255,255,.92);
  padding:4px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.tItem__title{
  font-weight:800;
}
.tagRow{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}
.tag{
  font-size:.82rem;
  color: var(--muted);
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.ruleGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
  margin-top:12px;
}
@media (max-width: 880px){
  .ruleGrid{ grid-template-columns: 1fr; }
}
.rule{
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding:12px;
}
.rule h3{ margin:0 0 8px; font-size:1.05rem; }
.rule p{ margin:0 0 10px; }
.rule ul{ margin:0; padding-left: 18px; line-height:1.8; color: rgba(255,255,255,.9); }

.callout{
  margin-top:14px;
  border:1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.12);
  border-radius: 14px;
  padding:12px;
  line-height:1.8;
}

.search{
  display:flex;
  align-items:center;
  gap:8px;
}
.search input{
  width:min(420px, 60vw);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline:none;
}
.search input::placeholder{ color: rgba(159,176,211,.85); }

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin:12px 0 6px;
}

.lessonList{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.lesson{
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  overflow:hidden;
}
.lesson__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  cursor:pointer;
}
.lesson__title{
  margin:0;
  font-size:1.05rem;
  font-weight:900;
}
.lesson__desc{
  margin:6px 0 0;
  color: var(--muted);
  line-height:1.6;
}
.lesson__meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.lesson__body{
  display:none;
  padding:0 12px 12px;
}
.lesson.is-open .lesson__body{ display:block; }
.lesson__md{
  white-space:pre-wrap;
  line-height:1.85;
  color: rgba(255,255,255,.92);
  border-top:1px solid var(--border);
  padding-top:10px;
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .92rem;
}

.sampleGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:12px;
}
@media (max-width: 880px){
  .sampleGrid{ grid-template-columns: 1fr; }
}
.sample__title{
  margin:0 0 8px;
  font-size:1.05rem;
  font-weight:900;
}
.code{
  margin:10px 0 0;
  border:1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,.25);
  padding:12px;
  overflow:auto;
}
.code code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:.92rem;
  color: rgba(231,238,252,.95);
}

.exportGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:12px;
}
@media (max-width: 880px){
  .exportGrid{ grid-template-columns: 1fr; }
}
.importRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 12px;
}
.file{
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  border:1px dashed rgba(255,255,255,.25);
  border-radius: 14px;
  padding:10px 12px;
  background: rgba(255,255,255,.03);
}
.file input{ display:none; }
.file span{ color: rgba(255,255,255,.9); font-weight:700; }

.footer{
  margin:22px 0 30px;
  padding-top:14px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  border:1px solid var(--border);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-show{
  opacity:1;
  transform: translateX(-50%) translateY(-2px);
}


/* =========================
  Footer (SunStripe / Programming Lab)
  対象HTML:
  <footer class="footer">
    <div class="foot__copy">...</div>
    <nav class="foot__nav"><ul>...</ul></nav>
  </footer>
========================= */

footer{
  margin-top:18px;
  padding:18px 14px;
  border:1px solid rgba(33,115,70,.22);
  border-radius:14px;
  background:
    radial-gradient(900px 200px at 20% 0%, rgba(33,115,70,.18), transparent 65%),
    radial-gradient(700px 200px at 85% 10%, rgba(15,123,108,.12), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.06));
  box-shadow:0 14px 34px rgba(0,0,0,.25);
  color:var(--muted);
}

.foot__copy{
  font-size:12px;
  color:var(--muted);
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
  justify-content:flex-start;
  padding-bottom:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
}

.foot__copy a{
  color:var(--excelWhite2, #d9ffe9);
  text-decoration:none;
  font-weight:800;
  border-bottom:1px solid rgba(33,115,70,.35);
}

.foot__copy a:hover{
  filter:brightness(1.08);
  border-bottom-color:rgba(33,115,70,.60);
}

.foot__nav{
  margin-top:12px;
}

.foot__nav ul{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.foot__nav li{
  margin:0;
}

/* Excel風リンクチップ */
.foot__nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(33,115,70,.26);
  background:
    linear-gradient(180deg, rgba(33,115,70,.18), rgba(0,0,0,.06));
  color:var(--excelWhite, #f3fff8);
  font-size:12px;
  letter-spacing:.02em;
  text-decoration:none;
  transition:transform .12s ease, filter .12s ease, border-color .12s ease;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
  white-space:nowrap;
}

.foot__nav a:hover{
  filter:brightness(1.08);
  border-color:rgba(33,115,70,.55);
  transform:translateY(-1px);
}

.foot__nav a:active{
  transform:translateY(0);
}

/* 今いるページが分かるように（任意：bodyにdata-current="/programming/xlsx/"とか付けると便利） */
/*
body[data-current="/programming/xlsx/"] .foot__nav a[href="/programming/xlsx/"]{
  border-color:rgba(33,115,70,.75);
  background:linear-gradient(180deg, rgba(33,115,70,.40), rgba(33,115,70,.18));
  color:var(--excelWhite2, #d9ffe9);
}
*/

/* スマホで詰まりすぎないように */
@media (max-width:560px){
  footer{
    padding:16px 12px;
  }
  .foot__nav a{
    padding:7px 9px;
    font-size:12px;
  }
}
