:root {
  --paper: #fffcf6;
  --paper-soft: #f6efe4;
  --ink: #111111;
  --muted: #71685e;
  --weak: #9a8f82;
  --line: #e4d7c5;
  --line-strong: #cab8a0;
  --red: #bd3029;
  --green: #16796f;
  --blue: #2f5d83;
  --black: #0c0b0a;
  --shadow: 0 20px 48px rgba(17, 17, 17, 0.08);
  --song: "Source Han Serif SC", "Noto Serif CJK SC", "思源宋体", "Songti SC", serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  font-family: var(--song);
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 1160px;
  min-height: 100vh;
  display: block;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.026) 1px, transparent 1px),
    #f4efe7;
  background-size: 40px 40px;
  color: var(--ink);
}

body.is-locked {
  display: block;
  min-width: 0;
}

body.is-locked .sidebar,
body.is-locked .workspace {
  display: none;
}

.login-screen {
  display: none;
}

body.is-locked .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.026) 1px, transparent 1px),
    #f4efe7;
  background-size: 40px 40px;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.96);
  box-shadow: var(--shadow);
}

.login-card strong {
  display: block;
  color: var(--red);
  font-size: 42px;
  line-height: 1;
}

.login-card h1 {
  margin: 18px 0 0;
  font-size: 28px;
}

.login-card p {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.login-card .primary {
  width: 100%;
  margin-top: 18px;
}

button,
input,
select,
textarea {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus,
input:focus,
select:focus,
textarea:focus,
.rich-editor:focus {
  outline: 2px solid rgba(189, 48, 41, 0.24);
  outline-offset: 2px;
}

svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.sidebar {
  width: 246px;
  min-height: 100vh;
  padding: 24px 18px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  background: var(--black);
  color: var(--paper);
}

.brand {
  padding: 8px 8px 22px;
  border-bottom: 1px solid rgba(255, 252, 246, 0.18);
}

.brand strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 10px;
  color: #d8c7ac;
  font-size: 14px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  color: rgba(255, 252, 246, 0.72);
  text-align: left;
}

.nav button:hover,
.nav button.is-active {
  color: var(--paper);
  border-color: rgba(255, 252, 246, 0.16);
  background: rgba(255, 252, 246, 0.08);
}

.cloud-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 252, 246, 0.16);
  background: rgba(255, 252, 246, 0.06);
}

.cloud-card span,
.cloud-card p {
  margin: 0;
  color: rgba(255, 252, 246, 0.66);
  font-size: 13px;
  line-height: 1.55;
}

.cloud-card b {
  display: block;
  margin: 8px 0;
  color: #7fd4c9;
  font-size: 20px;
}

.cloud-card b.is-error {
  color: #f4a39f;
}

.workspace {
  min-height: 100vh;
  margin-left: 246px;
  padding: 24px;
}

.topbar {
  min-height: 82px;
  padding: 0 4px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar p,
.panel-title p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.topbar h1,
.panel-title h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
}

.top-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary,
.ghost,
.upload-button span,
.row-card > .danger {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-weight: 800;
}

.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff9ef;
}

.ghost:hover,
.upload-button span:hover {
  border-color: var(--ink);
}

.primary:hover {
  background: #9f241f;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: var(--shadow);
}

.list-panel {
  position: sticky;
  top: 24px;
}

.panel-title {
  min-height: 76px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  font-size: 20px;
}

.state-pill {
  padding: 5px 10px;
  border: 1px solid rgba(22, 121, 111, 0.24);
  color: var(--green);
  background: rgba(22, 121, 111, 0.08);
  font-size: 13px;
  font-weight: 900;
}

form {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
  margin-top: 14px;
  grid-template-columns: 1.1fr 1fr 1fr 0.72fr;
}

.field {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.grid .field {
  margin-top: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.field textarea {
  line-height: 1.65;
  resize: vertical;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-head button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  background: rgba(47, 93, 131, 0.08);
  border: 1px solid rgba(47, 93, 131, 0.18);
}

.rich-field {
  padding: 16px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.72), rgba(255, 255, 255, 0.66));
  border: 1px solid var(--line);
}

.rich-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.rich-label-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.rich-label-row small {
  color: #8b8177;
  font-size: 12px;
  line-height: 1.5;
}

.rich-toolbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(227, 216, 202, 0.82);
  box-shadow: 0 12px 28px rgba(42, 34, 25, 0.08);
  backdrop-filter: blur(10px);
}

.rich-toolbar button,
.rich-upload {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  color: #265f81;
  font-size: 13px;
  font-weight: 900;
  background: rgba(238, 245, 247, 0.78);
  border: 1px solid rgba(38, 95, 129, 0.18);
}

.rich-toolbar .danger-text {
  color: var(--red);
  background: #fff9f6;
  border-color: rgba(189, 48, 41, 0.28);
}

.rich-upload {
  cursor: pointer;
}

.rich-upload input {
  display: none;
}

