@charset "UTF-8";

/* #region reset */

html,
body,
p,
dt,
dd,
figure,
fieldset,
blockquote,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
  font-weight: normal;
}

button,
input,
select {
  margin: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

.main {
  max-width: 767px;
}

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

video {
  height: auto;
  max-width: 100%;
}

iframe {
  border: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  padding: 0;
}

/* #endregion */

html {
  font-size: 0.9rem;
  box-sizing: border-box;
  --colors-text: rgba(0, 0, 0, 0.8);
  --colors-text-light: rgba(255, 247, 247, 1);
  --colors-muted: #b3b3b1;
  --colors-primary: #4363bb;
  --colors-divider: rgb(226, 232, 240);
  --colors-primary-light: #8ca0d4;
  --colors-code-background: rgba(39, 133, 184, 0.283);
  --colors-navbar: rgba(32, 73, 105, 1);
  --colors-background: rgba(250, 250, 255, 1);
  --colors-article: rgba(250, 250, 255, 1);
  --colors-special: rgba(8, 255, 200, 1);
}

body {
  font-family: Menlo, "PT Mono", "Arial", "Helvetica", "Helvetica Neue", "Noto Sans TC", "PingFang TC", "PingFang SC", sans-serif, Georgia;
  color: var(--color-text);
  background-color: var(--colors-background);
}

#root {
  margin-left: auto;
  margin-right: auto;
  max-width: 120rem;
}

h1,
h2,
h3,
h4,
h5 {
  padding-top: 1.4rem;
  padding-bottom: 0.4rem;
  margin-bottom: 0.2rem;
  line-height: 1.4;
  font-weight: 500;
  position: relative;
}

h1 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
}

article h1 {
  position: relative;
  padding-left: 30px;
}

article h1::before {
  /* This is necessary for the pseudo-element to be generated */
  content: "";
  position: absolute;
  width: 10px;
  height: 1.6rem;
  background-color: var(--colors-navbar);
  top: 60%;
  left: 0;
  transform: translateY(-50%);
}

article section h1 {
  font-size: 1.4rem;
}

article div h1 {
  font-size: 2rem;
  padding-left: 0;
}

article div h1:before {
  content: none;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

h4,
h5 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.2;
}

strong {
  font-weight: 600;
}

pre {
  position: relative;
  color: #e8eaed;
  background: linear-gradient(135deg, #1e2837 0%, #252d3d 100%);
  margin: 1.5rem 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  overflow: auto;
  padding-top: 3em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
              0 2px 8px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

pre:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2),
              0 4px 12px rgba(0, 0, 0, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px 12px 0 0;
}

code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.92rem;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, rgba(39, 133, 184, 0.15) 0%, rgba(39, 133, 184, 0.25) 100%);
  border: 1px solid rgba(39, 133, 184, 0.3);
  color: #2d7ab8;
  font-weight: 500;
}

pre>code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  background-color: transparent;
  background: none;
  border: none;
  display: inline-block;
  min-width: 100%;
  color: #e8eaed;
  font-weight: 400;
  /* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */
}

code td {
  padding-left: 1rem;
}

