      :root {
        font-family:
          Inter,
          -apple-system,
          BlinkMacSystemFont,
          "Segoe UI",
          "Microsoft YaHei",
          sans-serif;
        color-scheme: dark;
        --bg: #0d1019;
        --panel: #191e2b;
        --panel2: #222839;
        --stroke: #343a4d;
        --text: #f4f6fc;
        --muted: #a3adbf;
        --accent: #b5a4ff;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        background:
          radial-gradient(ellipse at 70% -20%, #2a2448 0, transparent 55%),
          var(--bg);
        color: var(--text);
        min-height: 100vh;
      }

      main {
        max-width: 1160px;
        margin: auto;
        padding: 32px 18px 80px;
      }

      header {
        display: flex;
        justify-content: space-between;
        gap: 15px;
        align-items: flex-start;
        flex-wrap: wrap;
      }

      h1 {
        font-size: clamp(26px, 5vw, 42px);
        letter-spacing: -1px;
        margin: 5px 0 8px;
      }

      p {
        color: var(--muted);
        margin: 0;
        line-height: 1.7;
      }

      .eyebrow {
        font-size: 12px;
        letter-spacing: 2px;
        color: var(--accent);
        font-weight: 800;
      }

      .actions {
        display: flex;
        gap: 9px;
        flex-wrap: wrap;
      }

      button,
      .file-label {
        cursor: pointer;
        background: var(--panel2);
        border: 1px solid var(--stroke);
        color: var(--text);
        padding: 11px 15px;
        border-radius: 12px;
        font: inherit;
        font-size: 14px;
      }

      button.primary {
        background: var(--accent);
        color: #131321;
        font-weight: 800;
        border-color: var(--accent);
      }

      button:hover,
      .file-label:hover {
        filter: brightness(1.15);
      }

      .stats {
        display: flex;
        gap: 12px;
        margin: 28px 0;
        flex-wrap: wrap;
      }

      .stat {
        background: var(--panel);
        border: 1px solid var(--stroke);
        border-radius: 15px;
        padding: 15px 18px;
        min-width: 125px;
      }

      .stat b {
        display: block;
        font-size: 24px;
      }

      .stat span {
        font-size: 12px;
        color: var(--muted);
      }

      .filters {
        background: var(--panel);
        border: 1px solid var(--stroke);
        padding: 18px;
        border-radius: 18px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
      }

      .filters label,
      .form-grid label {
        font-size: 12px;
        color: var(--muted);
        display: grid;
        gap: 6px;
      }

      input,
      select,
      textarea {
        background: #0f1320;
        color: var(--text);
        border: 1px solid var(--stroke);
        border-radius: 9px;
        padding: 11px;
        width: 100%;
        font: inherit;
        outline: none;
      }

      input:focus,
      select:focus,
      textarea:focus {
        border-color: var(--accent);
      }

      .search {
        grid-column: span 2;
      }

      .heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 28px 0 14px;
        gap: 10px;
      }

      .heading h2 {
        font-size: 19px;
        margin: 0;
      }

      .heading small {
        color: var(--muted);
      }

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

      .card {
        background: var(--panel);
        border: 1px solid var(--stroke);
        border-radius: 17px;
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: 11px;
        min-height: 222px;
      }

      .card { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 12px; min-height: 0; padding: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
      .card:hover { border-color: var(--accent); transform: translateY(-2px); }
      .card-poster { width: 78px; aspect-ratio: 2 / 3; border-radius: 9px; overflow: hidden; background: #101521; }
      .card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
      .poster-placeholder { width: 100%; height: 100%; min-height: 88px; display: grid; place-items: center; padding: 6px; text-align: center; color: var(--muted); background: #101521; font-size: 11px; }
      .card-info { min-width: 0; display: grid; gap: 5px; }
      .card-info h3 { overflow-wrap: anywhere; font-size: 16px; }
      .card-info .sub { line-height: 1.45; overflow-wrap: anywhere; }
      .card-tags { min-width: 0; margin-top: 2px; align-content: flex-start; }
      .card-tags .tag { max-width: 100%; overflow-wrap: anywhere; }
      .card-admin { grid-column: 2; display: flex; gap: 6px; }
      .detail-view { margin-top: 20px; }
      .back-button { margin: 0 0 14px; }
      .detail { background: var(--panel); border: 1px solid var(--stroke); border-radius: 18px; padding: clamp(16px, 4vw, 30px); }
      .detail-header { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 24px; align-items: start; }
      .detail-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; }
      .detail-heading { display: grid; gap: 12px; min-width: 0; }
      .detail-heading h2 { font-size: clamp(23px, 4vw, 34px); margin: 0; overflow-wrap: anywhere; }
      .metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
      .metadata div { background: #101521; border-radius: 10px; padding: 10px 12px; min-width: 0; }
      .metadata .metadata-wide { grid-column: 1 / -1; }
      .metadata-wide dd { min-width: 0; }
      .detail-tags { min-width: 0; }
      .detail-tags .tag { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
      .metadata dt { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
      .metadata dd { margin: 0; overflow-wrap: anywhere; }
      .detail-section { border-top: 1px solid var(--stroke); margin-top: 24px; padding-top: 20px; }
      .detail-section h3 { margin: 0 0 12px; font-size: 18px; }
      .long-copy { color: #d8deea; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
      .people-list { display: grid; gap: 10px; }
      .person { padding: 12px; border: 1px solid var(--stroke); border-radius: 11px; }
      .person span { color: var(--muted); margin-left: 8px; }
      .person p { margin-top: 6px; white-space: pre-wrap; }
      .poster-editor { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
      .poster-editor img { width: 120px; max-height: 180px; object-fit: cover; border-radius: 9px; }

      .card h3 {
        font-size: 19px;
        margin: 0;
        line-height: 1.35;
      }

      .sub {
        font-size: 12px;
        color: var(--muted);
      }

      .tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .tag {
        background: #30334d;
        color: #d8d9ff;
        padding: 5px 9px;
        border-radius: 20px;
        font-size: 12px;
      }

      .tag.end {
        background: #253d3b;
        color: #9ce6ca;
      }

      .tag.be {
        background: #4d3035;
        color: #ffb2b7;
      }

      .tag.oe {
        background: #483e2b;
        color: #ffe1a0;
      }

      .note {
        font-size: 13px;
        color: #c3ccdc;
        line-height: 1.65;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        flex: 1;
      }

      .card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .tiny {
        padding: 7px 10px;
        font-size: 12px;
      }

      .empty {
        text-align: center;
        padding: 70px 20px;
        border: 1px dashed var(--stroke);
        border-radius: 18px;
        background: #171b27;
      }

      .empty b {
        display: block;
        font-size: 20px;
        margin-bottom: 8px;
      }

      .footer {
        margin-top: 36px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.8;
      }

      .modal {
        position: fixed;
        inset: 0;
        background: #000b;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 16px;
        z-index: 10;
      }

      .modal.show {
        display: flex;
      }

      .dialog {
        width: min(670px, 100%);
        background: var(--panel);
        border: 1px solid var(--stroke);
        border-radius: 18px;
        padding: 24px;
        max-height: 92vh;
        overflow-y: auto;
      }

      .dialog h2 {
        margin: 0 0 18px;
      }

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

      .span2 {
        grid-column: span 2;
      }

      .dialog-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 20px;
      }

      .setting-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
        margin: 8px 0 12px;
      }

      .setting-row input {
        flex: 1;
        min-width: 145px;
      }

      .option-line {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--stroke);
      }

      .option-line span {
        overflow-wrap: anywhere;
      }

      .option-line .actions {
        flex-shrink: 0;
      }

      .setting-section {
        padding: 15px 0;
        border-bottom: 1px solid var(--stroke);
      }

      .setting-section h3 {
        margin: 0 0 5px;
        font-size: 16px;
      }

      .notice {
        margin-top: 12px;
        font-size: 12px;
        color: var(--muted);
      }

      .spoiler {
        position: relative;
        border: 1px solid var(--stroke);
        border-radius: 12px;
        background: #101521;
        overflow: hidden;
      }

      .spoiler-content {
        padding: 13px;
        color: #d8deea;
        font-size: 13px;
        line-height: 1.65;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }

      .spoiler-cover {
        min-height: 92px;
        padding: 18px 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #e4e8f3;
        background: #090c14e8;
      }

      .spoiler-dismiss {
        position: absolute;
        top: 8px;
        right: 8px;
        padding: 3px 9px;
        font-size: 18px;
        line-height: 1.2;
      }

      .spoiler-hide {
        margin: 0 13px 12px;
      }

      .spoiler-cover[hidden],
      .spoiler-content[hidden],
      .spoiler-hide[hidden] {
        display: none !important;
      }

      @media (max-width: 680px) {
        .filters {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .search {
          grid-column: span 2;
        }

        .form-grid {
          grid-template-columns: 1fr;
        }

        .span2 {
          grid-column: span 1;
        }

        .stat {
          flex: 1;
          min-width: 90px;
        }

        .dialog {
          padding: 16px;
        }
        .detail-header { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
        .metadata { grid-template-columns: 1fr; }
      }

      @media (max-width: 420px) {
        .filters {
          grid-template-columns: 1fr;
        }

        .search {
          grid-column: span 1;
        }
      }
