:root {
  text-autospace: normal;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.72;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
}

.logo {
  text-align: center;
  margin-bottom: 2px;
}

.logo img {
  width: 72px;
  height: auto;
}

h1,
h2,
h3 {
  color: #2c3e50;
}

h1 {
  margin-bottom: 10px;
}

h2 {
  margin-top: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

a {
  text-decoration: none;
}

li {
  margin-bottom: 12px;
  margin-left: -20px;
}

.summary {
  color: #666;
  font-style: italic;
  margin-bottom: 30px;
}

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

.article-content {
  line-height: 1.86;
}

/* 长篇方法论文章会包含日语 ruby 示例；提高行高，避免 rt 注音贴近上一行正文。 */
.article-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background-color: #f3f5f7;
  color: #1f2933;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95em;
  line-height: 2;
  vertical-align: baseline;
}

/* 带 ruby 的示例需要显式显示“注音单位”：整体词注音是一整块，逐字注音会拆成多个小块。 */
.article-content code.ruby-example {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.08em;
  margin: 3px 1px;
  padding: 6px 7px 5px;
  white-space: normal;
}

.article-content code.ruby-example ruby {
  padding: 0 3px 1px;
  border-radius: 4px;
  ruby-position: over;
}

.article-content code.ruby-example rt {
  font-size: 0.62em;
  line-height: 1;
}

/* 整体词注音：同一个 ruby 亲文字范围共享连续底色，例如 学校（がっこう）。 */
.article-content code.ruby-example--word ruby {
  background-color: rgba(1, 117, 194, 0.10);
  box-shadow: inset 0 -2px 0 rgba(1, 117, 194, 0.42);
}

/* 逐字/kanji-unit 注音：每个亲文字单元都有独立边界，例如 学（がっ）校（こう）。 */
.article-content code.ruby-example--split ruby {
  margin-right: 2px;
  background-color: rgba(31, 137, 91, 0.12);
  box-shadow: inset 0 0 0 1px rgba(31, 137, 91, 0.48);
}

/* 文章里的路线对照表信息密度较高，显式设置表格边界，避免移动端和深色模式下难以扫读。 */
.article-content table {
  width: 100%;
  margin: 18px 0 26px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background-color: #f7f9fb;
  color: #2c3e50;
  font-weight: 700;
}

/* OCAT 功能提示需要比普通段落更醒目，但仍保持文章页克制的阅读风格。 */
.article-callout {
  margin: 30px 0;
  padding: 16px 18px;
  border-left: 4px solid #0175c2;
  border-radius: 6px;
  background-color: rgba(1, 117, 194, 0.08);
}

/* 参考链接属于文章正文的一部分，使用紧凑间距让长 URL 来源列表不抢正文主线。 */
.article-references {
  font-size: 0.94rem;
}

.article-references li {
  margin-bottom: 8px;
}

.divider {
  height: 2px;
  background-color: #eee;
  margin: 40px 0;
}

.highlight {
  position: relative;
  display: inline;
}

.highlight::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 102%;
  height: 100%;
  background-color: rgba(1, 117, 194, 0.2);
  z-index: -1;
  border-radius: 4px;
}

.store-badges {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  align-items: center;
}

.app-store-badge {
  display: block;
  text-align: left;
  margin: 20px 0;
  max-width: 140px;
}

.play-store-badge {
  display: block;
  text-align: left;
  max-width: 134px;
}

.app-store-badge img,
.play-store-badge img {
  width: 100%;
  height: auto;
}

.app-promo {
  margin-top: 40px;
}

.blog-section {
  margin-top: 40px;
}

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

.blog-list li {
  margin-left: 0;
  padding: 12px 0;
}

.blog-list a {
  color: #2c3e50;
  font-weight: 600;
}

.blog-summary {
  margin-top: 4px;
  color: #666;
  font-size: 0.95rem;
}

.blog-read-link,
.blog-index-link,
.blog-language-links {
  margin-top: 8px;
  font-size: 0.95rem;
}

.blog-language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.blog-index-static-list li {
  padding: 14px 0;
}

.footer {
  margin-top: 48px;
  padding: 30px 0 20px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 14px;
  text-align: center;
}

.footer a {
  color: #666;
  margin: 0 8px;
}

@media (max-width: 860px) {
  body {
    padding: 20px 16px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 18px 14px;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  h1,
  h2,
  h3 {
    color: #9bbce3;
  }

  h2,
  .footer {
    border-color: #333;
  }

  .summary,
  .footer,
  .footer a {
    color: #aaa;
  }

  a {
    color: #64b5f6;
  }

  .blog-list a {
    color: #9bbce3;
  }

  .blog-summary {
    color: #c7c7c7;
  }

  .article-content code {
    background-color: #253241;
    color: #e8f1ff;
  }

  .article-content code.ruby-example--word ruby {
    background-color: rgba(100, 181, 246, 0.16);
    box-shadow: inset 0 -2px 0 rgba(100, 181, 246, 0.62);
  }

  .article-content code.ruby-example--split ruby {
    background-color: rgba(102, 187, 106, 0.16);
    box-shadow: inset 0 0 0 1px rgba(102, 187, 106, 0.68);
  }

  .article-content th,
  .article-content td {
    border-color: #344255;
  }

  .article-content th {
    background-color: #223044;
    color: #c9dcf5;
  }

  .article-callout {
    border-left-color: #64b5f6;
    background-color: rgba(100, 181, 246, 0.12);
  }

  .blog-read-link,
  .blog-index-link,
  .blog-language-links {
    color: #c7c7c7;
  }

  .divider {
    background-color: #333;
  }

  .highlight::after {
    background-color: rgba(68, 138, 255, 0.2);
  }

  .app-store-badge img {
    filter: invert(1);
  }
}