.rich-editor {
  position: relative;
  min-height: 320px;
  margin-top: 12px;
  padding: 28px 34px;
  overflow: auto;
  color: #2b2722;
  font-size: 17px;
  font-weight: 500;
  line-height: 2;
  background:
    linear-gradient(90deg, rgba(189, 48, 41, 0.08), transparent 46px),
    #fffdf8;
  border: 1px solid var(--line-strong);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9b9187;
}

.rich-editor p {
  margin: 0 0 18px;
  text-align: justify;
}

.rich-editor h1,
.rich-editor h2,
.rich-editor h3 {
  margin: 6px 0 18px;
  color: #17130f;
  font-size: 27px;
  line-height: 1.45;
  font-weight: 900;
}

.rich-editor strong {
  color: #17130f;
  font-weight: 900;
}

.rich-editor em {
  color: #27231f;
  font-style: italic;
}

.rich-image {
  position: relative;
  margin: 24px 0;
  padding: 10px;
  border: 1px solid transparent;
}

.rich-image.is-selected {
  background: rgba(189, 48, 41, 0.06);
  border-color: rgba(189, 48, 41, 0.42);
}

.rich-image img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f4eee6;
  border: 1px solid var(--line);
}

.rich-image-remove {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  padding: 6px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  background: rgba(189, 48, 41, 0.92);
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.rich-image:hover .rich-image-remove,
.rich-image.is-selected .rich-image-remove {
  opacity: 1;
}

.rich-image-caption {
  display: block;
  width: calc(100% - 16px);
  margin: 8px auto 0;
  padding: 7px 8px;
  color: #82766d;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(130, 118, 109, 0.34);
  outline: 0;
}

.rich-image-caption::placeholder {
  color: #aaa096;
}

.inline-field {
  margin-top: 0;
}

.inline-field input {
  min-height: 40px;
}

.list-tools,
.library-tools {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.62);
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tabs button,
.topic-toggle {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-weight: 900;
}

.filter-tabs button.is-active,
.filter-tabs button:hover,
.topic-toggle:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.placement {
  margin: 18px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
}

.placement legend {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.placement input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.placement span {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-weight: 800;
}

.placement input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.upload-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(47, 93, 131, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.5);
}

.upload-card > div {
  display: grid;
  gap: 6px;
}

.upload-card i,
.upload-card svg {
  color: var(--red);
}

.upload-card strong,
.upload-card p {
  margin: 0;
}

.upload-card strong {
  font-size: 18px;
}

.upload-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.upload-card img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
}

.sponsor-upload img {
  border-radius: 50%;
}

.upload-card audio {
  width: 100%;
}

.upload-button {
  width: fit-content;
}

.secondary-upload {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  background: rgba(47, 93, 131, 0.08);
}

.upload-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cover-picker-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}

.cover-picker-layer.is-open {
  display: block;
}

.cover-picker-bg {
  position: absolute;
  inset: 0;
  background: rgba(23, 19, 15, 0.42);
  border: 0;
}

.cover-picker-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(860px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  padding: 22px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: 0 28px 80px rgba(23, 19, 15, 0.24);
  transform: translate(-50%, -50%);
}

.cover-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.cover-picker-head p,
.cover-picker-head h2 {
  margin: 0;
}

