@font-face {
  font-family: "Udumbara Sans";
  src: url("../assets/fonts/udumbara-sans-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* ========== CSS 自定义属性（主题变量） ========== */
:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #ddd;
  --border-light: #eee;
  --accent: #1a73e8;
  --nav-bg: rgba(250, 250, 250, 0.92);
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --shadow: rgba(0, 0, 0, 0.08);
  --progress-bar: linear-gradient(90deg, #1a73e8, #6c63ff, #e91e63);
}

[data-theme="dark"] {
  --text-primary: #f0f0f0;
  --text-secondary: #ccc;
  --bg: #121212;
  --bg-card: #1e1e1e;
  --text-primary: #f0f0f0;
  --text-secondary: #ccc;
  --text-muted: #777;
  --border: #333;
  --border-light: #2a2a2a;
  --accent: #64b5f6;
  --nav-bg: rgba(18, 18, 18, 0.92);
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --shadow: rgba(0, 0, 0, 0.3);
  --progress-bar: linear-gradient(90deg, #64b5f6, #9c27b0, #ff7043);
}
/* =============================================
   style.css — 优昙钵 个人主页
   经典简约 · 内容优先
   ============================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Udumbara Sans", "Noto Sans SC", "Noto Sans CJK SC",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: weight style;
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, textarea, select {
  font-family: inherit;
}

strong, b {
  font-weight: 700;
}

a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--text-secondary); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: #d4d4d4;
  color: #1a1a1a;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ---------- Navigation ---------- */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e8e8;
}

.nav-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  display: flex;
  align-items: center;
  white-space: nowrap;
  margin-right: auto;
  flex-shrink: 0;
}
.site-title:hover { color: #1a1a1a; }
.site-logo {
  height: 90px;
  width: 90px;
  max-height: 90px;
  max-width: 90px;
  display: block;
  transition: max-height 0.2s;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .site-logo {
    height: 60px;
    width: 60px;
    max-height: 60px;
    max-width: 60px;
  }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0;
  align-items: center;
  height: 100%;
}

.nav-links li { display: flex; align-items: center; height: 100%; }

.nav-links a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  font-size: 0.9375rem;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: #1a1a1a; }
.nav-links a.active {
  color: #1a1a1a;
  border-bottom-color: var(--text-primary);
}

.nav-links .nav-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}

.nav-links .nav-private a { color: var(--text-muted); }
.nav-links .nav-private a:hover { color: #666; }

.nav-links .nav-private .lock-icon {
  font-size: 0.75rem;
  margin-right: 3px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #1a1a1a;
  cursor: pointer;
  padding: 4px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 90;
}
 .overlay.active { display: block; }

/* ---------- Main Content ---------- */
#main-content {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}
#main-content.travel-mode {
  max-width: 1080px;
}

.section { display: none; }
.section.active { display: block; animation: sectionFadeIn 0.3s ease; }
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 1.625rem;
  font-weight: 600;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* ---------- Home ---------- */
.home-bio {
  font-size: 1.125rem;
  color: #666;
  margin-bottom: 48px;
  line-height: 1.6;
}

.home-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.home-recent h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 16px;
}
.random-btn {
  padding: 3px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.random-btn:hover {
  background: var(--border-light);
}

.home-recent-list { list-style: none; }
.home-recent-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.home-recent-list li:last-child { border-bottom: none; }
.home-recent-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.home-recent-list .item-title { font-size: 0.9375rem; }
.home-recent-list .item-date {
  font-size: 0.8125rem;
  color: #999;
  white-space: nowrap;
}

/* ---------- Home recent cards ---------- */
.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.home-subscribe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 28px 54px;
  margin-top: 54px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.home-subscribe-copy h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}
.home-subscribe-copy p {
  max-width: 460px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}