.copy-code-button {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: linear-gradient(135deg, #4a5568 0%, #3a4556 100%);
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
}

pre:hover .copy-code-button {
  opacity: 1;
  pointer-events: auto;
}

.copy-code-button:hover {
  background: linear-gradient(135deg, #5a6678 0%, #4a5566 100%);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.copy-code-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

pre.z-code {
  position: relative;
  padding: 3em 1.25rem 1rem;
  overflow: auto;
  max-width: 100%;
}

pre.z-code>code {
  display: inline-block;
  min-width: 100%;
}

hr {
  display: block;
  height: 1px;
  width: 100%;
  border: 0.5px solid var(--colors-divider);
  margin: 20px 20px
}

article ol li {
  margin-left: 0.3rem;
}

article ul li {
  margin-left: -0.7rem;
}

p {
  margin: 0.5rem 0.8rem;
  text-align: justify;
}

blockquote {
  padding: 1px 0 1px 1rem;
  margin: 1rem 0;
  font-size: 1.2rem;
  font-weight: 500;
  border-left: 5px solid var(--colors-primary);
}

blockquote p {
  margin: 0.5rem 0;
}

p,
dl,
ol,
ul {
  font-size: 1.2rem;
  line-height: 2;
}

ol,
ul {
  margin-top: 0;
  margin-bottom: 0;
}

.no-underline {
  text-decoration: none;
}

a:link {
  color: #000000;
}

a:visited {
  -webkit-transition: color 200ms ease;
  transition: color 200ms ease;
  text-decoration: none;
  color: #013127;
  text-decoration-thickness: 0.1rem;
}

.body-zone {
  flex-direction: column;
}

.no-underline:link,
.no-underline:visited,
.sidebar a:link,
.sidebar a:visited {
  text-decoration: none;
}

.no-underline:hover,
a:hover {
  color: var(--colors-primary);
  text-decoration: underline;
}

.muted {
  padding-bottom: 1.5rem;
  color: var(--colors-muted);
}

a.muted,
.muted:link,
.muted:visited {
  color: var(--colors-muted);
}

.text {
  font-size: 1.2rem;
}

.text-color,
.text-color:link,
.text-color:visited {
  color: var(--colors-text);
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.justify-between {
  justify-content: space-between;
}

.py {
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
}

.navbar-menu {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1.4rem;
  padding-left: 8px;
  position: relative;
  top: -1.5px;
  vertical-align: middle;
  color: rgb(0, 0, 0);
  white-space: nowrap;
  margin-top: 0.5rem;
  margin-bottom: 1.0rem;
}

.navbar-a:link {
  display: flex;
  align-items: center;
  color: var(--colors-text-light);
  text-decoration: none;
  padding-left: 12px;
  font-size: 16px;
}

.navbar-top {
  font-size: 1.1rem;
  position: fixed;
  display: flex;
  justify-content: space-between;
  height: 8vh;
  width: 100%;
  padding: 1.1rem;
  align-items: center;
  border-bottom: 3px solid #e9edf0;
  color: var(--colors-text-light);
  z-index: 1100;
  background-color: var(--colors-navbar);
}

article {
  padding-bottom: 0.2rem;
  background-color: var(--colors-background);
}

article:last-of-type {
  padding-bottom: 0;
}

.zola-anchor {
  margin-left: 0.5rem;
  text-decoration: none;
}

.zola-anchor:link,
.zola-anchor:visited {
  text-decoration: none;
}

.sidebar {
  border-top: 1px solid var(--colors-divider);
}

li.inline {
  display: inline-block;
  margin-right: 0.5rem;
}

.text-lg {
  font-size: 1.5rem;
}

.text-sm {
  font-size: 1rem;
}

.sidebar ul {
  margin-top: 0;
  padding-left: 1rem;
  list-style: none;
}

.sidebar li {
  font-size: 1rem;
}


.main-inner {
  padding-left: 1.4rem;
  padding-right: 1.4rem;
  border-bottom: 3px solid var(--colors-background);
  background-color: var(--colors-article);
}

.image-caption {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}

.view-count {
  font-size: 0.8rem;
  color: #777;
}

/* Table styles */
table {
  border-collapse: collapse;
  width: 100%;
}

th {
  background-color: var(--colors-header);
  color: var(--colors-header-text);
  font-weight: bold;
  padding: 0.5rem;
  text-align: left;
}

td {
  border: 1px solid var(--colors-border);
}

tr:first-child th {
  text-align: center;
}

.sort-asc::after {
  content: "▲";
  font-size: 10px;
  margin-left: 5px;
}

.sort-desc::after {
  content: "▼";
  font-size: 10px;
  margin-left: 5px;
}

.sidebar-element {
  width: 100%;
  background-color: var(--colors-article);
  padding-left: 0rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  /* box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; */
  max-width: 36vw;
  min-width: 20vw;
  margin-top: 1.4rem;
  margin-left: 0rem;
  margin-right: 0rem;
  margin-bottom: 2rem;
  display: none;
}

.sort-buttons {
  width: 95%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.sort-buttons label {
  margin-right: 0.5rem;
}

.sort-buttons select {
  margin-right: 1rem;
}

.external-link {
  position: relative;
  text-decoration: underline;
  color: #00f;
}

.external-link::after {
  content: '';
  background-image: url('/images/external-link.svg');
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 1px;
  margin-right: 1px;
  vertical-align: middle;
}

@media (min-width: 767px) {
  #root {
    display: flex;
    justify-content: center;
  }

  .main-inner {
    padding-left: 8rem;
    padding-right: 8rem;
    background-color: var(--colors-article);
    padding-top: 4.8rem;
    padding-bottom: 2.8rem;
    max-width: 64rem;
    min-width: 52rem;
    margin: 0 auto;
  }

  .no-toc {
    width: 20rem;
  }

  .main-toc {
    display: none;
  }

  .body-zone {
    flex-direction: row;
  }

  .py {
    margin-right: 10rem;
  }

  .sidebar {
    position: sticky;
    border-top: none;
    top: 60px;
    z-index: 1;
    height: 100vh;
    overflow-y: auto;
    width: 25rem;
  }

  .sidebar ul {
    border-left: 1px solid var(--colors-divider);
    list-style: none;
  }

  .sidebar li {
    font-size: 1rem;
  }

  .sidebar h2,
  .sidebar h3 {
    margin-bottom: 0;
    font-size: 1rem;
    /* font-weight: 400; */
    padding-bottom: 1rem;
    border: none;
  }

  .sidebar-element {
    display: block;
  }

  .reading-notes-table {
    width: 95%;
    margin: 0 auto;
    border-collapse: collapse;
    margin-bottom: 2rem;
  }

  .reading-notes-table th,
  .reading-notes-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9edf0;
  }

  .reading-notes-table th {
    font-weight: 600;
    background-color: #003c6d;
    color: #ffffff;
  }

  .reading-notes-table tbody tr:nth-child(odd) {
    background-color: rgba(187, 222, 214, 1);
  }

  .reading-notes-table tbody tr:nth-child(even) {
    background-color: rgba(138, 198, 209, 1);
  }

  .reading-notes-table tbody tr:hover {
    background-color: #e9edf0;
    cursor: pointer;
  }
}

/* #region Recommended Articles */

.recommended-article {
  width: 100%;
  max-width: 300px;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommended-article:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.article-image {
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-info {
  padding: 15px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.article-category {
  color: #e74c3c;
  font-weight: bold;
  text-transform: uppercase;
}

.article-relevance {
  color: #e74c3c;
  font-size: 0.85rem;
  text-align: right;
}

.article-date {
  color: #7f8c8d;
}

.article-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.article-title a {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-title a:hover {
  color: #e74c3c;
}

.cards-container {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 16px;
}

.cards-container .recommended-article {
  flex: 0 0 auto;
  width: 300px;
}

@media (max-width: 768px) {
  .recommended-article {
    max-width: 100%;
  }
}

/* #endregion */
