/* Shared styles for 小马阅卷帮助系统 (layout + content). */

:root {
  --sidebar-bg: #f3f4f6;
  --sidebar-border: #e5e7eb;
  --text: rgb(55, 53, 47);
  --muted: rgba(55, 53, 47, 0.65);
  --link: rgb(17, 24, 39);
  --card: #ffffff;
  --card-border: rgba(55, 53, 47, 0.12);
  --code-bg: rgba(135, 131, 120, 0.15);
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: #fff;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
    "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Sans Arabic", "Noto Sans Hebrew", sans-serif;
}

/* --- App layout (left nav + content) --- */
.layout {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

/* Non-link brand text (per requirement: no “小马阅卷帮助” link) */
.brand {
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 16px;
  margin: 2px 8px 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}

.nav a {
  color: var(--link);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.2;
}

.nav a:hover {
  background: rgba(17, 24, 39, 0.06);
}

.nav a.active,
.nav a[aria-current="page"] {
  background: rgba(17, 24, 39, 0.10);
  font-weight: 700;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 40px;
}

.content-wrap {
  max-width: 980px;
}

@media (max-width: 960px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
  }
  .main {
    padding: 18px 16px 28px;
  }
}

/* --- Content styles (compatible with Notion export markup) --- */
article.page {
  line-height: 1.38;
  white-space: normal;
}

/* Preserve whitespace only where it matters */
.code,
pre {
  white-space: pre;
}

.page-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

.page-description {
  margin: 0 0 1.25em;
  color: var(--muted);
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0;
  font-weight: 700;
}

h1 {
  font-size: 1.6rem;
  margin-top: 1.6rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 1.3rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.1rem;
}

a,
a:visited {
  color: inherit;
  text-decoration: underline;
}

p {
  margin-top: 0.38em;
  margin-bottom: 0.38em;
}

hr {
  border: none;
  border-bottom: 1px solid rgba(55, 53, 47, 0.12);
  margin: 1.2em 0;
}

img {
  max-width: 100%;
}

ol,
ul {
  margin: 0.6em 0;
  padding-inline-start: 1.6em;
}

ul > li {
  list-style: disc;
}

ol > li {
  padding-left: 0.15em;
}

table,
th,
td {
  border: 1px solid rgba(55, 53, 47, 0.12);
  border-collapse: collapse;
}

table {
  width: 100%;
  border-left: none;
  border-right: none;
  margin: 0.8em 0;
  font-size: 0.95rem;
}

th,
td {
  font-weight: normal;
  padding: 0.35em 0.55em;
  text-align: left;
}

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

code,
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  color: #b42318;
}

.code {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 1em 1em;
  overflow: auto;
}

blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid rgba(55, 53, 47, 0.65);
}

.callout {
  border-radius: 12px;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(55, 53, 47, 0.10);
  margin: 0.75em 0 0.9em;
  align-items: center;
}

.callout .icon {
  margin-right: 0.4em;
  font-size: 1.1em;
}

/* 视频链接使用的灰底提示框：尽量贴合文字高度 */
.block-color-gray_background.callout {
  padding: 0.2rem 0.55rem;
  margin: 0.35em 0 0.5em;
  white-space: normal !important;
  display: flex;
  align-items: center;
}

.block-color-gray_background.callout p {
  margin: 0.1em 0;
}

/* 限制该类提示框左侧图标整体的高度 */
.block-color-gray_background.callout > div:first-child {
  font-size: 1.05em !important;
}

.block-color-gray_background {
  background: rgba(240, 239, 237, 1);
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 1.2em;
  max-height: 1.2em;
  text-decoration: none;
  vertical-align: text-bottom;
  margin-right: 0.5em;
}

.link-to-page {
  margin: 0.75em 0;
}

.link-to-page > a {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 650;
}

.link-to-page > a:hover {
  background: rgba(17, 24, 39, 0.03);
}

