:root{
  color-scheme: light;
  --bg: #f6f7f4;
  --bg-soft: #eef3ef;
  --panel: #ffffff;
  --panel-alt: #f3f5f2;
  --panel-strong: #eff7f4;
  --text: #202522;
  --muted: #66716b;
  --muted-strong: #46524c;
  --line: #dfe7df;
  --line-strong: #cbd8cf;
  --accent: #187866;
  --accent-2: #b85b3f;
  --accent-soft: #e6f3ef;
  --shadow: 0 18px 45px rgba(31, 45, 38, 0.08);
  --shadow-soft: 0 10px 28px rgba(31, 45, 38, 0.06);
  --radius: 8px;
  --title-font: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
  --body-font: "IBM Plex Sans", "Noto Sans JP", "Helvetica Neue", sans-serif;
  --serif-font: "IBM Plex Serif", "Noto Serif JP", serif;
  --mono-font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*{
  box-sizing: border-box;
}

html{
  min-height: 100%;
  scroll-behavior: smooth;
}

body{
  min-height: 100%;
  margin: 0;
  font-family: var(--body-font);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(230, 243, 239, 0.85), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #fbfbf8 0%, var(--bg) 48%, #eef1ec 100%);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input{
  font: inherit;
}

.app{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid rgba(203, 216, 207, 0.9);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  backdrop-filter: blur(18px);
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-family: var(--title-font);
  font-size: 1.32rem;
  font-weight: 700;
}

.brand span{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark{
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.sidebar-section{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-label{
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.tree{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-item{
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted-strong);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tree-item:hover{
  background: rgba(230, 243, 239, 0.65);
  border-color: rgba(203, 216, 207, 0.7);
  color: var(--text);
}

.tree-item.active{
  background: var(--accent-soft);
  border-color: #b9d9cf;
  color: var(--accent);
  font-weight: 700;
}

.tree-icon{
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1;
}

.tree-svg-icon{
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.tree-item.active .tree-icon{
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.tree-item.level-1{
  padding-left: 28px;
}

.tree-item.level-2{
  padding-left: 44px;
}

.tree-subitem{
  min-height: 30px;
  padding: 5px 10px 5px 28px;
  font-size: 0.9rem;
}

.workspace{
  min-width: 0;
  padding: 42px clamp(22px, 5vw, 64px) 84px;
}

.topbar{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.breadcrumb{
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
}

.page-title{
  max-width: 780px;
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 700;
  line-height: 1.08;
}

.page-lead{
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.8;
}

.search{
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 300px);
  min-width: 240px;
  margin-top: 6px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.search span{
  white-space: nowrap;
  font-size: 0.84rem;
}

.search input{
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search:focus-within{
  border-color: #9fcfc0;
  box-shadow: 0 0 0 4px rgba(24, 120, 102, 0.12);
}

.page{
  max-width: 960px;
}

.page:has(.toc-float){
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(0, 920px) 230px;
  align-items: start;
  gap: 34px;
}

.markdown{
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3.4vw, 34px);
  line-height: 1.86;
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.article-body{
  font-size: 1.02rem;
}

.markdown > :first-child{
  margin-top: 0;
}

.markdown > :last-child{
  margin-bottom: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4{
  font-family: var(--title-font);
  font-weight: 700;
  line-height: 1.35;
  scroll-margin-top: 24px;
}

.markdown h1{
  margin: 0 0 1em;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.markdown h2{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2.25em 0 0.8em;
  padding-bottom: 0.42em;
  border-bottom: 1px solid var(--line-strong);
  font-size: 1.34rem;
}

.markdown h2::before{
  content: "";
  width: 8px;
  height: 1.25em;
  flex: 0 0 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.markdown h3{
  margin: 1.85em 0 0.7em;
  font-size: 1.13rem;
}

.markdown h4{
  margin: 1.45em 0 0.55em;
  font-size: 1rem;
}

.markdown p{
  margin: 0.85em 0;
}

.markdown a{
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(24, 120, 102, 0.32);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.markdown a:hover{
  color: #0f5f51;
  text-decoration-color: currentColor;
}

.markdown ul,
.markdown ol{
  margin: 0.9em 0;
  padding-left: 1.35em;
}

.markdown ul{
  list-style: none;
  padding-left: 0;
}

.markdown ul li,
.markdown ol li{
  margin: 0.42em 0;
}

.markdown ul li{
  position: relative;
  padding-left: 1.35em;
}

.markdown ul li::before{
  content: "";
  position: absolute;
  left: 0.18em;
  top: 0.78em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 999px;
  background: var(--accent);
}

.markdown ul ul li::before{
  background: transparent;
  border: 1px solid var(--accent);
}

.markdown code{
  border: 1px solid #d8e0d9;
  border-radius: 6px;
  background: #f5f7f4;
  padding: 0.08em 0.34em;
  color: #34403a;
  font-family: var(--mono-font);
  font-size: 0.9em;
}

.markdown pre{
  margin: 1.15em 0;
  padding: 16px 18px;
  border: 1px solid #d5ddd6;
  border-radius: var(--radius);
  background: #f2f5f2;
  overflow-x: auto;
}

.markdown pre code{
  border: 0;
  background: transparent;
  padding: 0;
}

.markdown .highlight{
  background: transparent;
}

.markdown .highlight .c,
.markdown .highlight .c1,
.markdown .highlight .cm{
  color: #68736d;
  font-style: italic;
}

.markdown .highlight .cp,
.markdown .highlight .cpf{
  color: #7a4f9a;
}

.markdown .highlight .k,
.markdown .highlight .kc,
.markdown .highlight .kd,
.markdown .highlight .kn,
.markdown .highlight .kp,
.markdown .highlight .kr{
  color: #8f3f71;
  font-weight: 700;
}

.markdown .highlight .kt{
  color: #0f6f73;
  font-weight: 700;
}

.markdown .highlight .nf,
.markdown .highlight .fm{
  color: #1d6fb8;
}

.markdown .highlight .nc,
.markdown .highlight .nn{
  color: #866118;
  font-weight: 700;
}

.markdown .highlight .s,
.markdown .highlight .s1,
.markdown .highlight .s2,
.markdown .highlight .cpf{
  color: #7a4b20;
}

.markdown .highlight .mi,
.markdown .highlight .mf,
.markdown .highlight .nb,
.markdown .highlight .bp{
  color: #2766a3;
}

.markdown .highlight .o{
  color: #59645d;
}

.markdown blockquote{
  margin: 1.1em 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #f5f8f5;
  color: var(--muted-strong);
}

.markdown blockquote strong{
  color: var(--text);
  font-weight: 700;
}

.markdown img{
  max-width: 100%;
  height: auto;
}

.article-figure{
  margin: 1.4em 0;
  min-width: 0;
  text-align: center;
}

.article-figure-grid{
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 1.4em 0;
  min-width: 0;
  max-width: 100%;
}

.article-figure-grid .article-figure{
  margin: 0;
}

.article-figure a{
  display: block;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.article-figure img{
  display: block;
  width: min(100%, 760px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.article-figure-wide img{
  width: 100%;
}

.article-figure-compact img{
  width: min(100%, 560px);
}

.article-figure figcaption{
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.card-grid{
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 28px;
}

.card{
  display: block;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.card:hover{
  transform: translateY(-2px);
  border-color: #b8d5ca;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
}

.card h3{
  margin: 0 0 5px;
  font-family: var(--title-font);
  font-size: 1.03rem;
  line-height: 1.35;
}

.card-date{
  display: block;
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.card p{
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.markdown .card,
.markdown .card:hover{
  color: inherit;
  text-decoration: none;
}

.is-filtered-out{
  display: none !important;
}

.tag-panel{
  margin-bottom: 24px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcfb 0%, #f4f7f4 100%);
}

.tag-panel-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tag-panel-toggle{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--title-font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0;
}

.tag-panel-toggle::after{
  content: "+";
  display: inline-block;
  margin-left: 8px;
  color: var(--accent);
  font-family: var(--title-font);
}

.tag-panel-toggle[aria-expanded="true"]::after{
  content: "-";
}

.tag-panel-subtitle{
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.tag-filter-list,
.card-tags,
.article-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-filter-list[hidden]{
  display: none;
}

.tag-chip,
.tag-clear,
.tag-pill{
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
}

.tag-chip,
.tag-clear{
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted-strong);
  cursor: pointer;
  padding: 6px 10px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tag-chip:hover,
.tag-clear:hover{
  transform: translateY(-1px);
  border-color: #9fcfc0;
  color: var(--text);
}

.tag-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-chip::before{
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid #9fcfc0;
  border-radius: 999px;
  background: transparent;
}

.tag-chip.active,
.tag-chip[aria-pressed="true"]{
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.tag-chip.active::before,
.tag-chip[aria-pressed="true"]::before{
  border-color: #ffffff;
  background: #ffffff;
}

.tag-clear{
  color: var(--muted);
  white-space: nowrap;
}

.tag-clear[hidden]{
  display: none;
}

.tag-pill{
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d3e2dc;
  background: var(--accent-soft);
  color: #326458;
}

.card-tags{
  margin-top: 10px;
}

.article-tags{
  margin-bottom: 18px;
}

.library-repo-link{
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.library-list{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.library-group{
  display: grid;
  gap: 18px;
}

.library-subsection h3{
  margin: 0 0 6px;
  color: var(--muted-strong);
  font-family: var(--body-font);
  font-size: 0.95rem;
  font-weight: 700;
}

.library-subsection .library-list{
  margin-bottom: 0;
}

.library-list-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.markdown .library-list-item{
  color: var(--text);
  text-decoration: none;
}

.library-list-item:hover{
  background: rgba(230, 243, 239, 0.55);
  color: var(--accent);
}

.markdown .library-list-item:hover{
  color: var(--accent);
  text-decoration: none;
}

.library-body h2{
  display: block;
  margin: 2.1em 0 0.65em;
  padding-bottom: 0.28em;
  border-bottom: 1px solid var(--line);
  font-family: var(--body-font);
  font-size: 1.22rem;
}

.library-body h2::before{
  content: none;
}

.library-body pre{
  margin: 0.85em 0;
  padding: 12px 14px;
  border-color: #d7ded8;
  border-radius: 6px;
  background: #f8faf8;
}

.library-label{
  margin: 1.05em 0 0.35em;
  font-weight: 700;
}

.tag-empty,
.empty-state{
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.section{
  margin-bottom: 34px;
}

.section-title{
  margin-bottom: 12px;
  font-family: var(--title-font);
  font-size: 1.1rem;
  font-weight: 700;
}

.note-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.note-item span{
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-links{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1em 0 0;
  padding: 0;
  list-style: none;
}

.markdown .profile-links li{
  margin: 0;
  padding-left: 0;
}

.markdown .profile-links li::before{
  content: none;
}

.profile-link{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.markdown .profile-link{
  color: var(--text);
  text-decoration: none;
}

.profile-link:hover{
  transform: translateY(-1px);
  border-color: #b8d5ca;
  box-shadow: var(--shadow-soft);
}

.markdown .profile-link:hover{
  color: var(--text);
  text-decoration: none;
}

.profile-link-logo{
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
}

.markdown .katex-display,
.markdown .math-display{
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center !important;
}

.markdown .katex-display > .katex,
.markdown .math-display-block .katex{
  display: inline-block;
  margin: 0 auto;
}

.markdown .math-display-block{
  text-align: center;
}

.theorem-block{
  max-width: 100%;
  margin: 1.25em 0;
  padding: 15px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  box-shadow: var(--shadow-soft);
}

.theorem-block[data-type="theorem"]{ background: #eff7f4; border-color: #c4dfd6; }
.theorem-block[data-type="lemma"]{ background: #f0f6f1; border-color: #cfe3d1; }
.theorem-block[data-type="corollary"]{ background: #eff4f8; border-color: #cbdce9; }
.theorem-block[data-type="property"]{ background: #f5f6ee; border-color: #dde2c7; }
.theorem-block[data-type="definition"]{ background: #f8f4ee; border-color: #e3d6c4; }
.theorem-block[data-type="conjecture"]{ background: #f8f1f4; border-color: #e6cfda; }
.theorem-block[data-type="claim"]{ background: #f5f1f8; border-color: #dbcfe7; }
.theorem-block[data-type="algorithm"]{ background: #f1f3f9; border-color: #d0d7e9; }
.theorem-block[data-type="problem"]{ background: #fbf3ef; border-color: #e7d0c5; }
.theorem-block[data-type="info"],
.theorem-block[data-type="note"]{ background: #eff6f8; border-color: #cbe0e7; }
.theorem-block[data-type="success"]{ background: #f0f7ef; border-color: #cee2ca; }

.theorem-title{
  margin-bottom: 8px;
  font-family: var(--title-font);
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--text);
}

.theorem-body{
  min-width: 0;
  max-width: 100%;
  color: var(--text);
}

.proof-block{
  margin: 1.25em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9f7;
  box-shadow: var(--shadow-soft);
}

.proof-title{
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-family: var(--title-font);
  font-size: 0.92rem;
  font-weight: 700;
}

.proof-title::-webkit-details-marker{
  display: none;
}

.proof-title::after{
  content: "+";
  float: right;
  color: var(--accent);
}

.proof-block[open] .proof-title::after{
  content: "-";
}

.proof-body{
  padding: 0 16px 14px;
}

.toc-float{
  position: sticky;
  top: 24px;
  width: 230px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 12px 0 12px 14px;
  border-left: 1px solid var(--line);
}

.toc-title{
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--title-font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc-item{
  display: block;
  position: relative;
  margin: 0;
  padding: 5px 8px 13px 18px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.toc-item::before{
  content: "";
  position: absolute;
  left: 1px;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
}

.toc-item::after{
  content: "";
  position: absolute;
  left: 4px;
  top: calc(0.85em + 8px);
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.toc-float a,
.toc-float a:hover{
  color: inherit;
  text-decoration: none;
}

.toc-item:hover{
  background: rgba(230, 243, 239, 0.55);
  color: var(--text);
}

.toc-item.active{
  color: var(--accent);
  font-weight: 700;
}

.toc-item.active::before{
  background: var(--accent);
}

.toc-h2{
  padding-left: 18px;
}

.toc-h3{
  padding-left: 30px;
  font-size: 0.8rem;
}

.toc-h3::before{
  left: 13px;
  width: 6px;
  height: 6px;
}

.toc-h3::after{
  left: 16px;
}

.meta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 0.75rem;
}

.footer{
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media screen and (max-width: 1050px){
  .app{
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .page:has(.toc-float){
    grid-template-columns: minmax(0, 1fr);
  }

  .toc-float{
    position: static;
    width: auto;
    max-height: none;
    margin-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 0;
  }
}

@media screen and (max-width: 820px){
  .app{
    display: block;
  }

  .sidebar{
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 16px;
  }

  .tree{
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tree-item{
    min-height: 34px;
    padding: 7px 9px;
  }

  .sidebar-section:last-child .tree{
    flex-direction: column;
  }

  .sidebar-section:nth-last-child(2) .tree{
    flex-direction: column;
  }

  .workspace{
    padding: 26px 16px 56px;
  }

  .topbar{
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }

  .search{
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }

  .tag-panel-header{
    flex-direction: column;
    gap: 10px;
  }

  .note-item{
    align-items: flex-start;
    flex-direction: column;
  }

  .article-figure-grid{
    grid-template-columns: 1fr;
  }

}

@media screen and (max-width: 1100px){
  .article-figure-grid{
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 560px){
  .brand{
    font-size: 1.18rem;
  }

  .page-title{
    font-size: 2rem;
  }

  .markdown{
    padding: 18px 15px;
  }

  .markdown h2{
    font-size: 1.2rem;
  }

  .card{
    padding: 13px;
  }
}