.cover-picker-head p {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.cover-picker-head h2 {
  margin-top: 6px;
  font-size: 24px;
}

.icon-only {
  width: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
}

.cover-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.cover-picker-grid button {
  min-height: 0;
  padding: 10px;
  display: grid;
  gap: 9px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.cover-picker-grid button:hover {
  border-color: var(--red);
  background: #fffaf4;
}

.cover-picker-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.cover-picker-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.row-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.row-card > button:first-child {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  column-gap: 12px;
  row-gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.row-card.is-active > button:first-child,
.row-card > button:first-child:hover {
  border-color: var(--red);
  background: #fffaf1;
}

.thumb,
.avatar {
  width: 56px;
  height: 56px;
  grid-row: span 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--paper);
  background: var(--black);
  font-size: 24px;
  font-weight: 900;
}

.avatar {
  border-radius: 50%;
}

.thumb img,
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-card strong {
  grid-column: 2 / 3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.row-card small {
  grid-column: 2 / 3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.row-card em {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 4px 8px;
  border: 1px solid rgba(47, 93, 131, 0.2);
  color: var(--blue);
  background: rgba(47, 93, 131, 0.07);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.row-card > .danger {
  min-height: auto;
  padding: 0 10px;
  color: var(--red);
  border-color: rgba(189, 48, 41, 0.22);
  background: rgba(189, 48, 41, 0.06);
}

.row-card > .danger:hover {
  border-color: var(--red);
}

.row-card > .inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  gap: 6px;
  align-content: stretch;
}

.inline-actions button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--blue);
  border-color: rgba(47, 93, 131, 0.22);
  background: rgba(47, 93, 131, 0.06);
}

.inline-actions button.danger {
  color: var(--red);
  border-color: rgba(189, 48, 41, 0.22);
  background: rgba(189, 48, 41, 0.06);
}

.topic-row.is-in-topic > button:first-child {
  border-color: rgba(22, 121, 111, 0.42);
  background: rgba(22, 121, 111, 0.08);
}

.library-panel {
  min-height: calc(100vh - 132px);
}

.category-board {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feedback-panel {
  min-height: calc(100vh - 132px);
}

.feedback-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.feedback-list {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.feedback-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
}

.feedback-card.is-closed {
  opacity: 0.72;
}

.feedback-card header,
.feedback-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feedback-card header strong {
  color: var(--red);
  font-size: 14px;
}

.feedback-card.is-closed header strong {
  color: var(--green);
}

.feedback-card time,
.feedback-card footer span {
  color: var(--muted);
  font-size: 13px;
}

.feedback-card p {
  margin: 14px 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
}

.feedback-card footer button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(47, 93, 131, 0.2);
  color: var(--blue);
  background: rgba(47, 93, 131, 0.07);
  font-size: 13px;
  font-weight: 900;
}

.feedback-card footer button:hover {
  border-color: var(--blue);
}

.category-column {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.category-column header {
  min-height: 58px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.category-column header strong {
  font-size: 22px;
}

.category-column header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.category-list {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.content-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.content-row > button:first-child {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.content-row > button:first-child:hover {
  border-color: var(--red);
  background: #fffaf1;
}

.content-row .thumb {
  width: 50px;
  height: 50px;
  font-size: 22px;
}

.content-row strong,
.content-row small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-row strong {
  font-size: 15px;
}

.content-row small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.content-row > .danger {
  min-height: auto;
  padding: 0 10px;
  color: var(--red);
  border-color: rgba(189, 48, 41, 0.22);
  background: rgba(189, 48, 41, 0.06);
  font-weight: 900;
}

.content-row.is-draft {
  opacity: 0.72;
}

.topic-preview {
  margin-top: 18px;
  padding: 26px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(47, 93, 131, 0.22);
  background:
    radial-gradient(circle at 92% 12%, rgba(47, 93, 131, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(189, 48, 41, 0.08), rgba(22, 121, 111, 0.08)),
    #fffaf1;
}

.topic-preview p,
.topic-preview span {
  margin: 0;
}

.topic-preview p {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.topic-preview strong {
  font-size: 34px;
  line-height: 1.22;
}

.topic-preview span {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.topic-preview > button {
  min-height: 46px;
  margin-top: 8px;
  background: var(--black);
  color: var(--paper);
  font-weight: 900;
  pointer-events: none;
}

.compact-row {
  grid-template-columns: 1fr;
}

.keyword-column-editor,
.question-column-editor {
  background: #fffdf8;
}

.topic-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.topic-editor-grid .wide-field {
  grid-column: 1 / -1;
}

.keyword-column-editor [data-keyword-select] {
  display: none;
}

.keyword-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-switcher button {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  border: 1px solid rgba(47, 93, 131, 0.2);
  background: rgba(47, 93, 131, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.keyword-switcher button span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--blue);
  font-size: 11px;
}

.keyword-switcher button.is-active {
  color: var(--red);
  border-color: rgba(189, 48, 41, 0.34);
  background: rgba(189, 48, 41, 0.08);
}

.keyword-switcher button.is-active span {
  background: var(--red);
}

.inline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-toolbar button,
.rank-helper button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--blue);
  border: 1px solid rgba(47, 93, 131, 0.22);
  background: rgba(47, 93, 131, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.inline-toolbar button.danger {
  color: var(--red);
  border-color: rgba(189, 48, 41, 0.22);
  background: rgba(189, 48, 41, 0.06);
}

.rank-helper {
  margin: 0 18px 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.rank-helper p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.compact-list {
  max-height: 360px;
  overflow: auto;
  padding: 0;
}

.keyword-column-editor .row-card button,
.question-column-editor .row-card button {
  pointer-events: auto;
}

.keyword-column-editor .row-card > button:first-child,
.question-column-editor .row-card > button:first-child {
  min-height: auto;
  margin: 0;
  color: inherit;
  background: rgba(255, 255, 255, 0.5);
}

.keyword-column-editor .row-card > button:last-child,
.question-column-editor .row-card > button:last-child {
  min-height: auto;
  margin: 0;
  color: var(--blue);
  background: rgba(47, 93, 131, 0.06);
}

.keyword-column-editor .row-card > button:last-child.danger,
.question-column-editor .row-card > button:last-child.danger {
  color: var(--red);
  background: rgba(189, 48, 41, 0.06);
}

.empty-card {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.48);
}

.empty-card strong,
.empty-card p {
  margin: 0;
}

.empty-card strong {
  display: block;
  font-size: 16px;
}

.empty-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  min-width: 220px;
  padding: 12px 16px;
  color: var(--paper);
  text-align: center;
  background: var(--black);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 18px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cloud-card {
    margin-top: 0;
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  .topbar {
    display: grid;
    gap: 14px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .editor-grid,
  .topic-layout,
  .sponsor-grid,
  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .rich-editor {
    padding: 22px 18px;
  }
}

@media (max-width: 1320px) {
  .category-board {
    grid-template-columns: 1fr;
  }
}
