:root {
  --bg: #111510;
  --bg-deep: #090c09;
  --surface: #1b201b;
  --surface-2: #232923;
  --surface-3: #2b322a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(220, 255, 63, 0.34);
  --accent: #dcff3f;
  --accent-soft: rgba(220, 255, 63, 0.11);
  --text: #f1f3ef;
  --muted: #a4aaa2;
  --muted-2: #737a72;
  --danger: #ff756d;
  --warning: #f1bd62;
  --info: #68c8df;
  --success: #8bd18a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 76% -16%, rgba(220, 255, 63, 0.055), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(220, 255, 63, 0.48);
  outline-offset: 2px;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 8, 0.96);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  min-width: 154px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f4f6f1;
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(220, 255, 63, 0.42);
  border-radius: 9px;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  transform: skewX(-8deg);
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.05em;
}

.header-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.global-nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.global-nav a {
  height: 100%;
  padding: 0 16px;
  color: #929991;
  display: inline-flex;
  align-items: center;
  position: relative;
  text-decoration: none;
  transition: color 0.16s ease;
}

.global-nav a::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  background: var(--accent);
  opacity: 0;
}

.global-nav a:hover,
.global-nav a.active {
  color: var(--text);
}

.global-nav a.active::after {
  opacity: 1;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.user-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111510;
  color: #aab0a8;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.icon-button:hover,
.user-button:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.user-button {
  padding: 0 13px;
}

.page {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.page.narrow {
  width: min(1180px, calc(100% - 48px));
}

.page-header {
  margin-bottom: 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.page-header h1 {
  margin: 0;
  color: #f3f5f1;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: #d8dcd5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.btn:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #171b13;
  font-weight: 600;
}

.btn.primary:hover {
  background: #e5ff65;
  color: #11140e;
}

.btn.quiet {
  background: transparent;
}

.btn.danger {
  color: #ff8f88;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #b7beb5;
  cursor: pointer;
  text-decoration: none;
}

.link-button:hover {
  color: var(--accent);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #141914;
  color: var(--text);
}

.input,
.select {
  height: 38px;
  padding: 0 12px;
}

.textarea {
  min-height: 94px;
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--line-strong);
}

.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7e857c 50%),
    linear-gradient(135deg, #7e857c 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 11px) 16px;
  background-repeat: no-repeat;
  background-size: 4px 4px;
}

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

.field > label,
.field-label {
  color: #8f968d;
  font-size: 12px;
}

.required::before {
  content: "*";
  margin-right: 3px;
  color: var(--accent);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(27, 32, 27, 0.86);
}

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

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 560;
}

.panel-head small {
  color: var(--muted-2);
}

.panel-body {
  padding: 18px;
}

.view-tabs {
  min-height: 48px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 25px;
}

.view-tabs button {
  height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

.view-tabs button:hover {
  color: #ccd1ca;
}

.view-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.view-tabs b {
  margin-left: 6px;
  color: #697068;
  font-size: 11px;
  font-weight: 500;
}

.view-tabs button.active b {
  color: var(--accent);
}

.list-toolbar {
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-toolbar .search {
  width: min(360px, 36vw);
  position: relative;
}

.list-toolbar .search svg {
  width: 16px;
  height: 16px;
  position: absolute;
  top: 11px;
  left: 12px;
  fill: none;
  stroke: #6f766e;
  stroke-width: 2;
}

.list-toolbar .search .input {
  padding-left: 37px;
}

.list-toolbar .select {
  width: 132px;
}

.list-meta {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 12px;
}

.data-table {
  min-width: 1000px;
}

.table-scroll {
  overflow-x: auto;
}

.table-row {
  min-height: 68px;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  align-items: center;
  gap: 16px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row:not(.table-labels):hover {
  background: rgba(255, 255, 255, 0.018);
}

.table-labels {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.018);
  color: #6f766e;
  font-size: 11px;
}

.topic-columns {
  grid-template-columns: minmax(330px, 1.7fr) 92px 240px 126px 92px;
}

.script-columns {
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr) 90px 90px 130px 92px;
}

.video-columns {
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr) 90px 100px 130px 92px;
}

.table-row > * {
  min-width: 0;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.type-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
  color: #9ba29a;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.type-icon.topic {
  border-color: rgba(220, 255, 63, 0.18);
  background: rgba(220, 255, 63, 0.07);
  color: var(--accent);
}

.type-icon.video {
  color: #80d2e5;
}

.type-icon.script {
  color: #c4bdff;
}

.table-title strong {
  display: block;
  overflow: hidden;
  color: #dce0d9;
  font-weight: 540;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-title small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #686f67;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-row > span,
.table-row > time {
  overflow: hidden;
  color: #8d948b;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-counts {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #939a91;
  font-size: 12px;
}

.asset-counts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.asset-counts i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #697168;
}

.asset-counts span:nth-child(2) i {
  background: #7870a2;
}

.asset-counts span:nth-child(3) i {
  background: #50899a;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9fa69d;
  font-size: 12px;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #767d75;
}

.status.success::before {
  background: var(--success);
}

.status.review::before {
  background: var(--warning);
}

.status.danger::before {
  background: var(--danger);
}

.status.info::before {
  background: var(--info);
}

.badge {
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: #9fa69d;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
}