.subscribe-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-content: start;
}
.subscribe-form input[type="email"] {
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-primary);
  font: inherit;
}
.subscribe-form input[type="email"]:focus {
  outline: 2px solid rgba(26, 115, 232, 0.25);
  border-color: var(--accent);
}
.subscribe-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
  cursor: pointer;
}
.subscribe-consent input { margin-top: 2px; }
.subscribe-submit {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.subscribe-submit:disabled { cursor: wait; opacity: 0.65; }
.subscribe-status {
  grid-column: 1 / -1;
  min-height: 1.5em;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}
.subscribe-status.success { color: #2e7d32; }
.subscribe-status.error { color: #c62828; }
.home-rss-link {
  grid-column: 2;
  justify-self: start;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.home-rss-link:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .subscribe-form input[type="email"] { background: #161616; }
[data-theme="dark"] .subscribe-status.success { color: #81c784; }
[data-theme="dark"] .subscribe-status.error { color: #ef9a9a; }
.recent-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: transparent;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.recent-card:hover {
  border-color: #bbb;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}
.recent-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: #999;
}
.recent-card-arrow { color: #bbb; }
.recent-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-card-date {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: auto;
  letter-spacing: 0.02em;
}
[data-theme="dark"] .recent-card { border-color: #2e2e2e; }
[data-theme="dark"] .recent-card:hover { border-color: #555; box-shadow: none; }
[data-theme="dark"] .recent-card-title { color: #ececec; }
@media (max-width: 600px) {
  .home-recent-grid { grid-template-columns: 1fr; gap: 10px; }
  .recent-card { min-height: 0; padding: 16px; }
  .home-subscribe { grid-template-columns: 1fr; gap: 18px; margin-top: 40px; }
  .subscribe-form { grid-template-columns: 1fr; }
  .subscribe-submit { width: 100%; }
  .home-rss-link { grid-column: 1; }
}

/* ---------- Article List ---------- */
.article-item {
  padding: 24px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.article-item:first-child { padding-top: 0; }
.article-item:last-child { border-bottom: none; }
.article-item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}
.article-item .meta {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 8px;
}
.article-item .excerpt {
  font-size: 0.9375rem;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-item:hover h3 { color: #666; }
.article-item:focus-visible,
.tech-item:focus-visible,
.photo-card:focus-visible {
  outline: 2px solid var(--accent, #1a73e8);
  outline-offset: 5px;
}

.article-detail { display: none; }
.article-detail.active { display: block; }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.admin-action {
  display: none;
  padding: 6px 14px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.admin-action.admin-export {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--bg-card);
}
.admin-action.admin-export:hover {
  background: var(--border-light);
}
.export-menu {
  display: none;
  position: fixed;
  z-index: 400;
  min-width: 130px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px var(--shadow);
}
.export-menu.show {
  display: block;
}
.export-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.export-menu button:hover {
  background: var(--border-light);
}
body.is-owner .admin-action {
  display: inline-flex;
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--bg-card);
}
body.is-owner .admin-action:hover {
  background: var(--border-light);
}
body.is-owner .admin-delete:hover {
  color: #c0392b;
  border-color: #c0392b;
}

.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 24px;
  cursor: pointer;
}
.back-link:hover { color: #1a1a1a; }

.article-detail h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}
.detail-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.share-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.share-btn:hover {
  background: var(--border-light);
}
.back-to-top-detail {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.back-to-top-detail:hover {
  background: var(--border-light);
  color: var(--text-primary);
}
.post-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #eee);
}
.post-navigation-link {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border, #e7e7e7);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #777);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.post-navigation-link.previous { grid-column: 1; }
.post-navigation-link.next {
  grid-column: 2;
  text-align: right;
}
.post-navigation-link span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--text-muted, #999);
}
.post-navigation-link strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-navigation-link:hover,
.post-navigation-link:focus-visible {
  border-color: var(--text-secondary, #aaa);
  background: var(--border-light, rgba(0, 0, 0, 0.025));
  outline: none;
}
.article-detail .meta {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 28px;
}
.article-detail .body {
  font-size: 1rem;
  line-height: 1.85;
  color: #2a2a2a;
}
.article-detail .body p { margin-bottom: 1.2em; }
.article-detail .body .section-label {
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}
.article-detail .body .postscript {
  font-style: italic;
  color: #999;
  font-size: 0.9375rem;
}

/* ---------- Article TOC ---------- */
.article-toc {
  float: right;
  width: 210px;
  margin: 4px 0 24px 32px;
  padding-left: 16px;
  border-left: 1px solid #e6e6e6;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #777;
}
.article-toc summary {
  cursor: pointer;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  list-style: none;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::before {
  content: "· ";
  color: #999;
}
.article-toc a {
  display: block;
  padding: 5px 0;
  color: #777;
  text-decoration: none;
}
.article-toc a:hover { color: #1a1a1a; }
[data-theme="dark"] .article-toc { border-left-color: #333; }
[data-theme="dark"] .article-toc summary { color: #e8e8e8; }
[data-theme="dark"] .article-toc a { color: #999; }
[data-theme="dark"] .article-toc a:hover { color: #eee; }
@media (max-width: 900px) {
  .article-toc {
    float: none;
    width: auto;
    margin: 0 0 24px;
    padding: 12px 0 0;
    border-left: none;
    border-top: 1px solid #e6e6e6;
  }
}

.reader-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.75rem;
  color: #999;
}
.reader-controls button {
  border: 1px solid var(--border, #e0e0e0);
  background: transparent;
  color: var(--text-secondary, #666);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}
.reader-controls button:hover {
  color: #1a1a1a;
  border-color: #bbb;
}
.article-detail .body,
.tech-detail .body {
  font-size: var(--reader-font-size, 1rem);
  line-height: var(--reader-line-height, 1.85);
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 3000;
  padding: 8px 12px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-size: 0.8125rem;
}
.skip-link:focus {
  left: 16px;
}
:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}
[data-theme="dark"] :focus-visible {
  outline-color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.code-block {
  background: #f7f7f7;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 1.4em 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.code-block code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: #333;
  white-space: pre;
}
.tok-com { color: #9a9a9a; font-style: italic; }
.tok-str { color: #5b7f5b; }
.tok-num { color: #8a6d3b; }
.tok-kw { color: #445e8f; }
.tok-fn { color: #6b5b95; }
.content-table-wrap {
  margin: 1.5em 0;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
  -webkit-overflow-scrolling: touch;
}
.content-table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.content-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.55;
}
.content-table caption {
  padding: 11px 14px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: left;
}
.content-table th,
.content-table td {
  min-width: 88px;
  max-width: 300px;
  padding: 10px 14px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}
.content-table th {
  background: var(--border-light);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.content-table th:first-child,
.content-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}
.content-table tr:last-child td {
  border-bottom: 0;
}
.content-table th:last-child,
.content-table td:last-child {
  border-right: 0;
}
[data-theme="dark"] .reader-controls button { border-color: #333; color: #999; }
[data-theme="dark"] .code-block { background: #141414; border-color: #2a2a2a; }
[data-theme="dark"] .code-block code { color: #ddd; }
[data-theme="dark"] .tok-com { color: #777; }
[data-theme="dark"] .tok-str { color: #9bbf9b; }
[data-theme="dark"] .tok-num { color: #c9a86a; }
[data-theme="dark"] .tok-kw { color: #8fa8d8; }
[data-theme="dark"] .tok-fn { color: #b8a4dd; }
[data-theme="dark"] .content-table th {
  background: #242424;
}
[data-theme="dark"] .content-table th,
[data-theme="dark"] .content-table td {
  border-color: #333;
}
.content-formula {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 1.5em 0;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-card);
  line-height: 1.7;
}
.content-formula-label {
  flex: 0 0 auto;
  color: var(--text-primary);
  font-weight: 600;
}
.content-formula-equals {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.content-formula-expression {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .content-formula {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .content-formula-expression {
    flex-basis: 100%;
  }
}
.content-heading {
  color: var(--text-primary);
  line-height: 1.45;
  scroll-margin-top: 90px;
}
.content-heading-2 {
  margin: 1.8em 0 0.65em;
  font-size: 1.2rem;
  font-weight: 650;
}
.content-heading-3 {
  margin: 1.5em 0 0.55em;
  font-size: 1.05rem;
  font-weight: 600;
}
.content-list {
  margin: 0 0 1.25em;
  padding-left: 1.6em;
  color: var(--text-primary);
}
.content-list li {
  margin: 0.35em 0;
  padding-left: 0.15em;
}
.content-quote {
  margin: 1.5em 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
}
.content-quote p {
  margin: 0 0 0.7em;
}
.content-quote p:last-child {
  margin-bottom: 0;
}

/* ---------- Now page ---------- */
.now-intro {
  margin: 0 0 32px;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #666;
}
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.now-block {
  padding: 20px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
}
.now-block h2 {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
}
.now-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.now-block li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
  line-height: 1.65;
}
.now-block li:last-child { border-bottom: none; }
.now-updated {
  margin-top: 28px;
  font-size: 0.75rem;
  color: #aaa;
}
[data-theme="dark"] .now-block { border-color: #2e2e2e; }
[data-theme="dark"] .now-block li { border-bottom-color: #2a2a2a; }
[data-theme="dark"] .now-intro { color: #aaa; }
@media (max-width: 600px) {
  .now-grid { grid-template-columns: 1fr; }
}

.search-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
  background: rgba(26, 115, 232, 0.08);
  transition: outline-color 0.3s ease;
}
.article-detail figure,
.tech-detail figure {
  margin: 28px 0;
}
.article-detail figure img,
.tech-detail figure img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg-card);
}
.article-detail figcaption,
.tech-detail figcaption {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}
.file-attachment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
.file-attachment .file-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.file-attachment a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.file-attachment a:hover {
  text-decoration: underline;
}
.file-attachment .file-desc {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.file-preview-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.file-preview-btn:hover {
  background: var(--border-light);
}
.file-preview {
  margin-top: 10px;
  padding: 14px;
  max-height: 480px;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
.file-preview-iframe {
  width: 100%;
  height: 480px;
  border: 0;
  border-radius: 4px;
  background: #fff;
}
.file-preview-code {
  margin: 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}
.file-preview h2,
.file-preview h3,
.file-preview h4 {
  margin: 0 0 10px;
  color: var(--text-primary);
}
.file-preview p {
  margin: 0 0 10px;
  color: var(--text-primary);
}
.file-preview-space {
  height: 8px;
}
.file-preview-list-item {
  margin-left: 8px;
}
.file-preview-inline-img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 4px;
  margin: 8px 0;
}
.file-preview-table-wrap {
  overflow: auto;
}
.file-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.file-preview-table th,
.file-preview-table td {
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  text-align: left;
}
.file-preview-table th {
  background: var(--bg);
  font-weight: 600;
}
.file-preview-quote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--text-secondary);
  background: var(--bg);
  color: var(--text-secondary);
}
.file-preview-rule {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--border-light);
}
.file-preview code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
}
.file-preview-loading,
.file-preview-error {
  color: var(--text-muted);
}

/* ---------- Tech Posts ---------- */
.tech-item {
  padding: 24px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.tech-item:first-child { padding-top: 0; }
.tech-item:last-child { border-bottom: none; }
.tech-item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.tech-item .meta {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 8px;
}
.tech-item .excerpt {
  font-size: 0.9375rem;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tech-item:hover h3 { color: #666; }

.article-item.list-return-target,
.tech-item.list-return-target {
  border-radius: 8px;
  animation: list-return-highlight 1.8s ease-out;
}

@keyframes list-return-highlight {
  0% {
    background: rgba(26, 115, 232, 0.13);
    box-shadow: inset 3px 0 0 rgba(26, 115, 232, 0.7);
  }
  65% {
    background: rgba(26, 115, 232, 0.06);
    box-shadow: inset 3px 0 0 rgba(26, 115, 232, 0.25);
  }
  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
  }
}

.tech-detail { display: none; }
.tech-detail.active { display: block; }
.tech-detail h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.tech-detail .meta {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 28px;
}
.tech-detail .body {
  font-size: 1rem;
  line-height: 1.85;
  color: #2a2a2a;
}
.tech-detail .body p { margin-bottom: 1em; }

/* ---------- Travel Gallery ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.travel-year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}
.travel-year-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #666;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.travel-year-nav a span {
  font-size: 0.6875rem;
  color: #aaa;
}
.travel-year-nav a:hover {
  color: #1a1a1a;
  border-color: #bbb;
}
.travel-year-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 32px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light, #eee);
}
.travel-year:first-child .travel-year-head {
  margin-top: 14px;
}
.travel-year-label {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}
.travel-year-count {
  font-size: 0.75rem;
  color: #aaa;
}
[data-theme="dark"] .travel-year-nav a { border-color: #333; color: #999; }
[data-theme="dark"] .travel-year-head { border-top-color: #2a2a2a; }
[data-theme="dark"] .travel-year-label { color: #ececec; }
@media (max-width: 600px) {
  .travel-year-label { font-size: 1.125rem; }
  .travel-year-head { margin-top: 24px; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1921px) {
  #main-content.travel-mode {
    max-width: 2400px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

.photo-card {
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
 }
 .photo-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.photo-card:hover img { opacity: 0.92; }

.photo-card .caption {
  padding: 12px 14px;
  padding-right: 76px;
}
.photo-card .caption .photo-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.photo-card .caption .photo-meta {
  font-size: 0.8125rem;
  color: #999;
}
.photo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.photo-tag {
  padding: 1px 6px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--border-light);
  border-radius: 3px;
}
.photo-delete {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: default;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
.lightbox-counter {
  position: absolute;
  right: 24px;
  bottom: 28px;
  color: #fff;
  font-size: 0.8125rem;
}
.lightbox-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
  white-space: nowrap;
}
body.lightbox-open {
  overflow: hidden;
}
body.lightbox-open .music-dock {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Guestbook ---------- */
.guestbook-desc {
  font-size: 0.9375rem;
  color: #666;
  margin: 0 auto 28px;
  max-width: 480px;
  text-align: center;
}

.guestbook-form { max-width: 480px; margin: 0 auto; }
.guestbook-form .form-group { margin-bottom: 12px; }
.guestbook-form .btn { width: 100%; text-align: center; }
.guestbook-status {
  height: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.guestbook-status.show { opacity: 1; }
.guestbook-status.success { color: #2e7d32; }
.guestbook-status.error { color: #c62828; }
#section-guestbook .section-title { text-align: center; }
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s ease;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #999; }

.form-group textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 500;
  color: #fff;
  background: #1a1a1a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn:hover { background: #444; }
.btn:active { background: #666; }

/* ---------- AI Chat ---------- */
.ai-chat {
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 480px;
}
.ai-mode-controller {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 0;
}
body.is-owner .ai-mode-controller:not([hidden]) {
  display: flex;
}
.ai-mode-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  background: #fafafa;
}
.ai-mode-switch button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #777;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.ai-mode-switch button.active {
  background: #1a1a1a;
  color: #fff;
}
.ai-mode-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.ai-mode-meta {
  color: #999;
  font-size: 0.7rem;
  white-space: nowrap;
}
.ai-twin-notice {
  margin: 10px 12px 0;
  padding: 9px 11px;
  border: 1px solid #eadfc8;
  border-radius: 6px;
  background: #fffaf0;
  color: #795f31;
  font-size: 0.75rem;
  line-height: 1.55;
}
.ai-twin-notice[hidden] {
  display: none;
}
.ai-twin-notice button {
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ai-chat-head {
  display: flex;
  justify-content: flex-end;
  padding: 9px 12px 0;
}
.ai-new-chat {
  padding: 5px 11px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: transparent;
  color: #777;
  font-size: 0.72rem;
  cursor: pointer;
}
.ai-new-chat:hover {
  color: #222;
  border-color: #999;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-msg {
  max-width: 88%;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.6;
}
.chat-msg.user {
  margin-left: auto;
  background: #f2f2f2;
}
.chat-msg.assistant {
  margin-right: auto;
  background: #fafafa;
  border: 1px solid #eee;
}
.chat-msg .role {
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.chat-msg.user .role { color: #1a1a1a; }
.chat-msg.assistant .role { color: #666; }
.chat-msg .content {
  font-size: 0.9375rem;
  color: #2a2a2a;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-input-area {
  display: flex;
  border-top: 1px solid #eee;
  padding: 12px;
  gap: 8px;
}
.chat-input-area input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input-area input:focus { border-color: #999; }
.chat-input-area .btn {
  padding: 10px 18px;
  flex-shrink: 0;
}

.chat-status {
  font-size: 0.8125rem;
  color: #999;
  padding: 8px 20px;
  text-align: center;
}
.turnstile-slot {
  display: flex;
  justify-content: center;
  padding: 0 16px 14px;
}
.turnstile-slot:empty {
  display: none;
}
@media (max-width: 560px) {
  .ai-mode-controller {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-mode-switch {
    width: 100%;
  }
  .ai-mode-switch button {
    flex: 1;
    padding-inline: 8px;
  }
}

/* ---------- About ---------- */
.about-body {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.85;
}
.about-lead {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1.25em;
}
.about-story {
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: 40px;
}
.about-story p { margin-bottom: 1.1em; }
.about-story p:last-child { margin-bottom: 0; }
.links-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.link-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.link-card:hover {
  border-color: var(--text-secondary);
  box-shadow: 0 2px 10px var(--shadow);
}
.link-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.link-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.about-credits {
  margin: 40px 0 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}
.about-credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 40px;
}
.about-credits-grid .credits-group {
  margin-bottom: 0;
}
.credits-group { margin-bottom: 22px; }
.credits-group:last-child { margin-bottom: 0; }
.credits-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.credits-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}
.credits-label {
  min-width: 80px;
  color: var(--text-muted);
  font-feature-settings: "tnum";
}
.credits-value { color: var(--text-primary); }
.credits-current {
  margin: 2px 0 10px;
}
.credits-version {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.credits-date {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.credits-desc {
  margin-top: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.about-updates {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}
.credits-toggle {
  margin-top: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.8125rem;
  cursor: pointer;
}
.credits-history {
  margin-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--border-light);
}
.credits-history .credits-label {
  color: var(--text-primary);
  font-weight: 600;
}
.credits-history .credits-value {
  color: var(--text-secondary);
}
.about-contact {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
}
.about-contact-note {
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.about-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.about-contact-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.about-contact-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  opacity: 0.8;
}
.credits-history-item { margin-bottom: 12px; }
.credits-history-desc {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.about-updated {
  margin-top: 28px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .about-lead { font-size: 1.0625rem; }
  .about-credits-grid { grid-template-columns: 1fr; gap: 20px; }
  .credits-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 7px 0;
  }
  .credits-label { min-width: 0; }
  .about-contact-links { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- Private: Thoughts Flow ---------- */
.thought-flow {
  position: relative;
  min-height: 360px;
  margin-bottom: 32px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.thought-flow-canvas {
  position: relative;
  width: 100%;
  min-height: 360px;
}
.thought-node {
  position: absolute;
  width: 220px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thought-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--shadow);
}
.thought-node-delete {
  position: absolute;
  top: 3px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aaa;
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.thought-node:hover .thought-node-delete {
  opacity: 1;
}
.thought-node-delete:hover {
  background: #f2f2f2;
  color: #c62828;
}
@media (hover: none) {
  .thought-node-delete { opacity: 0.65; }
}
.thought-doing {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}
.thought-done {
  border-color: var(--text-secondary);
}
.thought-shelved {
  opacity: 0.55;
}
.thought-node.decision-node {
  width: 130px;
  height: 130px;
  border-radius: 0;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thought-node.decision-node:hover {
  transform: rotate(45deg) translateY(-2px);
}
.thought-node.decision-node .thought-node-label {
  transform: rotate(-45deg);
  display: block;
  text-align: center;
}
.thought-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.thought-edge {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

/* ---------- Thoughts stats / timeline ---------- */
.thought-stats { margin: 6px 0 18px; }
.thought-stat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: #777;
}
.thought-stat-total strong {
  font-size: 1.25rem;
  color: #1a1a1a;
  margin-right: 2px;
}
.thought-stat-chip {
  padding: 2px 9px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 999px;
  font-size: 0.75rem;
}
.thought-stat-chip.doing { color: #8a6d3b; border-color: #e6d7bd; }
.thought-stat-chip.done { color: #4d6b4d; border-color: #cfdccf; }
.thought-stat-chip.shelved { color: #888; }
.thought-completion {
  margin-left: auto;
  font-size: 0.75rem;
  color: #999;
}
.thought-completion strong { color: #333; font-size: 0.875rem; }
.thought-progress {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f0f0;
}
.thought-progress > div {
  height: 100%;
  background: #333;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.thought-view-switch {
  display: inline-flex;
  padding: 2px;
  margin-bottom: 16px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
}
.thought-view-switch button {
  padding: 5px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #777;
  font-size: 0.75rem;
  cursor: pointer;
}
.thought-view-switch button.active {
  background: #1a1a1a;
  color: #fff;
}
.thought-timeline { padding-left: 4px; }
.thought-timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  cursor: pointer;
}
.thought-timeline-rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.thought-timeline-rail::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: -6px;
  width: 1px;
  background: #e5e5e5;
}
.thought-timeline-item:last-child .thought-timeline-rail::after { display: none; }
.thought-timeline-dot {
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border: 2px solid #999;
  border-radius: 50%;
  background: var(--bg, #fff);
}
.thought-timeline-item.thought-done .thought-timeline-dot {
  border-color: #4d6b4d;
  background: #4d6b4d;
}
.thought-timeline-item.thought-shelved .thought-timeline-dot { border-color: #ccc; }
.thought-timeline-card {
  padding-bottom: 20px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.thought-timeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.thought-timeline-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
}
.thought-status-pill {
  padding: 1px 8px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 999px;
  font-size: 0.6875rem;
  color: #888;
  white-space: nowrap;
}
.thought-timeline-date {
  margin-top: 4px;
  font-size: 0.6875rem;
  color: #aaa;
  letter-spacing: 0.04em;
}
.thought-timeline-note {
  margin-top: 8px;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #666;
}
.thought-timeline-target {
  margin-top: 8px;
  font-size: 0.6875rem;
  color: #999;
}
[data-theme="dark"] .thought-stat-total strong,
[data-theme="dark"] .thought-timeline-title { color: #ececec; }
[data-theme="dark"] .thought-progress { background: #2a2a2a; }
[data-theme="dark"] .thought-progress > div { background: #bbb; }
[data-theme="dark"] .thought-view-switch button.active { background: #eee; color: #111; }
[data-theme="dark"] .thought-timeline-rail::after,
[data-theme="dark"] .thought-timeline-card { border-color: #2a2a2a; background-color: transparent; }
[data-theme="dark"] .thought-timeline-card { border-bottom-color: #2a2a2a; }
[data-theme="dark"] .thought-timeline-dot { background: #141414; }

.skilltree-subnav {
  margin-top: -6px;
  margin-bottom: 4px;
  text-align: right;
  font-size: 0.8125rem;
}
.skilltree-subnav a {
  color: #999;
  text-decoration: none;
}
.skilltree-subnav a:hover { color: #1a1a1a; }
[data-theme="dark"] .skilltree-subnav a:hover { color: #eee; }

.private-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.log-subnav {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg-soft, #f8f8f8);
}
.log-subnav button {
  flex: 1;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary, #666);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.log-subnav button.active {
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1a1a);
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}
.log-view[hidden] { display: none; }
[data-theme="dark"] .log-subnav { border-color: #2e2e2e; background: #171717; }
[data-theme="dark"] .log-subnav button.active { background: #202020; color: #ececec; }
.private-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.add-thought-btn {
  display: none;
  padding: 6px 14px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
body.is-owner .add-thought-btn {
  display: inline-block;
}
.thought-zoom-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.thought-zoom-btn:hover {
  background: var(--border-light);
}
.add-thought-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
}
.add-thought-form input,
.add-thought-form textarea,
.add-thought-form select {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
}
.add-thought-form textarea {
  min-height: 80px;
  resize: vertical;
}
.thought-form-actions {
  display: flex;
  gap: 8px;
}
.thought-modal,
.rss-modal,
.copy-link-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 600;
}
.thought-modal-card,
.rss-modal-card,
.copy-link-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: 0 8px 30px var(--shadow);
}
.thought-modal-close,
.site-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.thought-modal-card h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
}
.thought-modal-card p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.thought-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.rss-modal-card {
  max-width: 720px;
  max-height: min(82vh, 760px);
  padding: 28px;
  overflow: auto;
}
.rss-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rss-modal-card h2,
.copy-link-card h2 {
  margin: 0 0 10px;
  padding-right: 40px;
  font-size: 1.35rem;
}
.rss-intro,
.copy-link-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}
.rss-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.75rem;
}
.rss-actions a { color: var(--accent); }
.rss-copy-btn,
.copy-link-primary {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}
.rss-copy-btn:hover,
.copy-link-primary:hover { border-color: var(--accent); }
.rss-list {
  display: grid;
  gap: 0;
}
.rss-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.rss-item:last-child { border-bottom: 0; }
.rss-item-meta {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.rss-item > a,
.rss-item > strong {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}
.rss-item > a:hover { color: var(--accent); }
.rss-item p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.65;
}
.rss-empty {
  padding: 24px 0;
  color: var(--text-muted);
}
.copy-link-card {
  max-width: 520px;
}
.copy-link-card input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.8125rem;
}
.copy-link-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.copy-link-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#copyLinkStatus,
#rssCopyStatus {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.38);
}
.share-sheet-card {
  width: min(520px, 100%);
  padding: 10px 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}
.share-sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--border);
}
.share-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.share-sheet-head strong { font-size: 0.95rem; }
.share-sheet-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.share-sheet-action {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  width: 100%;
  padding: 13px 10px;
  border: 0;
  border-top: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.share-sheet-action > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--accent);
  font-size: 1.15rem;
}
.share-sheet-action > strong { font-size: 0.875rem; line-height: 1.4; }
.share-sheet-action > small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.share-sheet-status {
  min-height: 1.5em;
  padding: 8px 10px 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: center;
}
@media (max-width: 600px) {
  .rss-modal,
  .copy-link-modal { padding: 12px; }
  .rss-modal-card,
  .copy-link-card {
    max-height: 88vh;
    padding: 22px 18px;
  }
  .rss-actions { align-items: flex-start; }
  .share-sheet { padding: 0; }
  .share-sheet-card {
    width: 100%;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }
}

/* ---------- Private: Stats ---------- */
.private-stats { margin: 0 0 26px; }
.stats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eee;
}
.stats-head h2 { margin: 0; font-size: 1rem; }
.stats-head span { font-size: 0.6875rem; color: #aaa; }
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.stats-card {
  padding: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
}
.stats-card strong {
  display: block;
  font-size: 1.375rem;
  color: #1a1a1a;
}
.stats-card span { font-size: 0.6875rem; color: #999; }
.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.stats-columns h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
}
.stats-list { margin: 0; padding: 0; list-style: none; }
.stats-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.8125rem;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list em { font-style: normal; font-size: 0.6875rem; color: #aaa; }
.stats-empty { margin: 0; font-size: 0.75rem; color: #aaa; }
.analytics-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.analytics-level-card {
  padding: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 9px;
  background: var(--bg-card, #fff);
}
.analytics-level-card.is-primary {
  border-color: var(--text-secondary, #999);
}
.analytics-level-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--text-primary, #1a1a1a);
}
.analytics-level-card span {
  display: block;
  margin-top: 7px;
  font-size: 0.75rem;
  color: var(--text-primary, #1a1a1a);
}
.analytics-level-card small {
  display: block;
  margin-top: 3px;
  font-size: 0.6875rem;
  color: var(--text-muted, #999);
}
.analytics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 10px;
}
.analytics-tabs button {
  padding: 6px 13px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary, #666);
  cursor: pointer;
}
.analytics-tabs button.active {
  border-color: var(--text-primary, #1a1a1a);
  background: var(--text-primary, #1a1a1a);
  color: var(--bg-card, #fff);
}
.analytics-detail {
  padding: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 9px;
}
.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.analytics-metric {
  padding: 10px 12px;
  background: var(--bg-soft, #f8f8f8);
  border-radius: 7px;
}
.analytics-metric strong {
  display: block;
  font-size: 1.15rem;
  color: var(--text-primary, #1a1a1a);
}
.analytics-metric span {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
}
.analytics-metric small {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--text-muted, #999);
}
.analytics-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.analytics-columns h4 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #999);
}
.analytics-note {
  margin: 12px 0 0;
  font-size: 0.7rem;
  color: var(--text-muted, #999);
}
.analytics-recent {
  margin-top: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 9px;
  padding: 0 14px;
}
.analytics-recent summary {
  padding: 12px 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.analytics-visitor-table-wrap {
  max-height: 460px;
  overflow: auto;
  padding-bottom: 14px;
}
.analytics-visitor-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.72rem;
}
.analytics-visitor-table th,
.analytics-visitor-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--border-light, #eee);
  text-align: left;
  vertical-align: top;
}
.analytics-visitor-table th {
  position: sticky;
  top: 0;
  background: var(--bg-card, #fff);
  color: var(--text-muted, #999);
  z-index: 1;
}
.analytics-visitor-table small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted, #999);
}
.analytics-ua {
  max-width: 280px;
  word-break: break-all;
}
[data-theme="dark"] .stats-head { border-bottom-color: #2a2a2a; }
[data-theme="dark"] .stats-card { border-color: #2e2e2e; }
[data-theme="dark"] .stats-card strong { color: #ececec; }
[data-theme="dark"] .stats-list li { border-bottom-color: #2a2a2a; }
[data-theme="dark"] .analytics-detail,
[data-theme="dark"] .analytics-level-card,
[data-theme="dark"] .analytics-recent {
  border-color: #2e2e2e;
}
@media (max-width: 1100px) {
  .analytics-level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .analytics-level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-level-grid .is-primary { grid-column: span 2; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-detail { padding: 12px; }
}

.stats-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 10%, rgba(111, 143, 112, 0.12), transparent 35%),
    var(--bg-card, #fff);
}
.stats-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted, #999);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.stats-hero h2 {
  margin: 0;
  color: var(--text-primary, #1a1a1a);
  font-size: 1.45rem;
}
.stats-hero p {
  margin: 7px 0 0;
  color: var(--text-secondary, #666);
  font-size: 0.78rem;
}
.stats-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.stats-hero-actions span {
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.stats-hero-actions button {
  padding: 7px 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 7px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
}
.analytics-subnav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg-soft, #f8f8f8);
}
.analytics-subnav button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary, #666);
  font-size: 0.78rem;
  cursor: pointer;
}
.analytics-subnav button.active {
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1a1a);
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}
.analytics-period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}
.analytics-period-bar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.analytics-control-label {
  color: var(--text-muted, #999);
  font-size: 0.7rem;
  font-weight: 600;
}
#analyticsPeriodSelect {
  min-width: 180px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 7px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1a1a);
  font: inherit;
}
.analytics-range-copy {
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-align: right;
}
.analytics-range-copy strong {
  color: var(--text-primary, #1a1a1a);
  font-size: 0.8rem;
}
.analytics-range-copy span {
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.analytics-detail {
  padding: 0;
  border: 0;
}
.analytics-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}
.analytics-metric {
  padding: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}
.analytics-metric strong {
  font-size: 1.4rem;
  font-weight: 700;
}
.analytics-metric span {
  margin-top: 5px;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.74rem;
  font-weight: 600;
}
.analytics-metric small {
  margin-top: 4px;
  line-height: 1.45;
}
.analytics-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.analytics-group {
  padding: 16px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 11px;
  background: var(--bg-card, #fff);
}
.analytics-group > header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #eee);
}
.analytics-group h4 {
  margin: 0;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.86rem;
}
.analytics-group > header p {
  margin: 4px 0 0;
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.analytics-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.analytics-dimension h5 {
  margin: 0 0 7px;
  color: var(--text-muted, #999);
  font-size: 0.68rem;
  font-weight: 600;
}
.analytics-dimension .stats-list li {
  padding: 5px 0;
  font-size: 0.73rem;
}
.analytics-dimension .stats-list li span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.analytics-dimension .stats-list li em {
  flex: none;
  color: var(--text-primary, #1a1a1a);
  font-weight: 600;
}
.analytics-visitor-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 11px;
  background: var(--bg-card, #fff);
}
.analytics-visitor-head h3 {
  margin: 0;
  color: var(--text-primary, #1a1a1a);
  font-size: 1rem;
}
.analytics-visitor-head p {
  margin: 5px 0 0;
  color: var(--text-secondary, #666);
  font-size: 0.73rem;
}
.analytics-visitor-head > span {
  flex: none;
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.analytics-visitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.analytics-visitor-card {
  padding: 15px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 11px;
  background: var(--bg-card, #fff);
}
.analytics-visitor-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #eee);
}
.analytics-visitor-card header code {
  color: var(--text-primary, #1a1a1a);
  font-size: 0.8rem;
  font-weight: 700;
}
.analytics-visitor-card header small,
.analytics-visitor-card time {
  display: block;
  margin-top: 4px;
  color: var(--text-muted, #999);
  font-size: 0.66rem;
}
.analytics-visitor-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.analytics-visitor-facts div {
  min-width: 0;
}
.analytics-visitor-facts span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted, #999);
  font-size: 0.63rem;
}
.analytics-visitor-facts strong,
.analytics-visitor-facts small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.7rem;
  line-height: 1.45;
}
.analytics-visitor-facts small {
  color: var(--text-secondary, #666);
}
.analytics-visitor-card details {
  margin-top: 11px;
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.analytics-visitor-card details summary {
  cursor: pointer;
}
.analytics-visitor-card .analytics-ua {
  display: block;
  margin-top: 7px;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-soft, #f8f8f8);
  white-space: normal;
}

.analytics-cumulative {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  background: var(--bg-card, #fff);
}
.analytics-cumulative > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.analytics-cumulative h3 {
  margin: 0;
  color: var(--text-primary, #1a1a1a);
  font-size: 1rem;
}
.analytics-cumulative header p {
  margin: 5px 0 0;
  color: var(--text-secondary, #666);
  font-size: 0.72rem;
}
.analytics-cumulative > header > span {
  flex: none;
  color: var(--text-muted, #999);
  font-size: 0.66rem;
}
.analytics-cumulative .analytics-content-strip { margin: 0 0 14px; }
.analytics-cumulative-columns { padding: 0; }

.analytics-visitor-panel {
  margin-top: 14px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  background: var(--bg-card, #fff);
}
.analytics-visitor-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
}
.analytics-visitor-panel > summary div { min-width: 0; }
.analytics-visitor-panel > summary strong {
  display: block;
  font-size: 0.9rem;
}
.analytics-visitor-panel > summary span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary, #666);
  font-size: 0.7rem;
}
.analytics-visitor-panel > summary em {
  flex: none;
  color: var(--text-muted, #999);
  font-size: 0.68rem;
  font-style: normal;
}
.analytics-visitor-panel-body { padding: 0 14px 14px; }
.analytics-retention-note {
  margin: 0 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #eee);
  color: var(--text-muted, #999);
  font-size: 0.68rem;
}
.analytics-visitor-item {
  margin-top: 9px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 9px;
  background: var(--bg-soft, #fafafa);
}
.analytics-visitor-item > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.analytics-visitor-item > summary div { min-width: 0; }
.analytics-visitor-item code {
  display: block;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.72rem;
  font-weight: 700;
}
.analytics-visitor-item > summary strong,
.analytics-visitor-item > summary span {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.69rem;
}
.analytics-visitor-item > summary strong { color: var(--text-primary, #1a1a1a); }
.analytics-visitor-item > summary span { color: var(--text-secondary, #666); }
.analytics-visitor-item > summary time {
  flex: none;
  color: var(--text-muted, #999);
  font-size: 0.66rem;
}
.analytics-visitor-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
.analytics-visitor-category {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 8px;
  background: var(--bg-card, #fff);
}
.analytics-visitor-category h5 {
  margin: 0 0 8px;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.74rem;
}
.analytics-fact-list {
  display: grid;
  gap: 0;
  margin: 0;
}
.analytics-fact-list > div {
  display: grid;
  grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-light, #f0f0f0);
}
.analytics-fact-list > div:first-child { border-top: 0; }
.analytics-fact-list dt {
  color: var(--text-muted, #999);
  font-size: 0.64rem;
}
.analytics-fact-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.68rem;
  line-height: 1.5;
}
[data-theme="dark"] .analytics-cumulative,
[data-theme="dark"] .analytics-visitor-panel,
[data-theme="dark"] .analytics-visitor-category {
  border-color: #2e2e2e;
}
[data-theme="dark"] .analytics-visitor-item { border-color: #2e2e2e; background: #171717; }
[data-theme="dark"] .analytics-retention-note,
[data-theme="dark"] .analytics-visitor-category,
[data-theme="dark"] .analytics-fact-list > div { border-color: #2a2a2a; }
[data-theme="dark"] .analytics-visitor-category { background: #1d1d1d; }
@media (max-width: 700px) {
  .analytics-cumulative > header,
  .analytics-visitor-panel > summary,
  .analytics-visitor-item > summary {
    flex-direction: column;
    gap: 6px;
  }
  .analytics-visitor-categories { grid-template-columns: 1fr; padding: 0 10px 10px; }
  .analytics-fact-list > div { grid-template-columns: 1fr; gap: 2px; }
  .analytics-visitor-item > summary time { align-self: flex-start; }
}
.analytics-empty-panel,
.stats-loading {
  margin-top: 12px;
  padding: 28px 20px;
  border: 1px dashed var(--border, #ddd);
  border-radius: 11px;
  color: var(--text-secondary, #666);
  text-align: center;
}
.analytics-empty-panel strong {
  color: var(--text-primary, #1a1a1a);
}
.analytics-empty-panel p {
  margin: 7px 0 0;
  font-size: 0.72rem;
}
.stats-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.stats-loading i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border, #ddd);
  border-top-color: var(--text-primary, #1a1a1a);
  border-radius: 50%;
  animation: statsSpin 0.8s linear infinite;
}
@keyframes statsSpin { to { transform: rotate(360deg); } }
.analytics-more {
  margin-top: 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 11px;
  background: var(--bg-card, #fff);
}
.analytics-more > summary {
  padding: 13px 15px;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.analytics-content-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  margin: 0 15px 14px;
  overflow: hidden;
  border: 1px solid var(--border-light, #eee);
  border-radius: 8px;
  background: var(--border-light, #eee);
}
.analytics-content-strip span {
  padding: 10px 8px;
  background: var(--bg-card, #fff);
  color: var(--text-muted, #999);
  font-size: 0.63rem;
  text-align: center;
}
.analytics-content-strip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary, #1a1a1a);
  font-size: 0.95rem;
}
.analytics-more .analytics-columns {
  padding: 0 15px 15px;
}
[data-theme="dark"] .stats-hero,
[data-theme="dark"] .analytics-period-bar,
[data-theme="dark"] .analytics-metric,
[data-theme="dark"] .analytics-group,
[data-theme="dark"] .analytics-visitor-head,
[data-theme="dark"] .analytics-visitor-card,
[data-theme="dark"] .analytics-more,
[data-theme="dark"] .analytics-subnav {
  border-color: #2e2e2e;
}
[data-theme="dark"] .analytics-subnav {
  background: #171717;
}
[data-theme="dark"] .analytics-subnav button.active,
[data-theme="dark"] .stats-hero-actions button,
[data-theme="dark"] #analyticsPeriodSelect {
  background: #202020;
  color: #ececec;
}
@media (max-width: 900px) {
  .analytics-groups,
  .analytics-visitor-grid {
    grid-template-columns: 1fr;
  }
  .analytics-content-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .stats-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 17px;
  }
  .stats-hero-actions {
    width: 100%;
    justify-content: space-between;
  }
  .analytics-subnav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .analytics-subnav::-webkit-scrollbar { display: none; }
  .analytics-subnav button {
    flex: 0 0 auto;
    min-width: 62px;
    padding: 0 12px;
  }
  .analytics-period-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
  .analytics-period-bar > div:first-child,
  .analytics-range-copy {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }
  #analyticsPeriodSelect {
    min-width: 0;
    flex: 1;
  }
  .analytics-group {
    padding: 14px;
  }
  .analytics-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-visitor-facts {
    grid-template-columns: 1fr;
  }
  .analytics-content-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Private: Log ---------- */
.log-month-header {
  font-weight: 700;
  font-size: 1.125rem;
  padding: 16px 0 8px;
  margin-top: 8px;
  color: #1a1a1a;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.log-month-section {
  margin-bottom: 4px;
}
.log-month-header {
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 0;
  cursor: pointer;
  color: #1a1a1a;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
  user-select: none;
}
.log-month-header:hover {
  color: #555;
}
.month-arrow {
  display: inline-block;
  font-size: 0.75rem;
  margin-right: 6px;
  transition: transform 0.2s;
}
.log-month-entries {
  padding-left: 4px;
}

.log-entry {
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}
.log-entry:last-child { border-bottom: none; }
.log-entry .log-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.log-entry .log-detail {
  font-size: 0.9375rem;
  color: #2a2a2a;
  line-height: 1.7;
}
.log-entry .log-detail p {
  white-space: pre-line;
}
.log-entry .log-detail .label {
  color: #666;
  font-weight: 500;
}

.log-month-name {
  font-size: 0.8125rem;
  color: var(--text-secondary, #777);
  letter-spacing: 0.04em;
}
.log-theme {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-left: 12px;
  color: #1a1a1a;
  letter-spacing: 0.03em;
}
.log-month-count {
  float: right;
  font-size: 0.75rem;
  font-weight: 400;
  color: #aaa;
  margin-top: 3px;
}
.log-theme-sub {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #888;
  margin-top: 6px;
  line-height: 1.55;
}
[data-theme="dark"] .log-theme { color: #ececec; }
[data-theme="dark"] .log-theme-sub { color: #9a9a9a; }
[data-theme="dark"] .log-month-name { color: #9a9a9a; }
@media (max-width: 600px) {
  .log-theme {
    display: block;
    margin: 6px 0 0 20px;
  }
  .log-month-count {
    float: none;
    display: inline-block;
    margin-left: 20px;
  }
}

/* ---------- Private: Thoughts ---------- */
.thoughts-body {
  font-size: 1rem;
  color: #2a2a2a;
  line-height: 1.85;
}
.thoughts-body p { margin-bottom: 1em; }

.thought-capture {
  margin: 4px 0 18px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-card);
}

.thought-capture-label {
  display: block;
  margin-bottom: 9px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.thought-capture-row {
  display: flex;
  gap: 8px;
}

.thought-capture input {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
}

.thought-capture input:focus {
  border-color: var(--text-secondary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-secondary) 12%, transparent);
}

.thought-capture button {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 1px solid var(--text-primary);
  border-radius: 7px;
  background: var(--text-primary);
  color: var(--bg-card);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.thought-capture button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.thought-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.thought-overview strong {
  margin-right: 2px;
  color: var(--text-primary);
  font-size: 1rem;
}

.thought-thread-section {
  margin: 28px 0;
}

.thought-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.thought-section-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.thought-section-head span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.thought-thread {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
}

.thought-thread-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: start;
  gap: 5px 12px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.thought-thread-toggle:hover {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.thought-thread-title {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.thought-thread-toggle .thought-status-pill {
  justify-self: end;
}

.thought-thread-meta {
  grid-column: 1 / 3;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.thought-thread-arrow {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

.thought-thread-next {
  margin: 0 14px 13px;
  padding: 8px 10px;
  border-left: 2px solid var(--text-secondary);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.55;
}

.thought-thread-next span {
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thought-thread-detail {
  padding: 16px 14px 4px;
  border-top: 1px solid var(--border-light);
}

.thought-thread-detail .thought-timeline {
  margin-left: 2px;
}

.thought-thread-add {
  margin: 0 0 12px 36px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
}

.thought-thread-add:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.thought-seed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.thought-seed-card {
  padding: 13px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
}

.thought-seed-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
}

.thought-seed-meta {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.thought-seed-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.thought-seed-actions button {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
}

.thought-seed-actions button:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.thought-archive {
  margin-top: 24px;
  border-top: 1px solid var(--border-light);
}

.thought-archive > summary {
  padding: 14px 2px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  list-style-position: inside;
}

.thought-archive > summary span {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.thought-legacy .thoughts-body {
  padding: 4px 2px 0;
}

.thought-empty {
  margin: 0;
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.thought-flow-tools {
  display: flex;
  gap: 7px;
  margin: 0 0 12px;
}

.thought-seed {
  border-color: #d8c99a;
}

[data-theme="dark"] .thought-capture,
[data-theme="dark"] .thought-thread,
[data-theme="dark"] .thought-seed-card {
  background: var(--bg-card);
}

[data-theme="dark"] .thought-capture button {
  background: #ececec;
  border-color: #ececec;
  color: #151515;
}

@media (max-width: 640px) {
  .thought-capture {
    padding: 14px;
  }

  .thought-capture-row {
    flex-direction: column;
  }

  .thought-capture button {
    min-height: 38px;
  }

  .thought-seed-grid {
    grid-template-columns: 1fr;
  }

  .thought-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .thought-thread-toggle {
    grid-template-columns: minmax(0, 1fr) 22px;
  }

  .thought-thread-toggle .thought-status-pill {
    grid-column: 1;
    justify-self: start;
  }

  .thought-thread-meta {
    grid-column: 1;
  }

  .thought-thread-arrow {
    grid-column: 2;
    grid-row: 1 / 4;
  }
}

/* ---------- Private Section Blur Overlay ---------- */
.private-section {
  position: relative;
  min-height: 300px;
}

.private-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(250, 250, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 4px;
  min-height: 300px;
  will-change: backdrop-filter;
  transform: translateZ(0);
}
.private-overlay.hidden { display: none; }

.unlock-box {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.unlock-box p {
  font-size: 0.9375rem;
  color: #444;
  margin-bottom: 16px;
}

.unlock-box input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
  margin-bottom: 12px;
  text-align: center;
  background: rgba(255,255,255,0.8);
}
.unlock-box input:focus { border-color: #999; }

.unlock-box .btn { width: 100%; }
.private-toolbar { margin-bottom: 12px; }
.btn-lock {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.admin-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.admin-toast.success { background: rgba(30, 120, 60, 0.92); }
.admin-toast.error { background: rgba(190, 50, 40, 0.92); }

.unlock-error {
  font-size: 0.8125rem;
  color: #c0392b;
  margin-top: 8px;
  display: none;
}
.unlock-error.show { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.8125rem;
  color: #bbb;
  border-top: 1px solid #eee;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-inner { height: 56px; padding: 0 16px; }
  .mobile-menu-btn { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid #e8e8e8;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 8px 0;
    z-index: 95;
  }
  .nav-links.open { display: flex; }
  .nav-links li {
    display: block;
    width: 100%;
    height: auto;
  }
  .nav-links a {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px 20px;
    border-bottom: none;
    font-size: 0.9375rem;
  }
  .nav-links a.active {
    border-bottom: none;
    background: #f0f0f0;
  }
  .nav-links .nav-sep {
    width: auto;
    height: 1px;
    margin: 4px 20px;
    background: var(--border-light);
  }

  #main-content { padding: 32px 16px 60px; }

  .section-title {
    font-size: 1.375rem;
    margin-bottom: 24px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ai-chat { height: 400px; }

  .home-recent-list a {
    flex-direction: column;
    gap: 2px;
  }

  .lightbox { padding: 20px; }
}

@media (min-width: 769px) {
  .nav-links { display: flex !important; }
}

@media (min-width: 769px) and (max-width: 900px) {
  .nav-inner { padding-inline: 16px; }
  .site-logo { width: 72px; height: 72px; max-width: 72px; max-height: 72px; }
  .nav-links a { padding-inline: 8px; font-size: 0.8125rem; }
  .nav-links .nav-sep { margin-inline: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
 
 /* ---------- Tags ---------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  line-height: inherit;
  color: #666;
  background: #f0f0f0;
  border: 0;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.tag:hover { background: #e0e0e0; }
.tag.active { background: #1a1a1a; color: #fff; }

.tag-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.tag-filter-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}
.tag-filter-label {
  flex: 0 0 46px;
  font-size: 0.8125rem;
  color: #999;
  line-height: 24px;
}
.category-filter {
  border: 1px solid #ddd;
  background: transparent;
}
.category-filter.active {
  border-color: #1a1a1a;
}
.category-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 4px;
  margin-bottom: 4px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: transparent;
  color: #444;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
}
.content-tax-link {
  cursor: pointer;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.content-tax-link:hover,
.content-tax-link:focus-visible {
  border-color: #777;
  background: rgba(120, 120, 120, 0.08);
  color: #111;
  outline: none;
}
.tag.content-tax-link {
  border: 1px solid transparent;
}
.topic-more-toggle {
  border: 1px dashed #ccc;
  background: transparent;
  color: #666;
}
.topic-more-toggle:hover,
.topic-more-toggle:focus-visible {
  border-color: #999;
  background: #f5f5f5;
  outline: none;
}
[data-theme="dark"] .topic-more-toggle {
  border-color: #444;
  color: #bbb;
}
[data-theme="dark"] .topic-more-toggle:hover,
[data-theme="dark"] .topic-more-toggle:focus-visible {
  border-color: #777;
  background: #282828;
}
.topic-more-group {
  display: contents;
}
.topic-more-group[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .content-tax-link {
    min-height: 30px;
    padding: 5px 10px;
  }
}

/* ---------- Search ---------- */
.search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: #999; }

.content-link {
  color: #1a73e8;
  text-decoration: underline;
  cursor: pointer;
}
.content-link:hover {
  color: #1659b7;
  text-decoration: none;
}

.search-result-item {
  padding: 16px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.search-result-item .section-type {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.search-result-item .meta {
  font-size: 0.8125rem;
  color: #999;
}
.search-result-item:hover h3 { color: #666; }
.search-highlight { background: #fff3cd; }

/* ---------- UC / 夸克 fallback ---------- */
@supports not ((-webkit-backdrop-filter: blur(18px)) or (backdrop-filter: blur(18px))) {
  .private-overlay { background: rgba(250, 250, 250, 0.85); }
  .unlock-box { background: rgba(255, 255, 255, 0.9); border: 1px solid #ddd; }
  #navbar { background: var(--bg); }
}

/* ========== 深色模式专用覆盖 ========== */
[data-theme="dark"] body {

  background: var(--bg);
  color: #ffffff;
}

[data-theme="dark"] .site-logo { filter: brightness(0) invert(1) ; }[data-theme="dark"] #navbar {
  background: var(--nav-bg);
}
[data-theme="dark"] .nav-links a {
  color: #ffffff;
}
[data-theme="dark"] .nav-links a:hover {
  color: var(--text-primary);
}
[data-theme="dark"] .nav-links .nav-private a {
  color: #999;
}
[data-theme="dark"] .nav-links a.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}
[data-theme="dark"] .nav-links .nav-sep {
  background: var(--border);
}
[data-theme="dark"] .mobile-menu-btn {
  color: var(--text-primary);
}
[data-theme="dark"] .nav-links.open,
[data-theme="dark"] .nav-links {
  background: var(--bg-card);
}
[data-theme="dark"] .nav-links a.active {
  background: #2a2a2a;
}
[data-theme="dark"] .unlock-box {
  background: rgba(30, 30, 30, 0.9);
  border-color: var(--border);
}
[data-theme="dark"] .private-overlay {
  background: rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] input, [data-theme="dark"] textarea {
  background: #2a2a2a;
  color: var(--text-primary);
  border-color: var(--border);
}
[data-theme="dark"] .chat-msg.assistant {
  background: #2a2a2a;
}
[data-theme="dark"] .chat-msg.user {
  background: #1a3a5c;
}
[data-theme="dark"] .lightbox {
  background: rgba(0, 0, 0, 0.85);
}
[data-theme="dark"] .search-input {
  background: #2a2a2a;
  color: var(--text-primary);
  border-color: var(--border);
}
[data-theme="dark"] .search-result-item:hover {
  background: #2a2a2a;
}
[data-theme="dark"] .tag {
  background: #2a2a2a;
  color: var(--text-secondary);
}
[data-theme="dark"] .category-filter {
  background: transparent;
  border-color: #555;
}
[data-theme="dark"] .category-filter.active {
  border-color: var(--accent);
}
[data-theme="dark"] .category-badge {
  color: #ddd;
  border-color: #555;
}
[data-theme="dark"] .content-tax-link:hover,
[data-theme="dark"] .content-tax-link:focus-visible {
  border-color: #888;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
[data-theme="dark"] .filter-tag.active {
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .photo-meta {
  color: var(--text-muted);
}
[data-theme="dark"] .site-footer {
  color: var(--text-muted);
}
[data-theme="dark"] .log-month-header {
  color: var(--text-primary);
}
[data-theme="dark"] .content-link {
  color: var(--accent);
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1e1e1e;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #444;
}

/* ========== 阅读进度条 ========== */
#progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(128, 128, 128, 0.18);
  z-index: 9999;
}
#progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--progress-bar);
  transition: width 0.1s ease;
  box-shadow: 0 0 8px rgba(233, 30, 99, 0.35);
}

/* ========== 天气问候 ========== */
.home-greeting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}
.home-greeting .greeting-icon {
  font-size: 1rem;
}

/* ========== 深色模式切换按钮 ========== */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s;
}
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  margin-left: 8px;
}
@media (max-width: 768px) {
  .theme-toggle-wrap {
    margin-left: auto;
    margin-right: 4px;
  }
}

/* ========== 阅读量统计 ========== */
.view-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

[data-theme="dark"] .home-recent-list a {
  color: var(--text-primary);
}
[data-theme="dark"] .home-recent-list .item-title {
  color: var(--text-primary);
}
[data-theme="dark"] .home-recent-list .item-date {
  color: var(--text-secondary);
}
[data-theme="dark"] .article-item, [data-theme="dark"] .tech-item {
  color: var(--text-primary);
}
[data-theme="dark"] .article-detail .body p, [data-theme="dark"] .tech-detail .body p {
  color: var(--text-primary);
}
[data-theme="dark"] .about-body {
  color: var(--text-primary);
}
[data-theme="dark"] .log-entry .log-detail p {
  color: var(--text-primary);
}
[data-theme="dark"] .log-entry .label {
  color: var(--text-secondary);
}
[data-theme="dark"] .log-date {
  color: #ffffff;
  font-weight: 600;
}
[data-theme="dark"] .thoughts-body p {
  color: var(--text-primary);
}
[data-theme="dark"] .section-label {
  color: var(--text-primary);
}
[data-theme="dark"] .postscript {
  color: var(--text-secondary);
}
[data-theme="dark"] .home-bio {
  color: var(--text-secondary);
}
[data-theme="dark"] .guestbook-desc {
  color: var(--text-secondary);
}
[data-theme="dark"] .ai-chat {
  background: var(--bg-card);
}
[data-theme="dark"] .ai-mode-switch {
  background: #242424;
  border-color: var(--border);
}
[data-theme="dark"] .ai-mode-switch button.active {
  background: #eee;
  color: #1a1a1a;
}
[data-theme="dark"] .ai-twin-notice {
  border-color: #5b513e;
  background: #302b23;
  color: #d8c59d;
}
[data-theme="dark"] .chat-messages {
  background: var(--bg-card);
}
[data-theme="dark"] .chat-input-area {
  background: var(--bg-card);
  border-top-color: var(--border);
}
[data-theme="dark"] .chat-input-area input {
  background: #2a2a2a;
  color: var(--text-primary);
  border-color: var(--border);
}
[data-theme="dark"] .chat-input-area input::placeholder {
  color: var(--text-muted);
}
[data-theme="dark"] .chat-msg.assistant .content {
  color: var(--text-primary);
}
[data-theme="dark"] .chat-msg.user .content {
  color: var(--text-primary);
}
[data-theme="dark"] .chat-msg .role {
  color: var(--text-secondary);
}
[data-theme="dark"] .chat-status {
  color: var(--text-muted);
}
[data-theme="dark"] .log-month-header {
  color: var(--text-primary);
}
[data-theme="dark"] .back-link {
  color: var(--accent);
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 {
  color: var(--text-primary);
}
[data-theme="dark"] .section-title {
  color: var(--text-primary);
}
[data-theme="dark"] .meta {
  color: var(--text-secondary);
}
[data-theme="dark"] .tag-filter-label {
  color: var(--text-secondary);
}
[data-theme="dark"] .photo-title {
  color: var(--text-primary);
}
[data-theme="dark"] .form-group label {
  color: var(--text-primary);
}
[data-theme="dark"] .unlock-box p {
  color: var(--text-primary);
}
[data-theme="dark"] .unlock-error {
  color: #ff6b6b;
}

/* 深色模式切换按钮 */

.music-dock {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.music-dock > * { pointer-events: auto; }
.music-player {
  position: relative;
  display: inline-flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.music-player:hover,
.music-player:focus-visible {
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.22);
  outline: none;
  transform: translateY(-2px);
}
.music-icon { font-size: 1.2rem; line-height: 1; }
.music-player.playing .music-icon { animation: musicPulse 2s infinite; }
@keyframes musicPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}
[data-theme="dark"] .music-player {
  border-color: #383838;
  background: rgba(30, 30, 30, 0.97);
  color: #eee;
}
@media(max-width:768px){
  .music-dock {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .music-player { flex-basis: 44px; width: 44px; height: 44px; }
}

 /* ========== 技能树 ========== */
.skilltree-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Skill evidence cards ---------- */
.skill-evidence {
  max-width: 1000px;
  margin: 0 auto 48px;
}
.skill-evidence-head h2 {
  font-size: 1.125rem;
  margin: 0 0 4px;
}
.skill-evidence-head p {
  margin: 0;
  font-size: 0.8125rem;
  color: #999;
}
.skill-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.skill-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover {
  border-color: #aaa;
  transform: translateY(-2px);
}
.skill-card-domain {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: #999;
}
.skill-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}
.skill-card-level {
  font-size: 0.75rem;
  color: #666;
}
.skill-card-bar {
  display: block;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f0f0;
}
.skill-card-bar i {
  display: block;
  height: 100%;
  background: #333;
}
.skill-card-count {
  margin-top: auto;
  font-size: 0.6875rem;
  color: #aaa;
}
.skill-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
}
.skill-detail-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow: auto;
  padding: 28px;
  border-radius: 12px;
  background: #fff;
}
.skill-detail-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  color: #999;
  font-size: 0.75rem;
  cursor: pointer;
}
.skill-detail-card h2 {
  margin: 6px 0 4px;
  font-size: 1.375rem;
}
.skill-detail-card h3 {
  margin: 22px 0 10px;
  font-size: 0.875rem;
}
.skill-detail-level {
  font-size: 1.75rem;
  font-weight: 600;
}
.skill-detail-level span {
  font-size: 0.75rem;
  color: #aaa;
}
.skill-detail-bar {
  height: 3px;
  margin: 8px 0 14px;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f0f0;
}
.skill-detail-bar i {
  display: block;
  height: 100%;
  background: #333;
}
.skill-detail-next {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #666;
}
.skill-target-btn {
  margin: 6px 0 8px;
  padding: 6px 12px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 6px;
  background: transparent;
  color: var(--accent, #1a73e8);
  font-size: 0.8125rem;
  cursor: pointer;
}
.skill-target-btn:hover {
  background: var(--border-light, #f3f3f3);
}
.skill-detail-evidence {
  display: grid;
  gap: 10px;
}
.skill-detail-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #999;
}
.skill-evidence-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.skill-evidence-item:hover { border-color: #bbb; }
.skill-evidence-meta {
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: #aaa;
}
.skill-evidence-item strong {
  font-size: 0.875rem;
  color: #1a1a1a;
}
.skill-evidence-item span:last-child {
  font-size: 0.75rem;
  line-height: 1.6;
  color: #777;
}
[data-theme="dark"] .skill-card,
[data-theme="dark"] .skill-evidence-item { border-color: #2e2e2e; }
[data-theme="dark"] .skill-card-title,
[data-theme="dark"] .skill-evidence-item strong { color: #ececec; }
[data-theme="dark"] .skill-card-bar,
[data-theme="dark"] .skill-detail-bar { background: #2a2a2a; }
[data-theme="dark"] .skill-card-bar i,
[data-theme="dark"] .skill-detail-bar i { background: #bbb; }
[data-theme="dark"] .skill-detail-card { background: #171717; }
[data-theme="dark"] .skill-evidence-item { background: #171717; }
@media (max-width: 600px) {
  .skill-evidence-grid { grid-template-columns: 1fr; }
  .skill-detail-card { padding: 22px; max-height: 90vh; }
}

/* --- 云词图：绝对定位云朵造型，无底板，词悬浮空中 --- */
.skilltree-cloud {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 300px;
  margin: 0 auto;
}
.cloud-word {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  transition: opacity 0.2s;
  cursor: default;
  line-height: 1.4;
}
.cloud-word:hover { opacity: 1 !important; }

/* --- 点线抽象树：从地面向上生长 --- */
.skilltree-tree {
  --tree-line: #ccc;
  position: relative;
  width: 100%;
  max-width: 1000px;
  min-height: 800px;
  margin: 20px auto 0;
}
[data-theme="dark"] .skilltree-tree { --tree-line: #555; }
.tree-ground {
  position: absolute;
  bottom: 10px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--tree-line);
}
.tree-branch-node {
  z-index: 5;
}
.tree-branch-node .tree-circle {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #666;
  border-radius: 50%;
  background: transparent;
  margin: 0 auto;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.tree-branch-node .tree-circle::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}
[data-theme="dark"] .tree-circle { border-color: #ccc; }
.tree-branch-node.expanded .tree-circle { background: #1a1a1a; }
[data-theme="dark"] .tree-branch-node.expanded .tree-circle { background: #fff; }
.tree-branch-node .tree-label {
  display: block;
  opacity: 0;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow);
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-top: 6px;
  text-align: center;
}
.tree-branch-node.expanded .tree-label {
  opacity: 1 !important;
  pointer-events: auto;
}
.tree-branch-node[data-depth="1"] .tree-label {
  opacity: 1;
  pointer-events: auto;
}
.tree-branch-node.tree-root-node .tree-circle {
  width: 16px;
  height: 16px;
  border-width: 3px;
}
.tree-branch-node.tree-root-node .tree-label {
  font-size: 0.9375rem;
  font-weight: 600;
}
@media (max-width: 768px) {
  .skilltree-cloud { height: 350px; }
  .skilltree-tree { min-height: 500px; }
}

.tree-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  max-width: 280px;
}
.tree-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 768px) {
  .tree-toast {
    bottom: 16px;
    left: 16px;
    font-size: 0.8125rem;
    padding: 8px 16px;
    max-width: 200px;
  }
}

/* 私密区内容模糊：默认锁定即模糊（防进入时闪现明文），解锁后移除 */
.private-content {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}
.private-section.unlocked .private-content {
  filter: none;
  pointer-events: auto;
  user-select: auto;
  opacity: 1;
}

@media (max-width: 768px) {
  .skilltree-cloud { height: 240px; }
  .skilltree-tree { max-width: 100%; min-height: 450px; padding: 20px 0 10px; }
  .tree-branch-node .tree-label {
    max-width: 92px;
    font-size: 0.7rem;
    line-height: 1.25;
    padding: 2px 5px;
    white-space: normal;
  }
  .tree-branch-node .tree-circle { width: 10px; height: 10px; border-width: 1.5px; }
  .tree-branch-node.tree-root-node .tree-circle { width: 13px; height: 13px; }
}

/* ========== Skill tree v2: organic evidence tree ========== */
#main-content.skilltree-mode {
  max-width: 1200px;
}

.skilltree-v2 {
  --tree-bark: #7a7468;
  --tree-branch: #879a62;
  --tree-branch-soft: #a8b883;
  --tree-leaf: #9dbb62;
  --tree-leaf-deep: #648c4e;
  --tree-cross: #c3a86b;
  --tree-node-bg: rgba(255, 255, 255, 0.86);
}
[data-theme="dark"] .skilltree-v2 {
  --tree-bark: #827a6d;
  --tree-branch: #7f9460;
  --tree-branch-soft: #60734d;
  --tree-leaf: #8dad5c;
  --tree-leaf-deep: #5d8249;
  --tree-cross: #9e895d;
  --tree-node-bg: rgba(24, 24, 24, 0.88);
}
.skilltree-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}
.skilltree-v2-lead {
  max-width: 660px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.75;
}
.skilltree-v2-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.skilltree-v2-controls button {
  padding: 6px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.skilltree-v2-controls button:hover,
.skilltree-v2-controls button.is-active {
  border-color: #8ba567;
  color: var(--text-primary);
  background: rgba(145, 177, 96, 0.1);
}
.skilltree-v2-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.skilltree-v2-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.skilltree-v2-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.skilltree-v2-legend .legend-skill {
  border: 1.5px solid var(--tree-branch);
  background: var(--tree-node-bg);
}
.skilltree-v2-legend .legend-evidence {
  width: 8px;
  height: 13px;
  border-radius: 0 70% 0 70%;
  background: var(--tree-leaf);
  transform: rotate(-25deg);
}
.skilltree-v2-legend .legend-content {
  width: 14px;
  height: 11px;
  border-radius: 0 70% 0 70%;
  background: var(--tree-leaf-deep);
  transform: rotate(20deg);
}
.skilltree-v2-legend .legend-cross {
  width: 17px;
  height: 1px;
  border-top: 1px dashed var(--tree-cross);
  border-radius: 0;
}
.skilltree-v2-legend .legend-reference-large,
.skilltree-v2-legend .legend-reference-mid,
.skilltree-v2-legend .legend-reference-small {
  background: #9bc23e;
  border-radius: 50%;
}
.skilltree-v2-legend .legend-reference-large {
  width: 17px;
  height: 17px;
}
.skilltree-v2-legend .legend-reference-mid {
  width: 12px;
  height: 12px;
}
.skilltree-v2-legend .legend-reference-small {
  width: 8px;
  height: 8px;
}
.skilltree-v2-legend .legend-privacy {
  margin-left: auto;
  color: #a48a55;
}
.skilltree-v2-stage {
  position: relative;
  min-height: 860px;
  overflow: hidden;
  border-top: 1px solid var(--border-light, #eee);
  border-bottom: 1px solid var(--border-light, #eee);
  background:
    radial-gradient(ellipse at 50% 18%, rgba(166, 193, 111, 0.11), transparent 42%),
    radial-gradient(ellipse at 50% 88%, rgba(122, 116, 104, 0.07), transparent 34%);
}
.skilltree-v2-stage.tree-reference-stage {
  min-height: 0;
  height: auto;
  aspect-ratio: 1005 / 1200;
  overflow: visible;
  background: #fff;
}
[data-theme="dark"] .skilltree-v2-stage.tree-reference-stage {
  background: #171717;
}
.tree-reference-board {
  position: relative;
  width: 100%;
  height: 100%;
}
.tree-reference-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 5px 3px rgba(54, 54, 44, 0.10));
}
.tree-reference-hotspots {
  position: absolute;
  inset: 0;
}
.tree-reference-hotspot {
  position: absolute;
  z-index: 3;
  min-width: 12px;
  min-height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
  aspect-ratio: 1 / 1;
}
.tree-reference-hotspot:hover,
.tree-reference-hotspot:focus-visible,
.tree-reference-hotspot.is-selected {
  background: rgba(255, 255, 255, 0.20);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.94),
    0 0 0 2px rgba(75, 103, 40, 0.72),
    0 0 14px rgba(122, 159, 62, 0.42);
  outline: none;
}
.tree-reference-hotspot::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  z-index: 20;
  width: max-content;
  max-width: 210px;
  padding: 5px 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #222;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.6875rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tree-reference-hotspot:hover::after,
.tree-reference-hotspot:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
[data-theme="dark"] .tree-reference-hotspot::after {
  border-color: #444;
  background: rgba(28, 28, 28, 0.97);
  color: #eee;
}
.tree-reference-hotspot.is-locked {
  cursor: not-allowed;
}
.tree-reference-hotspot.is-locked:hover,
.tree-reference-hotspot.is-locked:focus-visible,
.tree-reference-hotspot.is-locked.is-selected {
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.tree-v2-svg,
.tree-v2-node-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tree-v2-svg {
  pointer-events: none;
  overflow: visible;
}
.tree-v2-trunk {
  stroke: var(--tree-bark);
  stroke-linecap: round;
  opacity: 0.34;
}
.tree-v2-trunk-core {
  stroke: var(--tree-branch-soft);
  stroke-linecap: round;
  opacity: 0.9;
}
.tree-v2-main-branch {
  stroke: var(--tree-branch);
  stroke-linecap: round;
  opacity: 0.95;
}
.tree-v2-skill-branch {
  stroke: var(--tree-branch-soft);
  stroke-linecap: round;
  opacity: 0.82;
}
.tree-v2-content-branch,
.tree-v2-private-branch,
.tree-v2-private-stem,
.tree-v2-leaf-stem {
  stroke: var(--tree-branch-soft);
  stroke-linecap: round;
  opacity: 0.64;
}
.tree-v2-private-branch {
  stroke-dasharray: 3 6;
}
.tree-v2-private-stem {
  stroke-dasharray: 2 5;
  opacity: 0.42;
}
.tree-v2-cross-link {
  stroke: var(--tree-cross);
  stroke-width: 0.9;
  stroke-dasharray: 2 7;
  opacity: 0.45;
}
.tree-v2-node {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 54px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.tree-v2-node:focus-visible,
.tree-v2-evidence:focus-visible {
  outline: 2px solid #7f9f58;
  outline-offset: 4px;
}
.tree-v2-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--tree-branch);
  border-radius: 50%;
  background: var(--tree-node-bg);
  color: var(--tree-leaf-deep);
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(67, 79, 48, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.tree-v2-label {
  max-width: 112px;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.tree-v2-meta {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.5875rem;
  line-height: 1.25;
  white-space: nowrap;
}
.tree-v2-node:hover .tree-v2-mark,
.tree-v2-node.is-selected .tree-v2-mark {
  border-color: var(--tree-leaf-deep);
  background: var(--tree-leaf-deep);
  color: #fff;
  transform: scale(1.14);
}
.tree-v2-node:hover .tree-v2-label,
.tree-v2-node.is-selected .tree-v2-label {
  color: var(--tree-leaf-deep);
}
.tree-v2-stage.has-evidence-focus .tree-v2-node:not(.is-selected) {
  opacity: 0.42;
}
.tree-v2-stage.has-evidence-focus .tree-v2-cross-link {
  opacity: 0.22;
}
.tree-v2-root {
  z-index: 6;
  min-width: 92px;
}
.tree-v2-root .tree-v2-mark {
  width: 46px;
  height: 46px;
  border-width: 2px;
  color: var(--tree-bark);
  font-size: 1rem;
}
.tree-v2-root .tree-v2-label {
  margin-top: 6px;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}
.tree-v2-domain .tree-v2-mark {
  width: 31px;
  height: 31px;
  border-color: var(--tree-branch);
  background: rgba(151, 179, 102, 0.14);
}
.tree-v2-domain .tree-v2-label {
  font-size: 0.8125rem;
}
.tree-v2-skill .tree-v2-mark {
  width: 28px;
  height: 28px;
  border-radius: 45% 55% 48% 52% / 56% 44% 56% 44%;
}
.tree-v2-bundle .tree-v2-mark,
.tree-v2-private .tree-v2-mark {
  width: 34px;
  height: 26px;
  border: 0;
  border-radius: 0 72% 0 72%;
  background: var(--tree-leaf);
  color: #fff;
  transform: rotate(-22deg);
}
.tree-v2-bundle .tree-v2-mark {
  font-size: 0.6875rem;
}
.tree-v2-private .tree-v2-mark {
  background: #b5a06f;
}
.tree-v2-private-category .tree-v2-mark {
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--tree-cross) 70%, var(--tree-branch-soft));
  border-radius: 0 70% 0 70%;
  background: color-mix(in srgb, var(--tree-cross) 22%, var(--tree-node-bg));
  color: #8c7445;
  transform: rotate(-22deg);
}
.tree-v2-private-category .tree-v2-label {
  margin-top: 5px;
  color: var(--text-secondary);
}
.tree-v2-private-category.is-locked .tree-v2-mark {
  filter: blur(0.7px);
  background: color-mix(in srgb, var(--tree-cross) 18%, transparent);
}
.tree-v2-private-category.is-locked .tree-v2-label,
.tree-v2-private-category.is-locked .tree-v2-meta {
  opacity: 0.72;
}
.tree-v2-private-category:hover .tree-v2-mark,
.tree-v2-private-category.is-selected .tree-v2-mark {
  background: #a68e5d;
  color: #fff;
  transform: rotate(-22deg) scale(1.1);
}
.tree-v2-bundle:hover .tree-v2-mark,
.tree-v2-private:hover .tree-v2-mark,
.tree-v2-bundle.is-selected .tree-v2-mark,
.tree-v2-private.is-selected .tree-v2-mark {
  background: var(--tree-leaf-deep);
  transform: rotate(-22deg) scale(1.1);
}
.tree-v2-private:not(.is-selected) .tree-v2-mark {
  opacity: 0.84;
}
.tree-v2-evidence {
  position: absolute;
  z-index: 8;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.tree-v2-evidence > span {
  display: block;
  width: 15px;
  height: 24px;
  margin: auto;
  border-radius: 0 75% 0 75%;
  background: var(--tree-leaf);
  box-shadow: 0 2px 7px rgba(71, 92, 51, 0.15);
  transform: rotate(36deg);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.tree-v2-evidence-b > span { background: #83aa75; }
.tree-v2-evidence-c > span { background: #b4c984; }
.tree-v2-private-leaf > span {
  width: 16px;
  height: 23px;
  border-radius: 58% 42% 62% 38% / 52% 60% 40% 48%;
  background: #b8aa84;
  transform: rotate(-18deg);
}
.tree-v2-evidence-locked > span {
  opacity: 0.56;
  filter: blur(1.8px) saturate(0.55);
  box-shadow: 0 0 12px rgba(138, 122, 88, 0.28);
}
.tree-v2-evidence-locked::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 7px;
  border: 1px solid rgba(102, 88, 58, 0.55);
  border-radius: 2px;
  background: rgba(247, 245, 239, 0.7);
  transform: translate(-50%, -50%);
}
.tree-v2-evidence-locked::before,
.tree-v2-evidence-locked::after {
  pointer-events: none;
}
.tree-v2-evidence:hover > span {
  filter: brightness(0.9);
  transform: rotate(24deg) scale(1.18);
}
.tree-v2-evidence::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 4px 16px var(--shadow);
  font-size: 0.6875rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.tree-v2-evidence:hover::after,
.tree-v2-evidence:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.skilltree-v2-index {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 10px;
}
.tree-v2-index-label {
  margin-right: 4px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}
.skilltree-v2-index button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border, #e2e2e2);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.skilltree-v2-index button:hover {
  border-color: #91a86d;
  color: var(--text-primary);
}
.skilltree-v2-index button span {
  color: var(--text-muted);
  font-size: 0.625rem;
}
.skilltree-v2-inspector {
  min-height: 160px;
  margin-top: 6px;
  padding: 24px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
}
.tree-v2-panel-head {
  position: relative;
  margin-bottom: 16px;
  padding-right: 100px;
}
.tree-v2-panel-head h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  line-height: 1.4;
}
.tree-v2-panel-kicker {
  color: var(--tree-leaf-deep);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}
.tree-v2-level,
.tree-v2-panel-count {
  position: absolute;
  right: 0;
  bottom: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.tree-v2-level {
  color: var(--tree-leaf-deep);
  font-size: 1rem;
  font-weight: 700;
}
.tree-v2-level-track {
  height: 3px;
  margin: -2px 0 14px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--border-light, #f0f0f0);
}
.tree-v2-level-track i {
  display: block;
  height: 100%;
  background: var(--tree-leaf-deep);
}
.tree-v2-next,
.tree-v2-intro,
.tree-v2-summary,
.tree-v2-bodytext {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.75;
}
.tree-v2-next {
  margin: 0 0 16px;
}
.tree-v2-intro {
  margin: 0 max(0px, 6vw) 18px 0;
}
.tree-v2-summary {
  margin: 0 0 8px;
  color: var(--text-primary);
}
.tree-v2-bodytext {
  margin: 0 0 16px;
}
.tree-v2-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light, #eee);
  font-size: 0.75rem;
}
.tree-v2-list-head em {
  color: var(--text-muted);
  font-style: normal;
}
.tree-v2-evidence-list,
.tree-v2-content-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tree-v2-content-group {
  margin-top: 16px;
}
.tree-v2-content-group h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.tree-v2-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.tree-v2-list-item:hover {
  border-color: #9aaf78;
  background: rgba(154, 175, 120, 0.06);
}
.tree-v2-list-item strong {
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.tree-v2-list-item span {
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.55;
}
.tree-v2-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tree-v2-related button {
  padding: 5px 9px;
  border: 1px dashed color-mix(in srgb, var(--tree-cross) 70%, var(--border));
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
}
.tree-v2-related button:hover {
  border-style: solid;
  color: var(--text-primary);
}
.tree-v2-primary-action {
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid var(--tree-leaf-deep);
  border-radius: 7px;
  background: var(--tree-leaf-deep);
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.tree-v2-private-actions {
  display: flex;
  gap: 8px;
}
.tree-v2-private-actions .tree-v2-primary-action {
  margin-top: 0;
}
.tree-v2-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.tree-v2-metrics strong {
  color: var(--tree-leaf-deep);
  font-size: 1.125rem;
}
.tree-v2-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.skilltree-v2-footnote {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.7;
  text-align: right;
}

@media (max-width: 820px) {
  #main-content.skilltree-mode {
    max-width: 100%;
  }
  .skilltree-v2-header {
    flex-direction: column;
    gap: 12px;
  }
  .skilltree-v2-controls {
    justify-content: flex-start;
  }
  .skilltree-v2-legend .legend-privacy {
    width: 100%;
    margin-left: 0;
  }
  .skilltree-v2-stage {
    min-height: 1380px;
  }
  .skilltree-v2-stage.tree-reference-stage {
    min-height: 0;
    aspect-ratio: 1005 / 1200;
  }
  .tree-reference-hotspot {
    min-width: 11px;
    min-height: 11px;
  }
  .tree-v2-label {
    max-width: 92px;
    font-size: 0.6875rem;
  }
  .tree-v2-node {
    min-width: 66px;
  }
  .tree-v2-stage.has-evidence-focus .tree-v2-node:not(.is-selected) {
    opacity: 0.16;
  }
  .tree-v2-skill .tree-v2-meta {
    font-size: 0.54rem;
  }
  .skilltree-v2-inspector {
    padding: 18px;
  }
  .tree-v2-evidence-list,
  .tree-v2-content-group {
    grid-template-columns: 1fr;
  }
  .tree-v2-panel-head {
    padding-right: 66px;
  }
  .tree-v2-panel-head h2 {
    font-size: 1.05rem;
  }
  .skilltree-v2-footnote {
    text-align: left;
  }
}

/* ========== Organic knowledge tree v3 ========== */
.skilltree-v3-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.skilltree-v3-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.skilltree-v3-status i {
  display: inline-block;
  flex: 0 0 auto;
}
.tree-organic-legend-active {
  width: 18px;
  height: 2px;
  background: #20201e;
}
.tree-organic-legend-branch {
  width: 18px;
  height: 1px;
  background: #c8c9c4;
}
.tree-organic-legend-bud {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dfe0dc;
}
.tree-organic-stage {
  height: 900px;
  overflow: hidden;
  border-top: 1px solid var(--border-light, #eee);
  border-bottom: 1px solid var(--border-light, #eee);
  background:
    radial-gradient(ellipse at 52% 91%, rgba(99, 98, 91, 0.08), transparent 19%),
    radial-gradient(ellipse at 50% 32%, rgba(143, 151, 130, 0.07), transparent 48%),
    linear-gradient(180deg, var(--bg-card), color-mix(in srgb, var(--bg-card) 92%, #f4f3ef));
}
.tree-organic-stage.is-mobile {
  height: 1500px;
}
.tree-organic-svg,
.tree-organic-node-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tree-organic-svg {
  overflow: visible;
  pointer-events: none;
}
.tree-organic-trunk-base,
.tree-organic-main-branch,
.tree-organic-skill-branch,
.tree-organic-content-branch,
.tree-organic-private-branch,
.tree-organic-leaf-stem,
.tree-organic-tender-stem,
.tree-organic-ghost-branch {
  stroke: #c6c8c1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tree-organic-trunk-base {
  stroke: #a8aaa4;
  opacity: 0.76;
}
.tree-organic-main-branch {
  stroke: #aaada6;
}
.tree-organic-skill-branch {
  stroke: #b9bcb5;
  opacity: 0.9;
}
.tree-organic-content-branch {
  stroke: #aaada6;
  stroke-dasharray: 5 4;
  opacity: 0.82;
}
.tree-organic-private-branch {
  stroke: #c9c3b7;
  stroke-dasharray: 4 7;
  opacity: 0.72;
}
.tree-organic-leaf-stem {
  stroke: #c4c6c0;
}
.tree-organic-leaf-stem.is-active {
  stroke: #292a27;
  stroke-width: 1.2;
}
.tree-organic-tender-stem {
  stroke: #dedfdb;
  stroke-dasharray: 2 6;
  opacity: 0.72;
}
.tree-organic-tender-bud {
  fill: #e1e2de;
  stroke: color-mix(in srgb, var(--bg-card) 70%, #d3d5ce);
  stroke-width: 1;
  opacity: 0.84;
}
.tree-organic-ghost-branch {
  stroke: #dedfdb;
  stroke-dasharray: 3 7;
  opacity: 0.72;
}
.tree-organic-ghost-node {
  fill: #d8d9d4;
  stroke: color-mix(in srgb, var(--bg-card) 72%, #dce0d9);
  stroke-width: 1;
  opacity: 0.82;
}
.tree-organic-ink {
  stroke: #20201e;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 0.72s cubic-bezier(0.35, 0, 0.18, 1);
}
.tree-organic-relation {
  stroke: #9da497;
  stroke-width: 0.9;
  stroke-dasharray: 2 7;
  opacity: 0.52;
}
.tree-organic-node {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #686b64;
  font-family: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}
.tree-organic-node.is-active,
.tree-organic-node.is-selected {
  color: #242522;
}
.tree-organic-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.25px solid #b1b4ac;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  color: #7f817a;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 12px rgba(52, 54, 48, 0.07);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.tree-organic-node.is-active .tree-organic-mark,
.tree-organic-node.is-selected .tree-organic-mark {
  border-color: #242522;
  background: #242522;
  color: #fff;
}
.tree-organic-node:hover .tree-organic-mark {
  border-color: #6c6f67;
  transform: scale(1.1);
}
.tree-organic-node:focus-visible {
  outline: 2px solid #353632;
  outline-offset: 4px;
  border-radius: 12px;
}
.tree-organic-label {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: 116px;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.tree-organic-meta {
  position: absolute;
  top: calc(100% + 21px);
  left: 50%;
  color: var(--text-muted);
  font-size: 0.58rem;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.tree-organic-node.is-major .tree-organic-label,
.tree-organic-node.is-major .tree-organic-meta,
.tree-organic-node.is-active .tree-organic-label,
.tree-organic-node.is-active .tree-organic-meta,
.tree-organic-node.is-selected .tree-organic-label,
.tree-organic-node.is-selected .tree-organic-meta,
.tree-organic-node:hover .tree-organic-label,
.tree-organic-node:hover .tree-organic-meta,
.tree-organic-node:focus-visible .tree-organic-label,
.tree-organic-node:focus-visible .tree-organic-meta {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tree-organic-root {
  z-index: 8;
  min-width: 54px;
  color: #20201e;
}
.tree-organic-root .tree-organic-mark {
  width: 48px;
  height: 48px;
  border: 0;
  background: #20201e;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 9px 30px rgba(31, 31, 28, 0.24);
}
.tree-organic-root .tree-organic-label {
  font-size: 0.875rem;
  letter-spacing: 0.09em;
}
.tree-organic-root.is-selected .tree-organic-mark {
  box-shadow: 0 0 0 4px var(--bg-card), 0 0 0 6px rgba(32, 32, 30, 0.32);
}
.tree-organic-domain {
  min-width: 44px;
}
.tree-organic-domain .tree-organic-mark {
  width: 32px;
  height: 32px;
  border-color: #aaada5;
  background: color-mix(in srgb, var(--bg-card) 86%, #d9dbd6);
  font-size: 0.7rem;
}
.tree-organic-domain .tree-organic-label {
  font-size: 0.8125rem;
}
.tree-organic-skill {
  min-width: 40px;
}
.tree-organic-group {
  min-width: 42px;
  color: #74766f;
}
.tree-organic-group .tree-organic-mark {
  width: 31px;
  height: 27px;
  border: 1px solid #b9bcb4;
  border-radius: 48% 42% 54% 46% / 58% 45% 55% 42%;
  background: color-mix(in srgb, var(--bg-card) 88%, #d9dcd4);
  color: #6f7269;
  font-size: 0.56rem;
  letter-spacing: 0.02em;
  transform: rotate(-7deg);
}
.tree-organic-group:hover .tree-organic-mark,
.tree-organic-group.is-selected .tree-organic-mark {
  transform: rotate(-7deg) scale(1.08);
}
.tree-organic-group.is-active .tree-organic-mark,
.tree-organic-group.is-selected .tree-organic-mark {
  border-color: #242522;
  background: #242522;
  color: #fff;
}
.tree-organic-group.is-collapsed .tree-organic-mark::after {
  content: "+";
  position: absolute;
  right: -13px;
  bottom: -8px;
  width: 13px;
  height: 13px;
  border: 1px solid #aeb1a9;
  border-radius: 50%;
  background: var(--bg-card);
  color: #787b74;
  font-size: 0.55rem;
  line-height: 12px;
  transform: rotate(7deg);
}
.tree-organic-group.is-selected .tree-organic-mark {
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px rgba(36, 37, 34, 0.22);
}
.tree-organic-skill .tree-organic-mark {
  width: 27px;
  height: 27px;
  border-radius: 45% 55% 48% 52% / 56% 44% 56% 44%;
}
.tree-organic-skill.is-collapsed .tree-organic-mark::after {
  content: "+";
  position: absolute;
  width: 13px;
  height: 13px;
  margin: 28px 0 0 28px;
  border: 1px solid #aeb1a9;
  border-radius: 50%;
  background: var(--bg-card);
  color: #787b74;
  font-size: 0.55rem;
  line-height: 12px;
}
.tree-organic-skill.is-selected .tree-organic-mark {
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px rgba(36, 37, 34, 0.26);
}
.tree-organic-bundle {
  min-width: 40px;
  color: #787a74;
}
.tree-organic-bundle .tree-organic-mark {
  width: 31px;
  height: 21px;
  border: 0;
  border-radius: 0 72% 0 72%;
  background: #aeb0aa;
  color: #fff;
  transform: rotate(-24deg);
}
.tree-organic-bundle:hover .tree-organic-mark,
.tree-organic-bundle.is-selected .tree-organic-mark {
  background: #484a45;
  transform: rotate(-24deg) scale(1.08);
}
.tree-organic-private {
  min-width: 44px;
  color: #8a7b60;
}
.tree-organic-private .tree-organic-mark {
  width: 34px;
  height: 26px;
  border: 0;
  border-radius: 0 72% 0 72%;
  background: #c9bea8;
  color: #fff;
  transform: rotate(-22deg);
}
.tree-organic-private:hover .tree-organic-mark {
  transform: rotate(-22deg) scale(1.08);
}
.tree-organic-private-category {
  min-width: 40px;
  color: #8d8068;
}
.tree-organic-private-category .tree-organic-mark {
  width: 23px;
  height: 19px;
  border: 1px solid #c4bcaa;
  border-radius: 0 70% 0 70%;
  background: color-mix(in srgb, var(--bg-card) 74%, #d8d0bf);
  transform: rotate(-20deg);
}
.tree-organic-leaf {
  position: absolute;
  z-index: 10;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}
.tree-organic-leaf > span {
  display: block;
  width: 13px;
  height: 22px;
  margin: auto;
  border-radius: 100% 0 100% 0;
  background:
    linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, 0.32) 46%, rgba(255, 255, 255, 0.32) 53%, transparent 54%),
    #70736b;
  box-shadow: 0 3px 8px rgba(44, 46, 41, 0.15);
  transform: rotate(34deg);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.tree-organic-leaf-b > span {
  background-color: #999c94;
}
.tree-organic-leaf-c > span {
  background-color: #b2b4ae;
}
.tree-organic-leaf:hover > span,
.tree-organic-leaf:focus-visible > span,
.tree-organic-leaf.is-selected > span {
  filter: brightness(0.72);
  transform: rotate(24deg) scale(1.18);
}
.tree-organic-leaf:focus-visible {
  outline: 2px solid #33342f;
  outline-offset: 2px;
  border-radius: 50%;
}
.tree-organic-leaf::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 20;
  width: max-content;
  max-width: 190px;
  padding: 5px 7px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 4px 16px var(--shadow);
  font-size: 0.67rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tree-organic-leaf:hover::after,
.tree-organic-leaf:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tree-organic-stage.has-evidence-focus .tree-organic-skill:not(.is-active):not(.is-lineage) {
  opacity: 0.34;
}
.tree-organic-stage.has-evidence-focus .tree-organic-skill:not(.is-active):not(.is-lineage) .tree-organic-meta {
  opacity: 0.6;
}
.tree-organic-collapse-button {
  margin-top: 10px;
  padding: 5px 10px;
  border: 1px solid var(--border-light, #e7e7e7);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.6875rem;
  cursor: pointer;
}
.tree-organic-collapse-button:hover {
  border-color: #9b9d96;
  color: var(--text-primary);
}
[data-theme="dark"] .tree-organic-stage {
  background:
    radial-gradient(ellipse at 52% 91%, rgba(255, 255, 255, 0.04), transparent 19%),
    radial-gradient(ellipse at 50% 32%, rgba(187, 192, 181, 0.04), transparent 48%),
    #171717;
}
[data-theme="dark"] .tree-organic-trunk-base,
[data-theme="dark"] .tree-organic-main-branch,
[data-theme="dark"] .tree-organic-skill-branch,
[data-theme="dark"] .tree-organic-content-branch,
[data-theme="dark"] .tree-organic-leaf-stem {
  stroke: #4a4b47;
}
[data-theme="dark"] .tree-organic-private-branch,
[data-theme="dark"] .tree-organic-tender-stem,
[data-theme="dark"] .tree-organic-ghost-branch {
  stroke: #4c4a44;
}
[data-theme="dark"] .tree-organic-tender-bud {
  fill: #444541;
}
[data-theme="dark"] .tree-organic-ghost-node {
  fill: #484945;
  stroke: #333430;
}
[data-theme="dark"] .tree-organic-ink,
[data-theme="dark"] .tree-organic-root .tree-organic-mark {
  stroke: #eee;
  background: #eee;
  color: #171717;
}
[data-theme="dark"] .tree-organic-node.is-active,
[data-theme="dark"] .tree-organic-node.is-selected,
[data-theme="dark"] .tree-organic-root {
  color: #eee;
}
[data-theme="dark"] .tree-organic-node.is-active .tree-organic-mark,
[data-theme="dark"] .tree-organic-node.is-selected .tree-organic-mark {
  border-color: #eee;
  background: #eee;
  color: #171717;
}
[data-theme="dark"] .tree-organic-legend-active {
  background: #eee;
}
[data-theme="dark"] .tree-organic-legend-branch {
  background: #4a4b47;
}

@media (max-width: 820px) {
  .skilltree-v3-status {
    gap: 6px 12px;
  }
  .tree-organic-stage {
    height: 1500px;
    margin-inline: -12px;
  }
  .tree-organic-node {
    min-width: 42px;
    min-height: 42px;
  }
  .tree-organic-label {
    max-width: 94px;
    font-size: 0.675rem;
    white-space: normal;
  }
  .tree-organic-meta {
    font-size: 0.53rem;
  }
  .tree-organic-domain {
    min-width: 44px;
  }
  .tree-organic-skill {
    min-width: 42px;
  }
  .tree-organic-root {
    min-width: 56px;
  }
  .tree-organic-leaf {
    width: 36px;
    height: 36px;
  }
  .skilltree-v2-controls {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tree-v2-mark,
  .tree-v2-evidence > span,
  .tree-v2-evidence::after,
  .tree-organic-ink,
  .tree-organic-mark,
  .tree-organic-leaf > span,
  .tree-organic-leaf::after {
    transition: none;
  }
}

/* ========== Classic dot-and-line skill tree ========== */
#main-content.skilltree-mode {
  max-width: none;
}

.skilltree-classic {
  --classic-line: #cfd0cb;
  --classic-line-active: #4b4b47;
  --classic-node: #676862;
  --classic-node-soft: #9b9c96;
  margin: 0 auto;
}

.skilltree-classic-intro {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
}

.skilltree-classic-intro > .section-title {
  max-width: 672px;
  margin-inline: auto;
}

.skilltree-cloud {
  position: relative;
  width: 100%;
  max-width: 840px;
  height: 340px;
  margin: 0 auto;
  overflow: hidden;
}

.cloud-word {
  display: inline-block;
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  cursor: default;
  line-height: 1.18;
  transition: opacity 0.2s ease;
}

.cloud-word:hover {
  opacity: 1 !important;
}

.classic-tree-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 12px;
  scrollbar-color: #b7b8b3 transparent;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.classic-tree-scroll:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 3px;
}

.classic-tree-stage {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.classic-tree-stage.is-ready {
  opacity: 1;
}

.classic-tree-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.classic-tree-edge {
  fill: none;
  stroke: var(--classic-line);
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0;
  animation: classic-edge-in 0.32s ease forwards;
  animation-delay: calc(var(--edge-order, 0) * 12ms);
  transition: stroke 0.18s ease, stroke-width 0.18s ease;
}

.classic-tree-edge.is-depth-1 {
  stroke-width: 1.8;
}

.classic-tree-edge.is-depth-2 {
  stroke-width: 1.55;
}

.classic-tree-edge.is-active {
  stroke: #989993;
  stroke-width: 1.4;
}

.classic-tree-ground-baseline,
.classic-tree-root {
  fill: none;
  stroke: var(--classic-line);
  stroke-linecap: round;
}

.classic-tree-ground-baseline {
  stroke-width: 1.5;
}

.classic-tree-root {
  stroke-width: 1.5;
}

.classic-tree-root.is-center {
  stroke-width: 2;
}

.classic-tree-layer {
  position: absolute;
  inset: 0;
}

.classic-tree-node {
  position: absolute;
  z-index: 2;
  display: block;
  width: max-content;
  max-width: 170px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  text-align: center;
  transform: translate(-50%, -6px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.classic-tree-node.is-leaf {
  cursor: default;
}

.classic-tree-node.is-leaf[role="link"] {
  cursor: pointer;
}

.classic-tree-node.is-root {
  transform: translate(-50%, -10px);
  cursor: default;
}

.classic-tree-mark {
  position: relative;
  display: block;
  width: 11px;
  height: 11px;
  margin: 0 auto;
  border: 1.5px solid var(--classic-node);
  border-radius: 50%;
  background: var(--bg-primary, #fff);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.classic-tree-node.is-domain .classic-tree-mark {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

.classic-tree-node.is-root .classic-tree-mark {
  width: 23px;
  height: 23px;
  border: 0;
  background: var(--text-primary);
  box-shadow: 0 0 0 5px var(--bg-primary, #fff);
}

.classic-tree-node.is-open > .classic-tree-mark,
.classic-tree-node.has-children:hover > .classic-tree-mark {
  border-color: var(--classic-line-active);
  background: var(--classic-line-active);
}

.classic-tree-node.has-children:not(.is-root):not(.is-open) > .classic-tree-mark::after {
  content: "+";
  position: absolute;
  inset: -7px -7px -7px -7px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
}

.classic-tree-node.has-children:hover > .classic-tree-mark,
.classic-tree-node.has-children:focus-visible > .classic-tree-mark {
  transform: scale(1.18);
}

.classic-tree-node.is-evidence > .classic-tree-mark,
.classic-tree-node.is-photo > .classic-tree-mark {
  width: 5px;
  height: 5px;
  border: 0;
  background: var(--classic-node-soft);
}

.classic-tree-node.is-photo > .classic-tree-mark {
  border-radius: 1px;
  transform: rotate(45deg);
}

.classic-tree-node.is-evidence:hover > .classic-tree-mark,
.classic-tree-node.is-evidence:focus-visible > .classic-tree-mark,
.classic-tree-node.is-photo:hover > .classic-tree-mark,
.classic-tree-node.is-photo:focus-visible > .classic-tree-mark {
  background: var(--classic-line-active);
  transform: scale(1.5);
}

.classic-tree-node.is-photo:hover > .classic-tree-mark,
.classic-tree-node.is-photo:focus-visible > .classic-tree-mark {
  transform: rotate(45deg) scale(1.5);
}

.classic-tree-label {
  display: block;
  max-width: 168px;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 450;
  line-height: 1.35;
  text-wrap: balance;
  overflow-wrap: anywhere;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.classic-tree-node.is-root > .classic-tree-label {
  padding: 0 5px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 650;
}

.classic-tree-node.is-domain > .classic-tree-label {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.classic-tree-node.is-skill > .classic-tree-label,
.classic-tree-node.is-group > .classic-tree-label {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.classic-tree-node.is-collection > .classic-tree-label,
.classic-tree-node.is-year > .classic-tree-label {
  color: var(--text-primary);
  font-size: 0.73rem;
  font-weight: 550;
}

.classic-tree-node.is-evidence > .classic-tree-label,
.classic-tree-node.is-photo > .classic-tree-label {
  max-width: 124px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 400;
}

.classic-tree-node.is-leaf:hover > .classic-tree-label,
.classic-tree-node.is-leaf:focus-visible > .classic-tree-label,
.classic-tree-node.is-selected > .classic-tree-label {
  color: var(--text-primary);
}

.classic-tree-node:focus-visible {
  outline: 0;
}

.classic-tree-node:focus-visible > .classic-tree-label {
  border-radius: 3px;
  outline: 2px solid var(--text-secondary);
  outline-offset: 3px;
}

.classic-tree-count {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 400;
  white-space: nowrap;
}

.classic-tree-auto {
  display: inline-block;
  margin-left: 3px;
  padding: 0 3px;
  border: 1px solid var(--border-light, #e5e5e5);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.54rem;
  font-weight: 400;
  line-height: 1.4;
  vertical-align: 1px;
}

@keyframes classic-edge-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

[data-theme="dark"] .skilltree-classic {
  --classic-line: #484944;
  --classic-line-active: #d7d7d2;
  --classic-node: #d0d0cb;
  --classic-node-soft: #777873;
}

[data-theme="dark"] .classic-tree-edge.is-active {
  stroke: #696a65;
}

@media (max-width: 760px) {
  .skilltree-cloud {
    height: 280px;
  }

  .classic-tree-scroll {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .classic-tree-node {
    max-width: 110px;
  }

  .classic-tree-label {
    max-width: 104px;
    font-size: 0.6875rem;
  }

  .classic-tree-node.is-domain > .classic-tree-label {
    font-size: 0.76rem;
  }

  .classic-tree-node.is-evidence > .classic-tree-label,
  .classic-tree-node.is-photo > .classic-tree-label {
    max-width: 96px;
    font-size: 0.625rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .classic-tree-edge,
  .classic-tree-stage,
  .classic-tree-mark,
  .classic-tree-label {
    animation: none;
    transition: none;
    opacity: 1;
  }
}

/* Reader preferences: must come last to override detail base styles */.article-detail .body,.tech-detail .body {  font-size: var(--reader-font-size, 1rem);  line-height: var(--reader-line-height, 1.85);}

/* Navigation readability: switch to the full-height menu earlier on tablets. */
@media (max-width: 1024px) {
  .nav-inner {
    height: 60px;
    padding: 0 16px;
    gap: 8px;
  }

  .site-logo {
    width: 60px;
    height: 60px;
    max-width: 60px;
    max-height: 60px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
  }

  .nav-links {
    display: none !important;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 8px 0;
    background: var(--bg);
    border-bottom: 1px solid #e8e8e8;
    z-index: 95;
  }

  .nav-links.open {
    display: flex !important;
  }

  .nav-links li {
    display: block;
    width: 100%;
    height: auto;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 14px 20px;
    border-bottom: none;
    font-size: 1rem;
    line-height: 1.35;
  }

  .nav-links a.active {
    border-bottom: none;
    background: #f0f0f0;
  }

  .nav-links .nav-sep {
    width: auto;
    height: 1px;
    margin: 4px 20px;
    background: var(--border-light);
  }
}
