/* Workspace (创作坊): the team room and home. Shared by /workspace.html and the town workbench. */
.ws-card { border: 1px solid var(--line, #E6D9C8); border-radius: 28px; padding: 18px 20px; background: var(--surface, #FFFCF7); margin-bottom: 14px; }
.ws-card h2, .ws-card h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.35; }
.ws-card h2 { font-size: 22px; }
.ws-meta { font-size: 13px; color: var(--text-3, #8A7B6E); margin: 2px 0; }
.ws-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.ws-item { border-top: 1px solid var(--line, #EFE6DA); padding: 10px 0; }
.ws-item:first-child { border-top: none; }
.ws-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin: 4px 0; }
.ws-text.is-bad { color: #9B2C1F; }
.ws-brief { white-space: pre-wrap; background: var(--paper-2, #F6EFE4); border-radius: 16px; padding: 10px 14px; margin: 8px 0 0; font-size: 14px; line-height: 1.7; max-height: 9em; overflow: auto; }
.ws-grid { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(300px, 1fr) minmax(340px, 1.2fr); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .ws-grid { grid-template-columns: 1fr 1fr; } .ws-grid > :last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ws-grid { grid-template-columns: 1fr; } .ws-grid > :last-child { grid-column: auto; } }
.ws-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--paper-2, #EFE6DA); color: var(--text-2, #5a4a3a); white-space: nowrap; vertical-align: middle; }
.ws-badge.is-ok { background: #E8F4EA; color: #2E6B3F; }
.ws-badge.is-warn { background: #FCE9D9; color: #A0471B; }
.ws-badge.is-bad { background: #F8DEDA; color: #9B2C1F; }
.ws-form textarea, .ws-form input, .ws-form select { width: 100%; box-sizing: border-box; }
.ws-form textarea { min-height: 84px; }
.ws-form label { display: block; font-size: 14px; margin: 10px 0 4px; color: var(--text-2, #5a4a3a); }
.ws-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-inline input, .ws-inline select { width: auto; flex: 1 1 140px; }
.ws-checks { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.ws-checks .is-bad { color: #9B2C1F; }
.ws-frame { width: 100%; height: 60vh; min-height: 320px; border: 1px solid var(--line, #E6D9C8); border-radius: 16px; background: #fff; display: block; }
.ws-frame.is-phone { width: 390px; max-width: 100%; margin: 0 auto; }
.ws-empty { color: var(--text-3, #8A7B6E); font-size: 14px; }
.ws-files { display: grid; gap: 2px; max-height: 16em; overflow: auto; }
.ws-file-row { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; color: inherit; }
.ws-file-row:hover, .ws-file-row:focus-visible { border-color: var(--line, #E6D9C8); background: var(--surface, #FFFCF7); }
.ws-file { margin: 8px 0 0; padding: 12px; max-height: 22em; overflow: auto; background: #2b2118; color: #F6EFE4; border-radius: 16px; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-steps { margin-top: 4px; display: grid; gap: 2px; max-height: 12em; overflow: auto; }
.ws-step { font-size: 13px; }
.ws-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; background: var(--paper-2, #F6EFE4); border-radius: 8px; padding: 2px 8px; }
.ws-staff { border: 1px dashed var(--line, #E6D9C8); border-radius: 16px; padding: 8px 12px; margin-top: 10px; }
.ws-staff summary { cursor: pointer; font-size: 14px; color: var(--text-2, #5a4a3a); }
html.kp-embed .kp-header { display: none; }
html.kp-embed main.kp-section { padding-top: 12px !important; }

/* --- Workbench modal (embedded in the town): one header row; only the content scrolls */
html.kp-workbench body { display: flex; flex-direction: column; height: 100dvh; min-height: 0; margin: 0; overflow: hidden; }
html.kp-workbench .kp-dev-banner { flex: none; }
.ws-head { display: flex; flex: none; align-items: center; gap: 18px; height: 64px; box-sizing: border-box; padding: 0 14px 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); }
.ws-head-name { flex: none; font-size: 19px; font-weight: 700; white-space: nowrap; }
.ws-tabs { display: flex; flex: 1; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs a, .ws-tabs button { flex: none; display: inline-block; max-width: 18em; min-height: 40px; box-sizing: border-box; padding: 8px 12px; overflow: hidden; border: 0; border-radius: 10px; background: none; color: var(--text-muted); font: inherit; font-size: 14px; line-height: 24px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ws-tabs a:hover, .ws-tabs button:hover { background: var(--paper-2); color: var(--text); }
.ws-tabs a[aria-current] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px var(--accent); border-radius: 10px 10px 0 0; }
.ws-tabs-sep { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--line); }
html.kp-workbench main.kp-section { flex: 1; min-height: 0; overflow: auto; padding-top: 20px !important; }
html.kp-workbench .ws-back, html.kp-workbench .ws-intro h2 { display: none; }
@media (max-width: 700px) {
  .ws-head { flex-wrap: wrap; gap: 2px 10px; height: auto; padding: 8px 10px 0 16px; }
  .ws-head-name { font-size: 17px; }
  .ws-tabs { flex-basis: 100%; order: 3; }
  .ws-tabs a, .ws-tabs button { padding: 8px 10px; }
  html.kp-workbench main.kp-section { padding-top: 14px !important; }
}
