/* Use Microsoft YaHei throughout the site, with a fallback on other devices. */
body, .uid { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; }
/* Keep long prose and unbroken URLs within their text containers. */
.wrap, .card, .markdown-body, .comment-text, .comment-reply-context,
.plain-text, .board-sidebar, .board-hero, .board-section {
  overflow-wrap: anywhere;
  word-break: normal;
}
textarea {
  min-width: 0;
  max-width: 100%;
  max-height: 460px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  resize: vertical;
}
/* Keep editor scrollbars visible and easy to drag on the dark background. */
textarea, .markdown-live-preview, .wiki-contenteditable, .wiki-page-source {
  scrollbar-width: auto;
  scrollbar-color: #b97883 #211519;
}
:is(textarea, .markdown-live-preview, .wiki-contenteditable, .wiki-page-source)::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
:is(textarea, .markdown-live-preview, .wiki-contenteditable, .wiki-page-source)::-webkit-scrollbar-track {
  background: #211519;
}
:is(textarea, .markdown-live-preview, .wiki-contenteditable, .wiki-page-source)::-webkit-scrollbar-thumb {
  background: #b97883;
  border: 3px solid #211519;
  border-radius: 8px;
}
:is(textarea, .markdown-live-preview, .wiki-contenteditable, .wiki-page-source)::-webkit-scrollbar-thumb:hover {
  background: #e2a0a0;
}
input, select { min-width: 0; max-width: 100%; }
.card, .grid > *, .board-layout > *, .board-manage-layout > *,
.board-hero > *, .board-section-heading > *, .post-row > *,
.manage-board-title > *, .manage-sections > div > *, .comment-meta > *,
.author-line > *, .download-row > * {
  min-width: 0;
}
.plain-text, .comment-text, .markdown-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.markdown-body pre code { white-space: inherit; overflow-wrap: inherit; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; }
.profile-public-intro { display:flex; gap:16px; flex-wrap:wrap; align-items:center; margin: -8px 0 10px; }
.profile-hero h1, .profile-section > summary, .page-heading h1, .workshop-heading h1 { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; letter-spacing: .04em; }
.profile-hero h1 { font-size: clamp(28px, 4vw, 40px); text-shadow: 0 2px 14px #0008; }
.profile-section > summary { letter-spacing: .02em; }
.profile-links a, .btn, button { letter-spacing: .02em; }
.public-content-list { display:grid; gap:12px; }
.public-content-card { display:flex; justify-content:space-between; gap:20px; margin:0; }
.public-content-card h3 { margin:0 0 6px; }
.public-content-card p { margin:4px 0; overflow-wrap:anywhere; }
.public-content-card p:not(.muted) { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.board-card-body > p:first-of-type { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.post-row p { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.profile-section { margin:18px 0; border:1px solid #4a2c33; border-radius:10px; background:#180f12; overflow:hidden; }
.profile-section > summary { padding:16px 20px; cursor:pointer; list-style:none; font-size:20px; font-weight:600; color:#f0d5d8; }
.profile-section > summary::-webkit-details-marker { display:none; }
.profile-section > summary::before { content:'＋'; display:inline-block; width:24px; color:#e35a60; }
.profile-section[open] > summary::before { content:'−'; }
.profile-section > summary:hover { background:#2a171d; }
.profile-section > :not(summary) { margin-left:20px; margin-right:20px; }
.profile-project-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; padding-top:2px; padding-bottom:20px; }
.profile-project-grid .card { margin:0; padding:16px; min-width:0; }
.profile-project-grid .public-content-card { display:block; }
.profile-project-grid .public-content-card time { display:block; margin-top:10px; }
.profile-project-grid h3 { font-size:17px; }
.profile-project-grid h3 { display:block; min-height:1.5em; line-height:1.5; overflow:hidden; overflow-wrap:normal; white-space:nowrap; text-overflow:ellipsis; }
.profile-project-grid > .empty-state { grid-column:1 / -1; }
.profile-project-card { display:flex; flex-direction:column; min-width:0; border:1px solid #593039; border-radius:8px; overflow:hidden; background:#211519; }
.profile-project-card:focus-within, .profile-project-card:hover { border-color:#be5864; }
.profile-project-cover { display:flex; align-items:center; justify-content:center; aspect-ratio:1; background:radial-gradient(ellipse,#45232b,#1b1115); color:#c2a3a8; }
.profile-project-cover img { display:block; width:100%; height:100%; object-fit:cover; }
.profile-project-body { padding:14px; display:flex; flex-direction:column; gap:8px; flex:1; min-width:0; }
.profile-project-body h3, .profile-project-body p { margin:0; }
.profile-project-body h3 { font-family:"Microsoft YaHei","微软雅黑",sans-serif; font-weight:600; line-height:1.5; }
.profile-project-body time, .profile-project-body .muted { font-size:13px; }
.profile-project-summary { display:block; height:1.5em; line-height:1.5; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:14px; color:#d9c2c6; }
.profile-project-body .content-actions { margin-top:auto; padding-top:8px; display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); align-items:stretch; gap:8px; }
.profile-project-body .content-actions form { display:flex; margin:0; min-width:0; }
.profile-project-body .content-actions .btn,
.profile-project-body .content-actions button { display:flex; align-items:center; justify-content:center; width:100%; height:38px; min-width:0; margin:0; padding:0 6px; box-sizing:border-box; border:1px solid #a33b46; font-size:12px; line-height:1.2; letter-spacing:0; white-space:nowrap; }
.profile-project-body button { padding:7px 10px; font-size:13px; }
.profile-section > summary .muted { font:400 13px/1.6 "Microsoft YaHei","微软雅黑",sans-serif; letter-spacing:0; }
.profile-section .tag { color:#ecc4ca; border-color:#73414b; background:#351d24; }
@media(max-width:600px){ .public-content-card { flex-direction:column; gap:8px; } }
@media(max-width:1050px){ .profile-project-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:760px){ .profile-project-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:480px){ .profile-project-grid { grid-template-columns:1fr; } }

/* Shared interaction cues and small-screen safeguards. */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; background: #e2a0a0; color: #1b1115; border-radius: 0 0 6px 6px; }
.skip-link:focus { top: 0; }
.breadcrumbs { margin: 8px 0 18px; }
.breadcrumbs span { color: #a99b9e; }
.status-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.status-help { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.form-errors { padding: 12px 16px; border: 1px solid #a33b46; border-radius: 8px; background: #351b21; color: #ffb7bd; }
.form-help { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.empty-state { border: 1px dashed #63343d; border-radius: 8px; }
.empty-state .btn { margin-top: 8px; }
.flash-success { border-left-color: #6dbb8b; }
.flash-error { border-left-color: #e35a60; }
@media (max-width: 600px) {
  .content-actions { width: 100%; }
  .content-actions .btn, .content-actions button { flex: 1 1 auto; text-align: center; }
  .pagination { flex-wrap: wrap; align-items: center; }
}

/* Clear, safe editor actions.  File clearing is deliberately separated from
   the primary save button so it is easy to understand and hard to trigger by
   accident. */
.editor-form p { margin: 0 0 16px; }
.editor-form label { display: block; margin: 14px 0 6px; color: #f0d5d8; font-weight: 600; }
.editor-form input[type="file"] { display: block; width: 100%; padding: 12px; border: 1px dashed #73414b; background: #1b1115; }
.editor-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: #d14b56; vertical-align: -3px; margin-right: 7px; }
.editor-form input[type="checkbox"][name$="-clear"] { accent-color: #d14b56; }
.editor-form input[type="checkbox"][name$="-clear"] + label,
.editor-form input[type="checkbox"][name$="-clear"] ~ label { display: inline; color: #ffb1b7; font-size: 14px; font-weight: 500; }
.editor-form p:has(input[type="checkbox"]) { padding: 14px 16px; border: 1px solid #63343d; border-radius: 10px; background: #2a171d; }
.editor-form p:has(input[type="checkbox"]) label { display: inline; margin: 0 8px 0 0; }
.project-video-field { margin: 22px 0; padding: 16px 18px 8px; border: 1px solid #78404a; border-radius: 10px; background: linear-gradient(135deg,#2a171d,#1b1115); }
.project-video-field legend { padding: 0 8px; color: #f0d5d8; font-size: 17px; font-weight: 700; }
.project-video-field label { margin-top: 8px; }
.project-video-field input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.project-video-field .form-help { margin-bottom: 10px; }
.toggle-row { display: flex !important; align-items: center; gap: 8px; padding: 14px 16px; border: 1px solid #63343d; border-radius: 10px; background: #2a171d; }
.toggle-row span { font-weight: 700; }
.toggle-row small { margin-left: auto; color: var(--muted); font-weight: 400; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 9px; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-button { border: 1px solid #e35a60; background: linear-gradient(135deg, #a8323d, #d14b56); color: #fff; box-shadow: 0 5px 16px #8e2c3538; }
.primary-button:hover { background: linear-gradient(135deg, #c2444e, #e35a60); box-shadow: 0 7px 20px #e35a6055; transform: translateY(-1px); text-decoration: none; }
.secondary-button { border: 1px solid #73414b; background: #29171d; color: #efc3c7; }
.secondary-button:hover { background: #3a2027; text-decoration: none; }
@media (max-width: 600px) { .toggle-row { align-items: flex-start; flex-wrap: wrap; } .toggle-row small { flex-basis: 100%; margin-left: 28px; } .primary-button, .secondary-button { flex: 1 1 180px; } }

.notification-nav { position:relative; } .notification-badge { display:inline-flex; min-width:18px; height:18px; align-items:center; justify-content:center; margin-left:4px; padding:0 5px; border-radius:10px; background:#e35a60; color:#fff; font-size:11px; line-height:1; } .notification-list { display:grid; gap:10px; } .notification-item { display:flex; gap:14px; align-items:flex-start; padding:18px 20px; background:#211519; border:1px solid #4a2c33; border-radius:10px; } .notification-item.is-unread { border-left:3px solid #e35a60; background:#2a171d; } .notification-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#482028; color:#f0b5bb; flex:0 0 auto; } .notification-content { min-width:0; flex:1; } .notification-title { font-weight:700; color:#f0d2d5; } .notification-content p { margin:4px 0 8px; overflow-wrap:anywhere; }

.markdown-editor{border:1px solid #63343d;border-radius:10px;background:#180f12;overflow:hidden;margin:6px 0 14px}.markdown-editor textarea{display:block;border:0;border-radius:0;margin:0;min-height:260px;overflow-y:scroll}.markdown-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:9px;border-bottom:1px solid #63343d;background:#2a171d}.markdown-tool{padding:6px 10px;border:1px solid #73414b;border-radius:6px;background:#3a2027;color:#f0d5d8;font-size:13px}.markdown-tool:hover,.markdown-tool[aria-pressed=true]{background:#8e2c35}.markdown-preview-toggle{margin-left:auto}.markdown-live-preview{min-height:260px;max-height:460px;overflow-x:auto;overflow-y:scroll;scrollbar-gutter:stable;padding:14px;background:#161015;overflow-wrap:anywhere}.markdown-live-preview img{max-width:100%;height:auto}.markdown-help code{color:#f0b7bd}
.preview-manager{margin:18px 0;padding:14px;border:1px solid #63343d;border-radius:10px;background:#1b1115}.preview-manager legend{padding:0 8px;color:#f0d5d8;font-weight:700}.preview-manager-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.preview-manager-item{position:relative;display:flex;flex-direction:column;gap:8px;padding:8px;border:1px solid #4a2c33;border-radius:8px;background:#211519;color:#d9c2c6;cursor:grab;touch-action:none;user-select:none;min-width:0}.preview-manager-item img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;background:#120f12;pointer-events:none}.preview-manager-item.is-dragging{opacity:.6;border-color:#ff6b79;cursor:grabbing}.preview-position{text-align:center;font-size:13px}.preview-manager .preview-remove{position:absolute;right:4px;top:4px;width:28px;height:28px;min-height:0;padding:0;border:1px solid #ff7480;border-radius:50%;background:#9f1828;color:#fff;font-size:23px;line-height:24px;display:grid;place-items:center;cursor:pointer;box-shadow:0 2px 6px #0009}.preview-manager .preview-remove:hover{background:#dc3045}.preview-manager [hidden]{display:none!important}

/* Markdown emits its own line breaks; do not render HTML source newlines twice. */
.markdown-body, .comment-text.markdown-body { white-space: normal; }
.markdown-body pre, .markdown-body pre code { white-space: pre-wrap; }
