:root {
  --green: #13795b;
  --green-bg: #eef7f3;
  --gray: #3f3f3f;
  --r: 8px;
  --line: #e3e5e8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #000;
  background: #fff;
}

/* 左侧目录，窄屏时变成顶部横向滚动条 */
#toc {
  position: fixed; top: 0; left: 0; bottom: 0; width: 210px;
  overflow-y: auto; padding: 20px 12px;
  border-right: 1px solid var(--line); background: #fafbfc;
  font-size: 14px; line-height: 1.5;
}
#toc .brand { font-weight: 700; color: var(--green); margin: 0 8px 12px; }
#toc a { display: block; padding: 4px 8px; border-radius: var(--r); color: #000; text-decoration: none; }
#toc a:hover { background: var(--green-bg); color: var(--green); }
main { margin-left: 210px; max-width: 820px; padding: 24px 40px 80px; }
@media (max-width: 860px) {
  #toc {
    position: sticky; width: auto; bottom: auto; z-index: 10;
    display: flex; gap: 4px; overflow-x: auto; white-space: nowrap;
    padding: 8px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  #toc .brand { display: none; }
  #toc a { flex: none; }
  main { margin-left: 0; padding: 16px 18px 60px; }
  html { scroll-padding-top: 56px; }
}

header h1 { font-size: 34px; margin: 8px 0 0; color: var(--green); }
header .sub { font-size: 19px; margin: 4px 0 8px; }
.hint { font-size: 16px; }
h2 { font-size: 25px; margin: 48px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--green-bg); }
h3 { font-size: 19px; margin: 24px 0 8px; }
a { color: var(--green); }
strong { color: #000; }

/* 可以点着听的 toki pona 词 */
.t {
  color: var(--green); font-weight: 600; cursor: pointer;
  border-bottom: 1px dotted var(--green);
}
.t:hover { background: var(--green-bg); }

.box {
  background: var(--green-bg); border-radius: var(--r); padding: 4px 24px 8px; margin: 20px 0;
}

/* 逐词注释的例句 */
.ex { margin: 12px 0 14px; padding: 10px 14px; border-left: 3px solid var(--green); background: #f7f8f9; border-radius: 0 var(--r) var(--r) 0; }
.ex .line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 14px; }
.ex .w { display: inline-flex; flex-direction: column; cursor: pointer; line-height: 1.35; }
.ex .w b { color: var(--green); font-size: 19px; }
.ex .w small { color: #000; font-size: 16px; }
.ex .w small.mark { color: #8a4b00; }
.ex .w:hover b { text-decoration: underline; }
.ex .zh { margin-top: 8px; font-size: 17px; }
.say {
  border: 1px solid var(--line); background: #fff; color: var(--green);
  border-radius: 50%; width: 28px; height: 28px; font-size: 11px; cursor: pointer; align-self: center;
}
.say:hover { background: var(--green-bg); }

table { border-collapse: collapse; margin: 12px 0; width: 100%; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafbfc; font-weight: 600; }
.sounds td:first-child { font-weight: 700; font-size: 19px; width: 70px; }
.vocab td:first-child { width: 40px; }
.vocab .word { font-weight: 700; color: var(--green); width: 150px; font-size: 18px; }
#q-vocab {
  width: 100%; max-width: 360px; padding: 8px 12px; font-size: 16px;
  border: 1px solid #c9cdd2; border-radius: var(--r); margin: 4px 0 8px;
}

.practice li { margin: 8px 0; }
details summary { cursor: pointer; }
details[open] summary { margin-bottom: 4px; }
details { padding: 4px 0; }
.credit { color: var(--gray); font-size: 14px; }
