/* "For Students" page — extends styles.css */

.nav-links a.active {
  color: var(--link);
  font-weight: 700;
}

.guide-wrapper {
  max-width: 1180px;
}

/* Sticky contents sidebar */
.guide-toc {
  flex: 0 0 230px;
  position: sticky;
  top: calc(var(--nav-height) + 1.25rem);
  max-height: calc(100vh - var(--nav-height) - 2.5rem);
  overflow-y: auto;
  font-size: 0.85rem;
}

.guide-toc-title {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}

.guide-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.guide-toc a {
  display: block;
  padding: 0.35rem 0.75rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--link);
  background: #f6f8fc;
}

.guide-toc a.active {
  color: var(--link);
  font-weight: 600;
  border-left-color: var(--link);
  background: #f4f7fc;
}

/* Guide content */
.guide {
  flex: 1;
  min-width: 0;
  max-width: 830px;
  font-family: "Trebuchet MS", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

.guide-lead {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(45deg, #f8f9ff, #e8f0fe);
  border-left: 4px solid var(--focus-border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.guide h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.25;
  color: var(--link);
}

.guide h2 {
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.45rem;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--link);
  border-bottom: 2px solid var(--border);
}

.guide h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.15rem;
  color: var(--text-dark);
}

.guide p,
.guide li {
  line-height: 1.8;
}

.guide ul,
.guide ol {
  padding-left: 1.4rem;
}

.guide hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 2rem 0;
}

.guide blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  background: #f8f9fa;
  border-left: 4px solid #c7d2e5;
  border-radius: 0 8px 8px 0;
}

.guide blockquote p {
  margin: 0.35rem 0;
}

.guide .callout-tip {
  background: #f0fdf4;
  border-left-color: #16a34a;
}

.guide .callout-note {
  background: #eff6ff;
  border-left-color: #2563eb;
}

.callout-label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.callout-tip .callout-label {
  color: #15803d;
}

.callout-note .callout-label {
  color: #1d4ed8;
}

/* Tables */
.table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.guide th,
.guide td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.guide th {
  background: #f6f8fc;
  color: var(--text-dark);
  white-space: nowrap;
}

.guide tr:last-child td {
  border-bottom: 0;
}

/* Code and diagrams */
.guide code {
  padding: 0.1rem 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f1f3f7;
  border-radius: 4px;
}

.guide pre {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  background: #f6f8fa;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
}

.guide pre code {
  padding: 0;
  font-size: inherit;
  background: none;
}

.guide pre.mermaid {
  text-align: center;
  white-space: pre-wrap;
  background: #fff;
}

.guide pre.mermaid:not([data-processed]) {
  color: #999;
  font-size: 0.75rem;
}

.guide pre.mermaid svg {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Collapsible Toy Demos */
.guide details {
  margin: 1rem 0;
  padding: 0 1rem;
  background: #fbfcff;
  border: 1px solid #dbe4f3;
  border-radius: 10px;
}

.guide summary {
  padding: 0.7rem 0;
  font-weight: 700;
  color: var(--link);
  cursor: pointer;
}

.guide details[open] summary {
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.guide input[type="checkbox"] {
  margin-right: 0.4rem;
}

.guide li:has(> input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.4rem;
}

@media (max-width: 860px) {
  .guide-toc {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
  }

  .guide-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.5rem;
    border-left: 0;
  }

  .guide-toc a {
    margin-left: 0;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  .guide-toc a.active {
    border-color: var(--link);
  }

  .guide h1 {
    font-size: 1.6rem;
  }

  .guide h2 {
    font-size: 1.3rem;
  }
}
