:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef2f4;
  --ink: #1f2933;
  --muted: #5f6d78;
  --line: #e1e7eb;
  --blue: #3868d8;
  --blue-soft: #e9efff;
  --green: #27815c;
  --amber: #a8731a;
  --red: #bd4d4d;
  --shadow: 0 8px 24px rgba(40, 57, 71, .07);
  --sans: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); color: var(--ink); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
body.modal-open { overflow: hidden; }
a { color: inherit; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.directory-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 26px 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand::before { display: none; }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -.03em; }
.brand-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.header-meta { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.status-dot.warn { background: var(--amber); }
.status-dot.error { background: var(--red); }

.directory-main { padding: 34px 0 60px; }
.home-top { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 27px; }
.home-title { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.12; letter-spacing: -.055em; }
.home-note { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.bubble-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.bubble-link { display: flex; min-height: 78px; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-decoration: none; transition: background 150ms ease, border-color 150ms ease; }
.bubble-link:hover { border-color: #b8c7ef; background: var(--blue-soft); }
.bubble-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.bubble-icon svg, .panel-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.bubble-copy { min-width: 0; }
.bubble-title { display: block; font-size: 15px; font-weight: 700; }
.bubble-sub, .bubble-arrow { display: none; }

.experience-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; gap: 11px; }
.panel-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.section-count { display: none; }
.page-info { color: var(--muted); font-size: 12px; }
.experience-stream { min-height: 400px; }
.experience-entry { display: flex; min-height: 52px; align-items: center; gap: 15px; padding: 0 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 150ms ease; }
.experience-entry:last-child { border-bottom: 0; }
.experience-entry:hover { background: #f8fafc; }
.entry-index { display: none; }
.experience-title { min-width: 0; flex: 1; margin: 0; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.experience-meta, .experience-status, .experience-tags, .experience-text, .entry-arrow { display: none; }
.feed-message { margin: 0; padding: 28px 22px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 17px 22px; border-top: 1px solid var(--line); }
.page-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; }
.page-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.page-button:disabled { color: #c3cbd1; cursor: default; }
.page-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 27px; color: var(--muted); font-size: 11px; }

.detail-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(31, 41, 51, .24); opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.detail-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-dialog { width: min(580px, 100%); max-height: min(680px, calc(100vh - 48px)); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 42px rgba(31, 41, 51, .14); transform: translateY(8px); transition: transform 160ms ease; }
.detail-backdrop.open .detail-dialog { transform: translateY(0); }
.detail-top { display: flex; align-items: start; justify-content: space-between; gap: 22px; }
.detail-top h2 { margin: 0; font-size: 21px; line-height: 1.35; letter-spacing: -.035em; }
.detail-close { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 0; border-radius: 12px; background: var(--surface-soft); color: var(--muted); cursor: pointer; }
.detail-close:hover { color: var(--ink); }
.detail-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.detail-body { margin-top: 22px; color: #4e5a64; font-size: 14px; white-space: pre-line; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.subpage-main { padding: 34px 0 60px; }
.subpage-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.eyebrow { display: none; }
.subpage-head h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.05em; }
.back-link { color: var(--blue); font-size: 13px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.subpage-note { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.announcement-list { margin-top: 20px; }
.announcement-item { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 22px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.announcement-date { color: var(--blue); font: 12px var(--mono); padding-top: 3px; }
.announcement-title { margin: 0 0 5px; font-size: 17px; line-height: 1.35; }
.announcement-title a { text-decoration: none; }
.announcement-title a:hover { color: var(--blue); }
.announcement-status { color: var(--muted); font-size: 12px; }
.announcement-points { margin: 11px 0 0; padding-left: 18px; color: #4e5a64; font-size: 13px; }
.announcement-points li + li { margin-top: 4px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.admin-stat { padding: 20px; border-right: 1px solid var(--line); }
.admin-stat:last-child { border-right: 0; }
.admin-label { color: var(--muted); font-size: 12px; }
.admin-value { margin-top: 7px; color: var(--blue); font: 23px var(--mono); }
.admin-value-date { font-size: 16px; }
.admin-links { margin-top: 24px; border-top: 1px solid var(--line); }
.admin-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.admin-link:hover { color: var(--blue); }
.admin-link small { color: var(--muted); font-size: 12px; }
.admin-link-static { color: var(--muted); }
.admin-link-static:hover { color: var(--muted); }

.assistant-wrap { width: min(820px, 100%); margin: 0 auto; }
.assistant-thread { min-height: 48vh; padding: 20px 0; }
.assistant-message { padding: 18px 0; border-bottom: 1px solid var(--line); }
.assistant-message.user { padding-left: 10%; }
.message-role { margin-bottom: 6px; color: var(--blue); font-size: 12px; }
.message-body { color: #303a43; white-space: pre-wrap; }
.assistant-composer { position: sticky; bottom: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.assistant-composer textarea { display: block; width: 100%; min-height: 72px; padding: 2px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); }
.assistant-composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.send-button { padding: 7px 15px; border: 0; border-radius: 10px; background: var(--blue); color: white; cursor: pointer; }
.send-button:disabled { opacity: .5; cursor: wait; }
.assistant-error { color: var(--red); }
.markdown p { margin: 0 0 12px; }
.markdown p:last-child { margin-bottom: 0; }
.markdown ul, .markdown ol { margin: 0 0 12px; padding-left: 22px; }
.markdown pre { overflow-x: auto; padding: 14px; border-radius: 12px; background: #eef1f3; border: 1px solid var(--line); font: 13px/1.6 var(--mono); }
.markdown code { padding: 1px 4px; border-radius: 4px; background: #eef1f3; font: .9em var(--mono); }

:where(a, button, [role="button"]):focus-visible { outline: 3px solid rgba(56, 104, 216, .36); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 760px) {
  .directory-shell { width: min(100% - 30px, 620px); }
  .site-header { align-items: flex-start; padding-top: 18px; }
  .header-meta { display: block; text-align: right; }
  .header-meta > * { display: block; }
  .directory-main, .subpage-main { padding-top: 22px; }
  .home-top { display: block; margin-bottom: 20px; }
  .home-note { max-width: none; margin-top: 8px; text-align: left; }
  .bubble-nav { grid-template-columns: 1fr; gap: 9px; margin-bottom: 22px; }
  .bubble-link { min-height: 62px; padding: 11px 14px; border-radius: 16px; }
  .bubble-icon { width: 35px; height: 35px; flex-basis: 35px; border-radius: 11px; }
  .bubble-title { font-size: 15px; }
  .experience-panel { border-radius: 19px; }
  .panel-head { padding: 15px; }
  .experience-entry { min-height: 52px; gap: 8px; padding: 0 15px; }
  .experience-title { font-size: 14px; }
  .pagination { padding: 14px; }
  .site-footer { display: block; }
  .site-footer span { display: block; }
  .site-footer span + span { margin-top: 4px; }
  .detail-backdrop { padding: 15px; }
  .detail-dialog { padding: 20px; border-radius: 20px; }
  .subpage-head { display: block; }
  .back-link { display: inline-block; margin-top: 13px; }
  .announcement-item { grid-template-columns: 1fr; gap: 4px; }
  .admin-grid { display: block; border-radius: 18px; }
  .admin-stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-stat:last-child { border-bottom: 0; }
  .assistant-message.user { padding-left: 0; }
}
