:root {
  --bg: #f6f3ec;
  --panel: #fffdf9;
  --ink: #2d342f;
  --muted: #747c74;
  --line: #deded5;
  --green: #516d56;
  --soft: #e8eee4;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a, input, textarea, select { outline-offset: 3px; }
[hidden] { display: none !important; }
button:disabled { cursor: wait; opacity: .6; }

.entry-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 44px 20px; }
.entry-wrap { width: 100%; max-width: 400px; }
.entry-header { text-align: center; margin-bottom: 26px; }
.entry-mark { display: inline-block; margin: 0 0 16px; padding: 7px 10px; border: 1px solid #b8c4b4; border-radius: 4px; color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.entry-header h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.entry-header > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.entry-card { padding: 26px 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.entry-intro { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.entry-card .account-tabs { padding: 0 0 16px; margin-bottom: 20px; gap: 8px; border-bottom: 1px solid var(--line); }
.entry-card .account-tabs .filter { flex: 1; padding: 9px 8px; }
.entry-card label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 600; }
.entry-card .account-form > label:first-child { margin-top: 0; }
.entry-card input { display: block; width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #ccd4ca; border-radius: 4px; background: #fff; color: var(--ink); }
.entry-card input:focus { outline: 2px solid #516d5655; border-color: var(--green); outline-offset: 1px; }
.entry-card .field-help { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.entry-card .solid-button { width: 100%; min-height: 43px; margin-top: 24px; }
.entry-card .dialog-message:empty { display: none; }
.entry-message { margin: 16px 0 0; color: var(--green); font-size: 13px; line-height: 1.7; }
.entry-footnote { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; }

.site-wrap { max-width: 1060px; margin: auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--green); color: #fff; padding: 8px; }
.skip-link:focus { left: 8px; }
.site-header { padding-top: 28px; }
.header-main { display: flex; align-items: center; gap: 22px; padding-bottom: 23px; }
.site-title { font-size: 25px; font-weight: 800; letter-spacing: -.05em; }
.site-title:hover { color: var(--green); }
.header-main > p { margin: 4px auto 0 0; color: var(--muted); font-size: 13px; }
.account-actions { display: flex; align-items: center; gap: 8px; }
.login-button, .simple-button {
  border: 1px solid #a9b9a8;
  background: var(--panel);
  color: var(--green);
  border-radius: 4px;
  padding: 8px 13px;
  font-size: 13px;
}
.login-button:hover, .simple-button:hover { background: var(--soft); }
.main-nav { display: flex; align-items: center; gap: 0; overflow: hidden; background: var(--green); border-radius: 4px 4px 0 0; }
.main-nav a { color: #fff; padding: 13px 22px; font-size: 14px; }
.main-nav a:hover { background: #425b47; }
.welcome { margin-bottom: 20px; padding: 18px 22px; background: #edf1e9; border: 1px solid #dce4d9; border-top: 0; border-radius: 0 0 4px 4px; }
.welcome p { margin: 0; line-height: 1.8; color: #526257; }
.site-notice { margin: 0 0 20px; padding: 11px 14px; border: 1px solid #e6d8ba; border-radius: 4px; background: #fbf4e7; color: #725c37; font-size: 13px; line-height: 1.6; }
.forum-panel { margin-bottom: 26px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 23px 24px; }
.panel-head h1, .panel-head h2 { margin: 0 0 6px; font-size: 20px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.filter-row, .account-tabs { display: flex; align-items: center; gap: 5px; padding: 0 18px 16px; flex-wrap: wrap; }
.filter { padding: 7px 12px; border: 0; border-radius: 4px; background: none; color: #68756b; font-size: 13px; }
.filter:hover { background: #f0f3ed; }
.filter.active { background: var(--soft); color: #34573b; font-weight: 700; }
.list-heading { display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px; padding: 10px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f2f4ef; color: #78827a; font-size: 12px; }
.list-heading span:nth-child(2), .list-heading span:nth-child(3) { text-align: right; }
.post-card { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) 100px 100px; align-items: center; padding: 18px 22px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.post-card:last-child { border-bottom: 0; }
.post-card:hover { background: #fafaf6; }
.post-content { grid-column: 1; grid-row: 1; min-width: 0; }
.post-content h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.post-card:hover h3 { color: var(--green); }
.post-content p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; }
.post-kind { grid-column: 2; grid-row: 1; color: var(--green); font-size: 12px; text-align: right; }
.post-date { grid-column: 3; grid-row: 1; color: #899189; font-size: 12px; text-align: right; }
.empty-state { margin: 0; padding: 28px 22px; color: var(--muted); }
.board-row { display: flex; width: 100%; align-items: center; gap: 17px; padding: 20px 24px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.board-row:hover { background: #fafaf6; }
.board-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 4px; background: var(--soft); color: var(--green); font-size: 12px; font-weight: 700; }
.board-info { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.board-info strong { font-size: 15px; }
.board-excerpt { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.board-status { color: #718475; font-size: 12px; white-space: nowrap; }
.about-box { margin-bottom: 30px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.about-box h2 { margin: 0 0 10px; font-size: 18px; }
.about-box p { margin: 0; color: var(--muted); line-height: 1.8; }
footer { padding: 5px 0 32px; color: #8d948d; font-size: 12px; text-align: center; }
footer span { margin: 0 5px; }

.modal { position: relative; max-width: min(92vw, 580px); max-height: 88vh; overflow: auto; padding: 29px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px #25332944; }
.modal::backdrop { background: #24352c9c; }
.modal-close { position: absolute; top: 10px; right: 15px; border: 0; background: none; color: var(--muted); font-size: 27px; }
.modal h2 { margin: 0 0 14px; font-size: 21px; }
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.dialog-intro, .dialog-footnote, .studio-notice { color: var(--muted); font-size: 13px; line-height: 1.7; }
.dialog-footnote { margin: 16px 0 0; font-size: 11px; }
.studio-notice { margin: 0 0 15px; padding: 10px 12px; border-radius: 3px; background: #f4eee3; color: #815e43; }
.modal label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 10px 11px; border: 1px solid #ccd4ca; border-radius: 3px; background: #fff; color: var(--ink); }
.modal textarea { resize: vertical; }
.solid-button { margin-top: 17px; padding: 10px 15px; border: 1px solid var(--green); border-radius: 4px; background: var(--green); color: white; font-size: 13px; font-weight: 700; }
.solid-button:hover { background: #425b47; }
.reader-modal { width: min(92vw, 700px); padding: 38px; }
.reader-meta { margin-bottom: 18px; color: var(--green); font-size: 12px; }
.reader-modal h2 { font-size: 27px; }
.reader-body { color: #4e5b50; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.reader-body p { margin: 18px 0; white-space: pre-wrap; }
.account-modal { width: min(92vw, 460px); }
.account-tabs { padding: 0 0 10px; }
.account-form { padding-bottom: 8px; }
.account-form .solid-button { width: 100%; }
.dialog-message { min-height: 1.4em; margin: 10px 0 0; color: #8a5a34; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.studio-modal { width: min(92vw, 740px); }
.studio-modal > p { color: var(--muted); }
.draft-actions { display: flex; align-items: center; gap: 16px; }
.draft-actions .solid-button { margin-top: 17px; }
.quiet-button { margin-top: 12px; padding: 7px 10px; border: 0; background: none; color: var(--green); }
.quiet-button:hover { text-decoration: underline; }
.search-modal { width: min(92vw, 600px); }
.search-modal input { margin: 5px 0 18px; }
.search-results button { display: block; width: 100%; padding: 12px 2px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.search-results button:hover { color: var(--green); }
.search-results small, .my-post-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.search-results p { color: var(--muted); font-size: 13px; }
.my-post-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.my-post-row > strong { min-width: 0; overflow-wrap: anywhere; }
.my-post-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.my-post-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.search-results .my-post-title { padding: 0; border: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.my-post-actions { display: flex; gap: 6px; flex-shrink: 0; }
.search-results .my-post-actions button { width: auto; margin: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--green); white-space: nowrap; }
.search-results .my-post-actions .danger-button, .danger-button { color: #945d45; }
.reader-actions { display: flex; gap: 14px; align-items: center; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader-actions .quiet-button { margin: 0; }
.delete-modal { width: min(92vw, 440px); }
.delete-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 22px; }
.delete-actions .solid-button { margin: 0; }
.admin-modal { width: min(94vw, 720px); }
.admin-section { padding: 17px 0; border-top: 1px solid var(--line); }
.admin-section .dialog-intro { margin: 0; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-heading .quiet-button { margin: 0; }
.invite-output { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; background: var(--soft); overflow-wrap: anywhere; }
.invite-output code { font-size: 15px; letter-spacing: .05em; }
.invite-output .quiet-button { flex: 0 0 auto; margin: 0; }
.moderation-item { padding: 15px 0; border-top: 1px solid var(--line); }
.moderation-item h4 { margin: 0 0 5px; font-size: 15px; }
.moderation-item small { color: var(--muted); }
.moderation-item p { max-height: 140px; overflow: auto; color: #4e5b50; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.moderation-actions { display: flex; align-items: center; gap: 12px; }
.moderation-actions .solid-button, .moderation-actions .quiet-button { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 700px) {
  .site-wrap { padding: 0 14px; }
  .header-main { flex-wrap: wrap; gap: 5px; padding-bottom: 16px; }
  .site-title { width: 100%; font-size: 22px; }
  .header-main > p { flex: 1; }
  .account-actions { gap: 5px; }
  .account-actions .simple-button, .account-actions .login-button { padding: 7px 8px; font-size: 12px; }
  .main-nav a { padding: 12px 17px; }
  .welcome { padding: 15px; }
  .panel-head { padding: 18px; }
  .list-heading { grid-template-columns: minmax(0, 1fr) 64px 78px; padding: 9px 15px; }
  .post-card { grid-template-columns: minmax(0, 1fr) 64px 78px; padding: 15px; }
  .post-content h3 { font-size: 14px; }
  .post-content p { font-size: 11px; }
  .post-kind, .post-date { font-size: 11px; }
  .board-row { padding: 16px; }
  .board-status { display: none; }
  .modal { padding: 24px 19px; }
  .reader-modal { padding: 34px 22px; }
}

@media (max-width: 430px) {
  .my-post-row { flex-wrap: wrap; }
  .my-post-info { flex-basis: 100%; }
  .entry-page { padding: 28px 18px; }
  .entry-card { padding: 23px 22px; }
  .account-actions { width: 100%; }
  .account-actions .simple-button, .account-actions .login-button { flex: 1; }
  .main-nav a { flex: 1; padding: 11px 8px; text-align: center; }
  .list-heading { grid-template-columns: minmax(0, 1fr) 58px 68px; padding-right: 11px; padding-left: 11px; }
  .post-card { grid-template-columns: minmax(0, 1fr) 58px 68px; padding-right: 11px; padding-left: 11px; }
  .post-content p { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