.badge.accent {
  border-color: rgba(220, 255, 63, 0.19);
  background: rgba(220, 255, 63, 0.07);
  color: var(--accent);
}

.badge.success {
  border-color: rgba(139, 209, 138, 0.2);
  background: rgba(139, 209, 138, 0.07);
  color: #a9d8a8;
}

.badge.warning {
  border-color: rgba(241, 189, 98, 0.2);
  background: rgba(241, 189, 98, 0.07);
  color: #e5bf7d;
}

.empty-filter {
  min-height: 250px;
  color: var(--muted-2);
  display: grid;
  place-items: center;
}

.pagination {
  min-height: 56px;
  padding: 0 17px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.pagination .pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination button {
  min-width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #858c83;
  cursor: pointer;
}

.pagination button.active {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent);
}

.breadcrumb {
  margin-bottom: 22px;
  color: #70776f;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.breadcrumb a {
  color: #9ba199;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.topic-detail-head {
  margin-bottom: 17px;
  padding: 24px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.topic-detail-head h1 {
  margin: 9px 0 0;
  font-size: 25px;
  font-weight: 580;
}

.topic-meta {
  margin-top: 15px;
  color: #7d847b;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

.topic-meta span + span {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 16px;
}

.detail-main {
  display: grid;
  gap: 16px;
}

.content-list {
  display: grid;
}

.content-row {
  min-height: 69px;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 90px 100px 100px;
  align-items: center;
  gap: 16px;
}

.content-row:last-child {
  border-bottom: 0;
}

.content-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.content-row .table-title strong {
  font-size: 13px;
}

.content-row > span {
  color: #8b9289;
  font-size: 12px;
}

.asset-grid {
  padding: 5px 17px 17px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.asset-card {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.asset-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.asset-thumb {
  width: 34px;
  height: 42px;
  border-radius: 6px;
  background: linear-gradient(145deg, #465647, #202820);
  color: #b9c0b7;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.asset-thumb.image {
  background: linear-gradient(145deg, #54502d, #26291f);
}

.asset-thumb.audio {
  background: linear-gradient(145deg, #3e445f, #20232d);
}

.asset-card strong {
  display: block;
  overflow: hidden;
  color: #bbc1b9;
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-card small {
  display: block;
  margin-top: 5px;
  color: #656c64;
  font-size: 10px;
}

.package-panel {
  position: sticky;
  top: 81px;
}

.package-summary {
  padding: 5px 17px;
}

.package-summary > div {
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.package-summary > div:last-child {
  border-bottom: 0;
}

.package-summary span {
  color: #7e857c;
  font-size: 12px;
}

.package-summary strong {
  color: #d5d9d2;
  font-size: 13px;
  font-weight: 560;
}

.package-id {
  margin: 4px 17px 17px;
  padding: 12px;
  border: 1px solid rgba(220, 255, 63, 0.12);
  border-radius: 8px;
  background: rgba(220, 255, 63, 0.045);
}

.package-id small {
  color: #70776f;
  display: block;
}

.package-id code {
  margin-top: 6px;
  color: #bac3b2;
  display: block;
  font-size: 11px;
}

.package-actions {
  padding: 0 17px 17px;
  display: grid;
  gap: 8px;
}

.package-copy {
  min-height: 28px;
  justify-self: center;
  color: #747b72;
  font-size: 11px;
}

.modal-mask {
  padding: 24px;
  background: rgba(3, 5, 3, 0.76);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: #202520;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal.wide {
  width: min(650px, 100%);
}

.modal-head {
  min-height: 62px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 560;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #899087;
  cursor: pointer;
  font-size: 23px;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 17px;
}

.modal-foot {
  min-height: 66px;
  padding: 0 19px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.radio-card {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.radio-card:has(input:checked) {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.radio-card strong {
  display: block;
  color: #d4d8d1;
  font-size: 12px;
  font-weight: 550;
}

.radio-card small {
  margin-top: 4px;
  color: #727970;
  display: block;
  font-size: 10px;
}

.toast {
  max-width: min(440px, calc(100vw - 32px));
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(220, 255, 63, 0.2);
  border-radius: 9px;
  background: rgba(28, 33, 28, 0.97);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
  color: #d8ddd5;
  display: flex;
  align-items: center;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .global-nav a {
    padding: 0 10px;
  }

  .global-nav a::after {
    right: 10px;
    left: 10px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .package-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  .app-header {
    padding: 0 14px;
    overflow-x: auto;
  }

  .brand {
    min-width: 126px;
  }

  .header-divider,
  .header-tools {
    display: none;
  }

  .global-nav {
    min-width: max-content;
  }

  .page,
  .page.narrow {
    width: min(100% - 28px, 1480px);
    padding-top: 20px;
  }

  .page-header,
  .topic-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .list-toolbar .search,
  .list-toolbar .select {
    width: 100%;
  }

  .list-meta {
    margin-left: 0;
  }

  .asset-grid,
  .radio-cards {
    grid-template-columns: 1fr;
  }

  .topic-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topic-meta span + span {
    padding-left: 0;
    border-left: 0;
  }
}

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

/* AI 写稿 */
.writing-page-main {
  width: min(1180px, calc(100% - 48px));
}

.topic-context {
  min-height: 54px;
  margin-bottom: 26px;
  padding: 0 15px;
  border: 1px solid rgba(220, 255, 63, 0.13);
  border-radius: 10px;
  background: rgba(220, 255, 63, 0.035);
  display: flex;
  align-items: center;
  gap: 12px;
}

.topic-context > span:first-child {
  color: #777e75;
  font-size: 12px;
}

.topic-context strong {
  color: #c8cec4;
  font-size: 13px;
  font-weight: 550;
}

.topic-context .link-button {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
}

.writing-start {
  padding: 40px 0 54px;
}

.writing-start-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin-bottom: 23px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  color: #e9ece6;
  font-weight: 560;
}

.section-heading h1 {
  font-size: 28px;
}

.section-heading h2 {
  font-size: 18px;
}

.section-heading p {
  margin: 7px 0 0;
  color: #6f766d;
  font-size: 12px;
}

.writing-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.writing-type-card {
  min-height: 116px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  text-align: left;
  cursor: pointer;
}

.writing-type-card:hover {
  border-color: rgba(220, 255, 63, 0.22);
  background: rgba(220, 255, 63, 0.035);
  transform: translateY(-2px);
}

.writing-type-card > span {
  color: #626a61;
  font-size: 10px;
}

.writing-type-card strong {
  margin-top: auto;
  color: #d0d5cd;
  font-size: 14px;
  font-weight: 550;
}

.writing-type-card small {
  margin-top: 6px;
  color: #6e756d;
  font-size: 11px;
}

.writing-library-card {
  border-color: rgba(220, 255, 63, 0.16);
  background: rgba(220, 255, 63, 0.035);
}

.writing-library-card > span,
.writing-library-card strong {
  color: var(--accent);
}

.writing-recent {
  padding: 47px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.writing-recent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.writing-recent-list {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.writing-recent-row {
  min-height: 68px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 95px 20px;
  align-items: center;
  gap: 18px;
  color: #8b9289;
  text-decoration: none;
}

.writing-recent-row:hover {
  background: rgba(255, 255, 255, 0.016);
}

.writing-recent-row strong {
  display: block;
  color: #c6cbc3;
  font-size: 13px;
  font-weight: 530;
}

.writing-recent-row small {
  display: block;
  margin-top: 5px;
  color: #666d65;
  font-size: 11px;
}

.writing-recent-row > span,
.writing-recent-row > time {
  font-size: 12px;
}

.writing-recent-row > i {
  color: var(--accent);
  font-style: normal;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.writing-recent-row:hover > i {
  opacity: 1;
  transform: translateX(0);
}

/* 文稿编辑 */
.editor-body {
  overflow: hidden;
}

.editor-body .app-header {
  position: relative;
}

.editor-shell {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
}

.editor-toolbar {
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #111510;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.editor-toolbar .back-link {
  justify-self: start;
  color: #8c938a;
  font-size: 12px;
  text-decoration: none;
}

.editor-toolbar .back-link:hover {
  color: var(--accent);
}

.save-state {
  color: #737a72;
  font-size: 11px;
}

.editor-toolbar .actions {
  justify-self: end;
}

.editor-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.document-stage {
  min-width: 0;
  padding: 28px 36px 80px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.025), transparent 34%),
    #121612;
}

.document-sheet {
  width: min(820px, 100%);
  min-height: 760px;
  margin: 0 auto;
  padding: 48px 58px 70px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 11px;
  background: #1b201b;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.23);
}

.document-title-input {
  width: 100%;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  color: #edf0ea;
  font-size: 24px;
  font-weight: 580;
}

.document-content {
  min-height: 520px;
  margin-top: 26px;
  outline: 0;
  color: #bbc1b8;
  font-size: 15px;
  line-height: 2;
}

.document-content p {
  margin: 0 0 17px;
}

.speaker {
  margin-right: 8px;
  color: #9cad81;
}

.document-footnote {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #616860;
  font-size: 11px;
}

.editor-inspector {
  min-height: 0;
  border-left: 1px solid var(--line);
  background: #191e19;
  overflow-y: auto;
}

.inspector-section {
  padding: 19px;
  border-bottom: 1px solid var(--line);
}

.inspector-section h2 {
  margin: 0 0 16px;
  color: #d4d8d1;
  font-size: 14px;
  font-weight: 560;
}

.inspector-section .field + .field {
  margin-top: 14px;
}

.material-section-head,
.compact-association-head {
  min-height: 30px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.material-section-head h2,
.compact-association-head h2 {
  margin: 0;
}

.material-add-wrap {
  position: relative;
}

.material-add-menu {
  width: 164px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  background: #171c17;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.36);
}

.material-add-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aab1a8;
  display: block;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.material-add-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e4dc;
}

.material-add-menu .topic-import-entry {
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 0 6px 6px;
  color: var(--accent);
}

.material-mini-list {
  display: grid;
  gap: 7px;
}

.material-mini {
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-mini span {
  min-width: 0;
  overflow: hidden;
  color: #9ca39a;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.material-mini small {
  color: #656c64;
  white-space: nowrap;
}

.material-empty {
  min-height: 76px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  color: #60675f;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.compact-association {
  padding-top: 15px;
  padding-bottom: 15px;
}

.compact-association-head {
  min-height: 22px;
  margin-bottom: 9px;
}

.compact-association-head span {
  color: #666e65;
  font-size: 10px;
}

.association-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.compact-new-topic {
  margin-top: 8px;
}

.library-import-modal {
  width: min(680px, calc(100vw - 32px));
}

.library-import-list {
  padding: 12px 18px 6px;
  display: grid;
  gap: 6px;
}

.library-import-row {
  min-height: 58px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.012);
  display: grid;
  grid-template-columns: 16px 30px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.library-import-row:hover,
.library-import-row:has(input:checked) {
  border-color: rgba(220, 255, 63, 0.23);
  background: rgba(220, 255, 63, 0.025);
}

.library-import-row > span:nth-child(3) {
  min-width: 0;
}

.library-import-row strong,
.library-import-row small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.library-import-row strong {
  color: #bdc3ba;
  font-size: 11px;
  font-weight: 530;
}

.library-import-row small,
.library-import-row > span:last-child {
  margin-top: 4px;
  color: #666d65;
  font-size: 10px;
}

.library-import-row > span:last-child {
  margin: 0;
  text-align: right;
}

.inspector-footer {
  padding: 19px;
  display: grid;
  gap: 8px;
}

.inspector-footer .btn {
  width: 100%;
}

.inspector-confirm {
  width: 100%;
  margin-top: 10px;
}

/* 素材上传 */
.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 16px;
}

.upload-main .panel-body {
  padding: 20px;
}

.drop-zone {
  min-height: 260px;
  padding: 30px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  color: #838a81;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: rgba(220, 255, 63, 0.36);
  background: rgba(220, 255, 63, 0.035);
}

.drop-zone-icon {
  width: 54px;
  height: 48px;
  margin: 0 auto 16px;
  border: 1px solid rgba(220, 255, 63, 0.28);
  border-radius: 12px;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.drop-zone strong {
  color: #cfd4cc;
  display: block;
  font-weight: 550;
}

.drop-zone small {
  max-width: 460px;
  margin: 7px auto 0;
  color: #6c736a;
  display: block;
  font-size: 11px;
  line-height: 1.6;
}

.upload-file-list {
  margin-top: 13px;
  display: grid;
  gap: 7px;
}

.upload-file {
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.upload-file > span:first-child {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(220, 255, 63, 0.08);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 9px;
}

.upload-file strong {
  display: block;
  overflow: hidden;
  color: #b7beb5;
  font-size: 11px;
  font-weight: 520;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-file small {
  display: block;
  margin-top: 3px;
  color: #656c64;
  font-size: 10px;
}

.upload-file button {
  border: 0;
  background: transparent;
  color: #70776f;
  cursor: pointer;
}

.upload-file button:hover {
  color: var(--danger);
}

.upload-settings {
  position: sticky;
  top: 82px;
}

.upload-settings .panel-body {
  display: grid;
  gap: 16px;
}

.association-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.association-switch button {
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: #7d847b;
  cursor: pointer;
}

.association-switch button.active {
  border-color: rgba(220, 255, 63, 0.24);
  background: var(--accent-soft);
  color: var(--accent);
}

.upload-success {
  min-height: 480px;
  padding: 60px 24px;
  display: grid;
  place-items: center;
  text-align: center;
}

.upload-success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid rgba(139, 209, 138, 0.3);
  border-radius: 50%;
  background: rgba(139, 209, 138, 0.08);
  color: #a9d8a8;
  display: grid;
  place-items: center;
  font-size: 25px;
}

.upload-success h2 {
  margin: 0;
  font-size: 20px;
}

.upload-success p {
  margin: 9px 0 20px;
  color: #777e75;
  font-size: 12px;
}

/* 成片列表 */
.video-filter-bar {
  margin-bottom: 13px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-filter-bar .search {
  width: 280px;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-chips button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #777e75;
  cursor: pointer;
}

.filter-chips button.active {
  border-color: rgba(220, 255, 63, 0.16);
  background: rgba(220, 255, 63, 0.06);
  color: var(--accent);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.video-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(27, 32, 27, 0.88);
  overflow: hidden;
}

.video-cover {
  aspect-ratio: 16 / 8.8;
  padding: 14px;
  background:
    linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.62)),
    linear-gradient(135deg, #394c42, #171b1a 62%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
}

.video-card:nth-child(2) .video-cover {
  background:
    linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.62)),
    linear-gradient(135deg, #4f4730, #181c19 62%);
}

.video-card:nth-child(3) .video-cover {
  background:
    linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.62)),
    linear-gradient(135deg, #383553, #161a19 62%);
}

.video-play {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #e4e8e1;
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.video-cover small {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: #c1c6bf;
  font-size: 10px;
}

.video-info {
  padding: 15px;
}

.video-info h2 {
  margin: 12px 0 7px;
  overflow: hidden;
  color: #d7dbd4;
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.video-info p {
  margin: 0;
  color: #6d746b;
  font-size: 11px;
}

.video-info .actions {
  margin-top: 15px;
}

.video-info .topic-linked {
  min-height: 32px;
  margin-top: 13px;
  padding: 0 9px;
  border: 1px solid rgba(220, 255, 63, 0.12);
  border-radius: 7px;
  background: rgba(220, 255, 63, 0.035);
  color: #8f9985;
  display: flex;
  align-items: center;
  font-size: 11px;
}

.video-info .topic-linked strong {
  margin-left: 6px;
  overflow: hidden;
  color: #b7c0ad;
  font-weight: 520;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 贡献、引用与同步 */
.contribution-strip {
  min-height: 48px;
  margin-bottom: 13px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  color: #777e75;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
}

.contribution-strip > strong {
  margin-right: 18px;
  color: #afb5ac;
  font-size: 12px;
  font-weight: 550;
}

.contribution-strip > span {
  min-height: 22px;
  padding: 0 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.065);
  display: flex;
  align-items: center;
  gap: 6px;
}

.contribution-strip b {
  color: #cdd2ca;
  font-size: 13px;
  font-weight: 580;
}

.contribution-strip .link-button {
  margin-left: auto;
}

.contribution-table,
.sync-record-table {
  padding: 5px 20px 20px;
}

.record-row {
  min-height: 52px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) repeat(4, minmax(80px, 0.7fr));
  align-items: center;
  gap: 12px;
}

.record-row > * {
  color: #929990;
  font-size: 12px;
}

.record-row > strong {
  color: #c2c8bf;
  font-weight: 540;
}

.record-labels {
  min-height: 40px;
  color: #6d746b;
  font-size: 11px;
}

.record-labels > * {
  color: #6d746b;
  font-size: 11px;
  font-weight: 500;
}

.library-list {
  padding: 5px 20px 20px;
}

.library-row {
  min-height: 68px;
  padding: 0 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: 34px minmax(250px, 1fr) 80px 62px;
  align-items: center;
  gap: 12px;
}

.library-row > div {
  min-width: 0;
}

.library-row strong {
  display: block;
  overflow: hidden;
  color: #cbd0c8;
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.library-row small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #6e756d;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.library-row > span:nth-child(3) {
  color: #888f86;
  font-size: 11px;
}

.reuse-origin {
  width: min(820px, 100%);
  min-height: 58px;
  margin: 0 auto 10px;
  padding: 0 14px;
  border: 1px solid rgba(129, 196, 216, 0.16);
  border-radius: 9px;
  background: rgba(104, 200, 223, 0.04);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.reuse-origin > div {
  min-width: 0;
}

.reuse-origin strong {
  display: block;
  overflow: hidden;
  color: #c6ccc4;
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reuse-origin small {
  display: block;
  margin-top: 4px;
  color: #6f7b79;
  font-size: 10px;
}

.reuse-origin .link-button {
  color: #89b6c1;
  font-size: 11px;
}

.material-more {
  background: rgba(255, 255, 255, 0.018);
}

.trace-list {
  padding: 3px 17px 12px;
}

.trace-list-modal {
  max-height: 430px;
  padding: 7px 20px 20px;
  overflow-y: auto;
}

.trace-row {
  min-height: 64px;
  padding: 0 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
}

.trace-row:last-child {
  border-bottom: 0;
}

.trace-row > div {
  min-width: 0;
}

.trace-row strong {
  display: block;
  overflow: hidden;
  color: #bfc5bc;
  font-size: 12px;
  font-weight: 530;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trace-row small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #687067;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trace-row time {
  color: #6f766e;
  font-size: 10px;
  text-align: right;
}

.trace-type {
  width: 38px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
}

.trace-type.use,
.trace-type.reference {
  border-color: rgba(104, 200, 223, 0.2);
  background: rgba(104, 200, 223, 0.06);
  color: #89c5d3;
}

.trace-type.finished,
.trace-type.submit {
  border-color: rgba(139, 209, 138, 0.2);
  background: rgba(139, 209, 138, 0.06);
  color: #a3d1a2;
}

.trace-type.process,
.trace-type.associate {
  border-color: rgba(196, 189, 255, 0.18);
  background: rgba(196, 189, 255, 0.055);
  color: #b6afe5;
}

.trace-type.create {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: #aab0a8;
}

.trace-type.materials {
  border-color: rgba(220, 255, 63, 0.18);
  background: rgba(220, 255, 63, 0.045);
  color: #c7dc69;
}

.trace-type.sync {
  border-color: rgba(241, 189, 98, 0.2);
  background: rgba(241, 189, 98, 0.06);
  color: #d7b677;
}

.system-options {
  display: grid;
  gap: 8px;
}

.system-options .radio-card {
  min-height: 59px;
}

.sync-scope {
  min-height: 53px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sync-scope span {
  color: #777e75;
  font-size: 11px;
}

.sync-scope strong {
  color: #b8beb6;
  font-size: 11px;
  font-weight: 540;
}

.sync-record-row {
  min-height: 54px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) 80px 70px 92px;
  align-items: center;
  gap: 12px;
}

.sync-record-row > * {
  color: #8e958c;
  font-size: 11px;
}

.sync-record-row > strong {
  color: #c1c7be;
  font-weight: 540;
}

.record-footnote {
  margin-right: auto;
  color: #6f766e;
  font-size: 10px;
}

/* 选题库紧凑视图 */
.topic-library-page {
  width: min(1560px, calc(100% - 40px));
  padding-top: 22px;
}

.compact-page-header {
  margin-bottom: 14px;
}

.compact-page-header h1 {
  font-size: 24px;
}

.topic-library-page .contribution-strip {
  background: #0e120e;
}

.topic-library-page .contribution-strip > span:first-child {
  padding-left: 0;
  border-left: 0;
}

.library-panel {
  border-color: rgba(255, 255, 255, 0.075);
  background: #0e120e;
  overflow: hidden;
}

.library-tabs {
  padding: 0 16px;
  background: #111511;
}

.library-tabs .permission-entry {
  height: 30px;
  margin: 0 0 9px auto;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  color: #8a9188;
  align-self: flex-end;
}

.library-tabs .permission-entry:hover {
  border-color: rgba(220, 255, 63, 0.18);
  color: var(--accent);
}

.library-tabs .permission-entry::before {
  content: "⚙";
  margin-right: 6px;
  font-size: 11px;
}

.compact-toolbar {
  min-height: 56px;
  background: #0e120e;
}

.compact-toolbar .input,
.compact-toolbar .select {
  height: 34px;
  background: #0b0e0b;
}

.compact-table-labels,
.compact-row {
  padding: 0 14px;
  display: grid;
  align-items: center;
  gap: 12px;
}

.topic-library-page [data-view-panel] {
  overflow-x: auto;
}

.topic-library-page [data-view-panel] > .compact-table-labels,
.topic-library-page [data-view-panel] > .compact-library-list {
  min-width: 980px;
}

.compact-table-labels {
  min-height: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: #0b0e0b;
  color: #596058;
  font-size: 10px;
}

.topic-library-columns {
  grid-template-columns: 24px minmax(330px, 1.7fr) 84px 230px 70px 108px;
}

.content-library-columns {
  grid-template-columns: 24px minmax(310px, 1.45fr) minmax(220px, 1fr) 180px 70px 118px;
}

.compact-library-list {
  background: #0d100d;
}

.library-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.library-item:last-child {
  border-bottom: 0;
}

.compact-row {
  min-height: 56px;
  color: #858c83;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.14s ease;
}

.compact-row:hover,
.library-item.is-open > .compact-row {
  background: rgba(255, 255, 255, 0.024);
}

.compact-row > * {
  min-width: 0;
}

.compact-row > span,
.compact-row > time {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.expand-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #697068;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.expand-button:hover {
  background: rgba(220, 255, 63, 0.07);
  color: var(--accent);
}

.library-item.is-expanded .expand-button {
  color: var(--accent);
  transform: rotate(90deg);
}

.compact-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-title .type-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 7px;
  font-size: 9px;
}

.compact-title > div {
  min-width: 0;
}

.compact-title strong {
  display: block;
  overflow: hidden;
  color: #c9cec6;
  font-size: 12px;
  font-weight: 530;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compact-title small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #5f665e;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compact-row .status {
  font-size: 10px;
}

.compact-row .asset-counts {
  gap: 10px;
  font-size: 10px;
}

.inline-expansion {
  padding: 5px 14px 8px 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  background: #090c09;
}

.attached-row {
  min-height: 40px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  display: grid;
  grid-template-columns: 48px minmax(260px, 1fr) 210px 90px;
  align-items: center;
  gap: 12px;
  color: #737a72;
  font-size: 10px;
}

.attached-row:last-child {
  border-bottom: 0;
}

.attached-row strong {
  overflow: hidden;
  color: #9fa69d;
  font-size: 11px;
  font-weight: 510;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.content-facts {
  min-height: 42px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #747b72;
  font-size: 10px;
}

.content-facts b {
  margin-left: 4px;
  color: #aeb4ac;
  font-weight: 530;
}

.content-facts a {
  margin-left: auto;
  color: #9da695;
  text-decoration: none;
}

.content-facts a:hover {
  color: var(--accent);
}

.permission-list {
  padding: 4px 20px 20px;
}

.permission-row {
  min-height: 52px;
  padding: 0 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1.4fr) 100px 100px;
  align-items: center;
  gap: 12px;
  color: #899087;
  font-size: 11px;
}

.permission-row strong {
  color: #c2c7bf;
  font-weight: 530;
}

.permission-labels {
  min-height: 38px;
  color: #626961;
  font-size: 10px;
}

.detail-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(3, 5, 3, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}

.detail-drawer {
  width: min(520px, 100%);
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #111511;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.42);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-head {
  min-height: 116px;
  padding: 22px 58px 19px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  position: relative;
}

.drawer-head h2 {
  margin: 10px 0 0;
  color: #e1e4df;
  font-size: 20px;
  font-weight: 560;
  line-height: 1.35;
}

.drawer-head p {
  margin: 7px 0 0;
  color: #686f67;
  font-size: 11px;
}

.drawer-head .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.drawer-body {
  min-height: 0;
  padding: 16px 18px 24px;
  overflow-y: auto;
}

.drawer-facts {
  min-height: 62px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: #0c0f0c;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drawer-facts > div {
  padding: 12px 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-facts > div:last-child {
  border-right: 0;
}

.drawer-facts span {
  display: block;
  color: #60675f;
  font-size: 9px;
}

.drawer-facts strong {
  margin-top: 6px;
  color: #b8beb5;
  display: block;
  font-size: 11px;
  font-weight: 530;
}

.drawer-facts b {
  font-weight: 560;
}

.drawer-section {
  margin-top: 20px;
}

.drawer-section > header {
  min-height: 34px;
  display: flex;
  align-items: center;
}

.drawer-section h3 {
  margin: 0;
  color: #9ea59c;
  font-size: 11px;
  font-weight: 530;
}

.drawer-content-list {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.drawer-content-row {
  min-height: 50px;
  padding: 0 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 95px;
  align-items: center;
  gap: 9px;
}

.drawer-content-row strong {
  display: block;
  overflow: hidden;
  color: #aeb4ac;
  font-size: 10px;
  font-weight: 510;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.drawer-content-row small {
  display: block;
  margin-top: 3px;
  color: #5f665e;
  font-size: 9px;
}

.drawer-content-row > span:last-child {
  color: #747b72;
  font-size: 9px;
  text-align: right;
}

.creation-entry-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.creation-entry {
  min-height: 75px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #0d100d;
  color: #a6ada3;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  text-decoration: none;
}

.creation-entry:hover,
.creation-entry.primary-entry {
  border-color: rgba(220, 255, 63, 0.15);
}

.creation-entry span {
  font-size: 11px;
}

.creation-entry small {
  margin-top: 5px;
  color: #60675f;
  font-size: 9px;
}

.creation-entry i {
  margin-top: auto;
  color: #6d756b;
  font-style: normal;
}

.creation-entry:hover i,
.creation-entry.primary-entry i {
  color: var(--accent);
}

.drawer-foot {
  min-height: 64px;
  padding: 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  background: #0c0f0c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.library-picker-modal {
  width: min(1080px, calc(100vw - 40px));
}

.writing-library-columns {
  grid-template-columns: minmax(250px, 1.45fr) minmax(190px, 1fr) 160px 110px 110px 62px;
}

.writing-library-list {
  max-height: min(460px, calc(100vh - 190px));
  overflow: auto;
}

.writing-library-list .compact-row {
  cursor: default;
}

.writing-library-list .compact-row > span,
.writing-library-list .compact-row > time {
  color: #7f867d;
  font-size: 10px;
}

.writing-library-list .btn {
  color: #aab1a7;
}

.topic-action-tabs {
  margin-bottom: 12px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: #0e120e;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.topic-action-tabs button {
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #777e75;
  cursor: pointer;
  text-align: left;
}

.topic-action-tabs button.active {
  border-color: rgba(220, 255, 63, 0.13);
  background: rgba(220, 255, 63, 0.055);
  color: #c4cbc0;
}

.topic-action-tabs strong,
.topic-action-tabs small {
  display: block;
}

.topic-action-tabs strong {
  font-size: 11px;
  font-weight: 540;
}

.topic-action-tabs button.active strong {
  color: var(--accent);
}

.topic-action-tabs small {
  margin-top: 3px;
  color: #5f665e;
  font-size: 9px;
}

.topic-action-panel {
  display: grid;
  gap: 10px;
}

.topic-action-panel .field + .field {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .writing-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .upload-layout {
    grid-template-columns: 1fr;
  }

  .upload-settings {
    position: static;
  }

  .contribution-strip {
    overflow-x: auto;
  }

  .contribution-strip > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 860px) {
  .editor-body {
    overflow: auto;
  }

  .editor-shell {
    height: auto;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .editor-inspector {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .document-stage {
    padding: 20px 14px;
  }

  .document-sheet {
    padding: 32px 24px;
  }

  .writing-recent-row {
    grid-template-columns: minmax(220px, 1fr) 105px;
  }

  .writing-recent-row > span,
  .writing-recent-row > i {
    display: none;
  }

  .library-row {
    grid-template-columns: 34px minmax(220px, 1fr) 62px;
  }

  .library-row > span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 680px) {
  .writing-page-main {
    width: min(100% - 28px, 1180px);
  }

  .writing-type-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .video-filter-bar .search {
    width: 100%;
  }

  .filter-chips {
    overflow-x: auto;
  }

  .editor-toolbar {
    grid-template-columns: 1fr auto;
  }

  .save-state {
    display: none;
  }

  .writing-start-head {
    align-items: stretch;
    flex-direction: column;
  }

  .reuse-origin {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px 12px;
  }

  .reuse-origin .link-button {
    display: none;
  }
}

/* AI 写稿：与新首页模块保持一致的任务结构 */
.writing-home-materials {
  min-height: 92px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.016);
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.writing-home-material-copy {
  display: flex;
  align-items: center;
  gap: 13px;
}

.writing-home-material-copy > span {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(220, 255, 63, 0.16);
  border-radius: 8px;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.writing-home-material-copy strong,
.writing-home-material-copy small {
  display: block;
}

.writing-home-material-copy strong {
  color: #c7ccc4;
  font-size: 12px;
  font-weight: 540;
}

.writing-home-material-copy small {
  margin-top: 5px;
  color: #646b63;
  font-size: 10px;
}

.writing-home-material-actions {
  display: flex;
  gap: 6px;
}

.writing-home-material-actions button,
.writing-home-material-state button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  color: #8d958b;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.writing-home-material-actions button:hover {
  border-color: rgba(220, 255, 63, 0.18);
  color: #c9d1c5;
}

.writing-home-material-state {
  grid-column: 1 / -1;
  min-height: 28px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #939b91;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.writing-home-material-state button {
  min-height: 26px;
  border: 0;
  background: transparent;
}

.writing-history-mask {
  position: fixed;
  inset: 0;
  z-index: 130;
  padding: 5vh 20px;
  background: rgba(3, 5, 3, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
}

.writing-history-dialog {
  width: min(760px, 100%);
  max-height: 86vh;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #151a15;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.writing-history-dialog > header {
  min-height: 74px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.writing-history-dialog h2,
.writing-history-dialog p {
  margin: 0;
}

.writing-history-dialog h2 {
  color: #dce1da;
  font-size: 17px;
  font-weight: 560;
}

.writing-history-dialog p {
  margin-top: 5px;
  color: #666d65;
  font-size: 10px;
}

.writing-history-dialog > header button {
  border: 0;
  background: transparent;
  color: #727a71;
  font-size: 22px;
  cursor: pointer;
}

.writing-history-search {
  margin: 16px 20px 6px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.writing-history-search span {
  color: #697067;
}

.writing-history-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #c9cec6;
  font: inherit;
  font-size: 11px;
}

.writing-history-list {
  max-height: 58vh;
  padding: 6px 20px 20px;
  overflow-y: auto;
}

.writing-history-row {
  min-height: 52px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 92px;
  align-items: center;
  gap: 16px;
  color: #737b72;
  font-size: 11px;
  text-decoration: none;
}

.writing-history-row strong {
  overflow: hidden;
  color: #b7beb5;
  font-weight: 520;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.writing-history-row time {
  text-align: right;
}

/* 专注写稿区 */
.editor-workspace {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 330px;
  transition: grid-template-columns 0.18s ease;
}

.editor-workspace.inspector-collapsed {
  grid-template-columns: minmax(0, 1fr) 0;
}

.document-stage {
  padding: 22px 36px 80px;
  background: #0d110d;
}

.document-canvas {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.editor-canvas-actions {
  min-height: 36px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.editor-config-summary {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  color: #747c73;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.writing-materials-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.012);
}

.writing-materials-heading {
  display: flex;
  align-items: center;
  gap: 18px;
}

.writing-materials-heading h2 {
  margin: 0;
  color: #d1d6ce;
  font-size: 13px;
  font-weight: 550;
}

.writing-material-tabs {
  display: flex;
  gap: 5px;
}

.writing-material-tabs button {
  min-height: 31px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #687067;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.writing-material-tabs button.active {
  background: rgba(255, 255, 255, 0.075);
  color: #c8cec5;
}

.material-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.material-preview {
  min-height: 92px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.012);
}

.material-preview span,
.material-preview p {
  display: block;
}

.material-preview span {
  color: #747c73;
  font-size: 10px;
}

.material-preview p {
  margin: 12px 0 0;
  overflow: hidden;
  color: #a7aea5;
  font-size: 11px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.writing-materials-panel .material-empty {
  min-height: 92px;
}

.reuse-origin {
  width: 100%;
  margin: 12px 0 0;
}

.document-sheet {
  width: 100%;
  min-height: 680px;
  margin-top: 34px;
  padding: 0 2px 60px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.document-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.document-title-input {
  padding-bottom: 17px;
}

.editor-inspector {
  transition: opacity 0.15s ease;
}

.editor-workspace.inspector-collapsed .editor-inspector {
  width: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.editor-inspector-toggle {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  position: absolute;
  z-index: 12;
  top: 20px;
  right: 338px;
  background: #1a1f1a;
  color: #888f87;
  display: flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: right 0.18s ease;
}

.editor-workspace.inspector-collapsed .editor-inspector-toggle {
  right: 18px;
}

.editor-inspector-toggle i {
  color: var(--accent);
  font-style: normal;
}

/* 选题导入与共享 */
.import-options {
  padding: 8px 18px 14px;
}

.import-draft-option {
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.014);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.import-draft-option strong,
.import-draft-option small {
  display: block;
}

.import-draft-option strong {
  color: #b9c0b7;
  font-size: 11px;
  font-weight: 530;
}

.import-draft-option small {
  margin-top: 4px;
  color: #666d65;
  font-size: 10px;
}

.share-library-modal {
  width: min(560px, calc(100vw - 32px));
}

.share-library-body {
  display: grid;
  gap: 17px;
}

.share-title-input {
  font-weight: 520;
}

.share-target {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
}

.share-target-head {
  min-height: 32px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-target-head > strong {
  color: #aeb5ac;
  font-size: 11px;
  font-weight: 530;
}

.association-switch.compact {
  padding: 2px;
}

.association-switch.compact button {
  min-height: 27px;
  padding: 0 10px;
  font-size: 9px;
}

.share-target .field + .field {
  margin-top: 0;
}

.share-summary {
  min-height: 42px;
  padding: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: #6e756d;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 10px;
}

.share-summary strong {
  color: #aab1a8;
  font-weight: 520;
}

.share-summary b {
  font-weight: 560;
}

@media (max-width: 900px) {
  .writing-home-materials {
    grid-template-columns: 1fr;
  }

  .writing-home-material-actions {
    flex-wrap: wrap;
  }

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

  .editor-inspector-toggle {
    display: none;
  }

  .editor-workspace,
  .editor-workspace.inspector-collapsed {
    grid-template-columns: 1fr;
  }

  .editor-workspace.inspector-collapsed .editor-inspector {
    width: auto;
    border-top: 1px solid var(--line);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 620px) {
  .writing-history-row {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .writing-history-row > span {
    display: none;
  }

  .material-preview-grid {
    grid-template-columns: 1fr;
  }

  .writing-materials-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-section-head {
    align-items: flex-start;
  }
}
