/*! 缺陷管理 · 琥珀玫瑰主题（独立于用例管理青绿） */

/*
 * 本页未引入 Tailwind，需自行 border-box。
 * 否则 .hf-gnav__inner 的 width:100% + padding 会撑出视口，右侧头像被裁切
 *（提示词库页靠 Tailwind preflight 正常）。
 */
html.dm-html {
    overflow-x: hidden;
}

body.dm-page,
body.dm-page *,
body.dm-page *::before,
body.dm-page *::after {
    box-sizing: border-box;
}

:root {
    --dm-amber-1: #fff7ed;
    --dm-rose-1: #fff1f2;
    --dm-slate: #f8fafc;
    --dm-amber-glow: rgba(251, 146, 60, 0.2);
    --dm-rose-glow: rgba(244, 63, 94, 0.12);
    --dm-grid: rgba(190, 18, 60, 0.06);
    --dm-accent: #e11d48;
    --dm-accent-hover: #be123c;
    --dm-ink: #0f172a;
    --dm-muted: #64748b;
    --dm-title-soft: #9f1239;
}

body.dm-page {
    margin: 0;
    min-height: 100vh;
    color: var(--dm-ink);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--dm-amber-1);
    overflow-x: hidden;
    max-width: 100%;
}

.dm-page__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dm-page__bg-base {
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, #fff7ed 0%, #fff1f2 42%, #f8fafc 100%);
}

.dm-page__bg-base::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 56% at 50% -12%, var(--dm-amber-glow), transparent 62%),
        radial-gradient(ellipse 50% 40% at 92% 18%, var(--dm-rose-glow), transparent 58%),
        radial-gradient(ellipse 44% 38% at 4% 78%, rgba(251, 146, 60, 0.12), transparent 55%);
}

.dm-page__bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.9;
    background-image:
        linear-gradient(var(--dm-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--dm-grid) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.dm-page__bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
}

.dm-page__bg-orb--a {
    width: 280px;
    height: 280px;
    top: -40px;
    right: 8%;
    background: rgba(251, 146, 60, 0.28);
}

.dm-page__bg-orb--b {
    width: 220px;
    height: 220px;
    bottom: 12%;
    left: 4%;
    background: rgba(244, 63, 94, 0.16);
}

.dm-page__bg-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 252, 0.35) 100%);
}

.dm-shell {
    --dm-shell-max: 1600px;
    --dm-shell-gutter: 28px;
    position: relative;
    z-index: 1;
    width: min(var(--dm-shell-max), calc(100vw - var(--dm-shell-gutter) * 2));
    max-width: var(--dm-shell-max);
    margin: 0 auto;
    padding: 0.75rem 0 3.75rem;
    min-height: calc(100vh - 3.25rem);
    box-sizing: border-box;
}

body.dm-page #hf-site-footer.hf-site-footer {
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
    background: rgba(255, 251, 250, 0.94);
    border-top-color: rgba(251, 113, 133, 0.18);
    color: #64748b;
}

body.dm-page #hf-site-footer .hf-site-footer__row {
    justify-content: center;
}

body.dm-page #hf-site-footer .hf-site-footer__icp:hover,
body.dm-page #hf-site-footer .hf-site-footer__icp:focus-visible {
    color: #9f1239;
}

.dm-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(251, 113, 133, 0.2);
    box-shadow: 0 8px 22px rgba(190, 18, 60, 0.05);
}

.dm-topbar__brand {
    min-width: 0;
}

.dm-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--dm-title-soft);
    line-height: 1.25;
}

.dm-sub {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--dm-muted);
}

.dm-topbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.dm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.88);
    color: var(--dm-ink);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dm-btn--sm {
    padding: 0.32rem 0.65rem;
    font-size: 0.78rem;
}

.dm-btn:hover:not(:disabled) {
    border-color: rgba(225, 29, 72, 0.35);
    background: #fff;
}

.dm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dm-btn--primary {
    background: var(--dm-accent);
    border-color: var(--dm-accent);
    color: #fff;
}

.dm-btn--primary:hover:not(:disabled) {
    background: var(--dm-accent-hover);
    border-color: var(--dm-accent-hover);
    color: #fff;
}

.dm-btn--ghost {
    background: rgba(255, 255, 255, 0.65);
}

.dm-btn--danger {
    color: #be123c;
    border-color: rgba(225, 29, 72, 0.35);
}

.dm-select,
.dm-input,
.dm-textarea {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.45rem;
    background: #fff;
    color: var(--dm-ink);
    font-size: 0.8125rem;
    padding: 0.32rem 0.55rem;
    min-height: 2rem;
    box-sizing: border-box;
}

.dm-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.6rem;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
        linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: calc(100% - 12px) calc(50% - 1.5px), calc(100% - 7px) calc(50% - 1.5px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.dm-select:hover {
    border-color: rgba(100, 116, 139, 0.55);
}

.dm-select:focus,
.dm-input:focus,
.dm-textarea:focus {
    outline: none;
    border-color: rgba(100, 116, 139, 0.65);
    box-shadow: none;
}

.dm-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dm-textarea {
    min-height: 6rem;
    resize: vertical;
    width: 100%;
    font-family: inherit;
    line-height: 1.45;
}

.dm-select--project {
    min-width: 11rem;
    max-width: 16rem;
}

.dm-gate,
.dm-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 9.5rem);
    margin-top: 0.25rem;
    padding: 1.25rem;
    text-align: center;
    border-radius: 1rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 241, 242, 0.55)),
        rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(251, 113, 133, 0.22);
    box-shadow: 0 14px 36px rgba(190, 18, 60, 0.06);
}

.dm-gate__card {
    max-width: 28rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.dm-gate__kicker {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fb7185;
}

.dm-gate__title {
    margin: 0 0 0.55rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #9f1239;
}

.dm-gate__desc {
    margin: 0 0 1.15rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.55;
    color: var(--dm-muted);
}

.dm-gate p,
.dm-empty p {
    margin: 0 0 1rem;
    color: #9f1239;
    font-weight: 600;
}

.dm-gate .dm-muted,
.dm-empty .dm-muted {
    font-weight: 500;
    color: var(--dm-muted);
    font-size: 0.88rem;
}

.is-hidden {
    display: none !important;
}

.dm-workspace {
    display: grid;
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: stretch;
    min-height: calc(100vh - 8.25rem);
}

@media (max-width: 860px) {
    .dm-workspace {
        grid-template-columns: 1fr;
        min-height: min(78vh, 760px);
    }
}

.dm-side {
    display: flex;
    flex-direction: column;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(251, 113, 133, 0.18);
    padding: 0.75rem 0.65rem;
    position: sticky;
    top: 4.25rem;
    align-self: start;
    max-height: calc(100vh - 5rem);
    overflow: auto;
}

.dm-side__label {
    margin: 0 0 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--dm-muted);
}

.dm-side__label--spaced {
    margin-top: 0.95rem;
}

.dm-side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dm-side-nav button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.42rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dm-ink);
    cursor: pointer;
}

.dm-side-nav__text {
    min-width: 0;
}

.dm-side-count {
    flex-shrink: 0;
    min-width: 1.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.95);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
}

.dm-side-nav button:hover {
    background: rgba(251, 113, 133, 0.1);
}

.dm-side-nav button.is-active {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.dm-side-nav button.is-active .dm-side-count {
    background: rgba(225, 29, 72, 0.16);
    color: #be123c;
}

.dm-main {
    display: flex;
    flex-direction: column;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(251, 113, 133, 0.18);
    padding: 0.7rem 0.75rem 0.65rem;
    min-height: 0;
    min-width: 0;
}

.dm-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

@media (max-width: 720px) {
    .dm-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dm-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(251, 113, 133, 0.16);
    background: linear-gradient(165deg, rgba(255, 247, 237, 0.9), rgba(255, 241, 242, 0.72));
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dm-stat:hover {
    border-color: rgba(225, 29, 72, 0.35);
    box-shadow: 0 6px 16px rgba(190, 18, 60, 0.06);
}

.dm-stat.is-active {
    border-color: rgba(225, 29, 72, 0.45);
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.18);
}

.dm-stat__label {
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--dm-muted);
}

.dm-stat__value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
    color: #9f1239;
    letter-spacing: -0.02em;
}

.dm-stat--blocker .dm-stat__value { color: #be123c; }
.dm-stat--major .dm-stat__value { color: #c2410c; }

.dm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
    align-items: center;
}

.dm-filters .dm-input {
    flex: 1 1 12rem;
    min-width: 9rem;
    width: auto;
}

.dm-table-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 18rem;
    overflow: auto;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #fff;
}

.dm-table-wrap.is-empty {
    overflow: hidden;
}

.dm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dm-table-wrap.is-empty .dm-table {
    height: auto;
}

.dm-table th,
.dm-table td {
    padding: 0.48rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: middle;
}

.dm-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 241, 242, 0.96);
    font-size: 0.72rem;
    color: #9f1239;
    font-weight: 700;
    white-space: nowrap;
}

.dm-col-id { width: 4.5rem; white-space: nowrap; color: #9f1239; font-weight: 700; }
.dm-col-title { min-width: 12rem; }
.dm-col-sev { width: 5.5rem; white-space: nowrap; }
.dm-col-status { width: 5.5rem; white-space: nowrap; }
.dm-col-user { width: 7rem; }
.dm-col-time { width: 9.5rem; white-space: nowrap; color: #64748b; font-size: 0.78rem; }

.dm-table tbody tr {
    cursor: pointer;
    transition: background 0.12s;
}

.dm-table tbody tr:hover {
    background: rgba(255, 247, 237, 0.9);
}

.dm-table tbody tr.is-active {
    background: rgba(254, 226, 226, 0.55);
}

.dm-list-empty {
    position: absolute;
    left: 0;
    right: 0;
    top: 2.35rem;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
    pointer-events: none;
    background:
        radial-gradient(ellipse 72% 58% at 50% 48%, rgba(255, 241, 242, 0.78), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 251, 250, 0.55));
}

.dm-list-empty.is-hidden,
.dm-list-empty[hidden] {
    display: none !important;
}

.dm-list-empty__inner {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: min(100%, 22rem);
    padding: 1.55rem 1.4rem 1.4rem;
    border-radius: 1.05rem;
    border: 1px dashed rgba(251, 113, 133, 0.4);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.88));
    box-shadow:
        0 14px 34px rgba(190, 18, 60, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dm-list-empty__icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 0 0.9rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    color: #e11d48;
    background:
        linear-gradient(145deg, rgba(255, 228, 230, 0.98), rgba(255, 247, 237, 0.92));
    box-shadow:
        inset 0 0 0 1px rgba(225, 29, 72, 0.12),
        0 8px 16px rgba(190, 18, 60, 0.08);
}

.dm-list-empty__icon svg {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}

.dm-list-empty__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #9f1239;
}

.dm-list-empty__desc {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #64748b;
    max-width: 18rem;
}

.dm-list-empty__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 1.05rem;
}

/* 旧 table 内空态类保留兼容，不再作为主空态 */
.dm-table-empty {
    display: none;
}

.dm-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.dm-badge--open { background: #ffedd5; color: #c2410c; }
.dm-badge--confirmed { background: #dbeafe; color: #1d4ed8; }
.dm-badge--in_progress { background: #e0e7ff; color: #4338ca; }
.dm-badge--resolved { background: #dcfce7; color: #15803d; }
.dm-badge--closed { background: #e2e8f0; color: #475569; }
.dm-badge--rejected { background: #f1f5f9; color: #334155; }

.dm-sev--blocker { color: #be123c; font-weight: 700; }
.dm-sev--major { color: #c2410c; font-weight: 650; }
.dm-sev--normal { color: #475569; }
.dm-sev--minor { color: #64748b; }
.dm-sev--trivial { color: #94a3b8; }

.dm-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--dm-muted);
    flex-shrink: 0;
}

.dm-drawer-mask {
    position: fixed;
    inset: 0;
    /* 高于顶栏 .hf-gnav(100)，避免抽屉头部被导航遮挡 */
    z-index: 210;
    background: rgba(15, 23, 42, 0.42);
    display: flex;
    justify-content: flex-end;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 抽屉打开时压低顶栏，避免 sticky 导航叠在抽屉之上 */
body.dm-page:has(#dm-drawer-mask:not(.is-hidden)) .hf-gnav {
    z-index: 50;
}

.dm-drawer {
    width: min(34rem, 100%);
    height: 100%;
    background: linear-gradient(180deg, #fff8f4 0%, #ffffff 28%);
    border-left: 1px solid rgba(251, 113, 133, 0.28);
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
}

.dm-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.95rem 1.05rem 0.85rem;
    border-bottom: 1px solid rgba(251, 113, 133, 0.16);
    background: linear-gradient(180deg, rgba(255, 241, 242, 0.85), rgba(255, 255, 255, 0.4));
}

.dm-drawer__head-main {
    min-width: 0;
    flex: 1 1 auto;
}

.dm-drawer__eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e11d48;
}

.dm-drawer__head strong,
.dm-drawer__head #dm-drawer-title {
    display: block;
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #9f1239;
    line-height: 1.3;
}

.dm-drawer__sub {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.35;
}

.dm-drawer__tabs {
    display: flex;
    gap: 0.15rem;
    padding: 0.35rem 0.95rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.55);
}

.dm-drawer-tab {
    appearance: none;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0.55rem 0.85rem 0.6rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.dm-drawer-tab:hover {
    color: #9f1239;
    background: rgba(255, 241, 242, 0.55);
}

.dm-drawer-tab.is-active {
    color: #9f1239;
}

.dm-drawer-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: #e11d48;
}

.dm-drawer-tab.is-hidden {
    display: none !important;
}

.dm-drawer__body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0.85rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dm-drawer-pane {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.dm-drawer-pane.is-hidden {
    display: none !important;
}

.dm-drawer-pane#dm-pane-activity {
    flex: 1 1 auto;
    min-height: 12rem;
}

.dm-drawer-sec {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.dm-drawer-sec.is-hidden {
    display: none !important;
}

.dm-drawer-sec__title {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.dm-drawer-sec__head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    min-width: 0;
}

.dm-drawer-sec__head .dm-drawer-sec__title {
    flex: 0 0 auto;
}

.dm-btn--pick-cases {
    flex: 0 0 auto;
    align-self: center;
    min-height: 1.45rem;
    height: 1.45rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(225, 29, 72, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 241, 242, 0.88));
    color: #be123c;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(190, 18, 60, 0.05);
}

.dm-btn--pick-cases:hover:not(:disabled) {
    border-color: rgba(225, 29, 72, 0.45);
    background: linear-gradient(180deg, #fff, rgba(255, 228, 230, 0.92));
    color: #9f1239;
    box-shadow: 0 3px 10px rgba(190, 18, 60, 0.08);
}

.dm-btn--pick-cases:disabled {
    opacity: 0.45;
}

.dm-drawer-sec__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.dm-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.28rem;
    margin: 0;
    position: relative;
}

.dm-field--flush {
    gap: 0.45rem;
}

.dm-field > span {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--dm-muted);
    line-height: 1.2;
}

.dm-field__hint {
    margin-left: 0.3rem;
    font-weight: 500;
    color: #94a3b8;
}

.dm-field > .dm-input,
.dm-field > .dm-select,
.dm-field > .dm-textarea,
.dm-field > .dm-btn,
.dm-field > .dm-chips,
.dm-field > .dm-comments,
.dm-field > .dm-readonly {
    margin: 0;
}

.dm-readonly {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.1rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8125rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
}

.dm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    align-items: start;
}

.dm-field-row > .dm-field {
    min-width: 0;
}

.dm-drawer .dm-input {
    width: 100%;
    min-height: 2.1rem;
    height: 2.1rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}

.dm-drawer .dm-textarea {
    min-height: 6.5rem;
    padding: 0.55rem 0.65rem;
    margin: 0;
    border-radius: 0.55rem;
    line-height: 1.5;
}

.dm-drawer .dm-textarea--comment {
    min-height: 3.75rem;
}

.dm-drawer .dm-btn--sm {
    align-self: flex-start;
    min-height: 1.85rem;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
}

.dm-drawer .dm-chips:empty::before {
    content: "尚未关联用例";
    color: #94a3b8;
    font-size: 0.78rem;
}

.dm-drawer .dm-comments:empty::before {
    content: "暂无评论";
    display: block;
    color: #94a3b8;
    font-size: 0.78rem;
    padding: 0.15rem 0;
}

/* —— 抽屉顶部「基本信息」字段强化（仅抽屉内，不影响顶栏筛选） —— */
.dm-drawer-sec--basic {
    gap: 0.65rem;
    padding: 0.85rem 0.9rem 0.95rem;
    border-color: rgba(251, 113, 133, 0.22);
    background: linear-gradient(180deg, #ffffff 0%, #fff7f8 100%);
}

.dm-drawer-sec--basic .dm-drawer-sec__title {
    color: #9f1239;
    letter-spacing: 0.06em;
}

.dm-drawer-sec--basic .dm-drawer-sec__body {
    gap: 0.7rem;
}

.dm-drawer-sec--basic .dm-field > span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #78716c;
}

.dm-drawer-sec--basic .dm-field--title > span {
    color: #9f1239;
}

.dm-drawer .dm-input--title,
.dm-drawer #dm-f-title.dm-input {
    min-height: 2.55rem;
    height: 2.55rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    border: 1px solid rgba(251, 113, 133, 0.28);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dm-drawer .dm-input--title:focus,
.dm-drawer #dm-f-title.dm-input:focus {
    outline: none;
    border-color: rgba(225, 29, 72, 0.55);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18);
}

.dm-drawer .dm-input--title::placeholder,
.dm-drawer #dm-f-title.dm-input::placeholder {
    font-weight: 500;
    color: #a8a29e;
}

.dm-drawer-sec--basic .dm-field-row--meta,
.dm-drawer-sec--basic .dm-field-row--people {
    gap: 0.65rem;
}

.dm-drawer-sec--basic .dm-field--pick,
.dm-drawer-sec--basic .dm-field--person {
    padding: 0.45rem 0.5rem 0.5rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(231, 229, 228, 0.9);
}

.dm-drawer-sec--basic .dm-multi__control {
    min-height: 2.25rem;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border-radius: 0.55rem;
    border-color: rgba(214, 211, 209, 0.95);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dm-drawer-sec--basic .dm-multi__control:hover {
    border-color: rgba(251, 113, 133, 0.4);
}

.dm-drawer-sec--basic .dm-multi.is-open .dm-multi__control {
    border-color: rgba(225, 29, 72, 0.5);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14);
}

.dm-drawer-sec--basic .dm-multi__summary {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1c1917;
}

.dm-drawer-sec--basic .dm-multi__summary.is-placeholder {
    font-weight: 500;
    color: #a8a29e;
}

.dm-drawer-sec--basic .dm-readonly--person,
.dm-drawer-sec--basic .dm-readonly {
    min-height: 2.25rem;
    border-radius: 0.55rem;
    border-color: rgba(214, 211, 209, 0.85);
    background: #fafaf9;
    color: #44403c;
    font-weight: 600;
}

.dm-drawer-sec--basic #dm-pick-severity .dm-multi__summary {
    color: #9f1239;
}

.dm-drawer-sec--basic #dm-pick-status .dm-multi__summary {
    color: #0f766e;
}

@media (max-width: 420px) {
    .dm-drawer-sec--basic .dm-field-row--meta,
    .dm-drawer-sec--basic .dm-field-row--people {
        grid-template-columns: 1fr;
    }
}

.dm-multi {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.dm-field-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 0 0 auto;
}

.dm-field-inline__label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #9f1239;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}

.dm-field-inline--project {
    padding: 0.18rem 0.22rem 0.18rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 241, 242, 0.95), rgba(255, 247, 237, 0.88));
    border: 1px solid rgba(251, 113, 133, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.dm-field-inline--project .dm-field-inline__label {
    font-size: 0.74rem;
    opacity: 0.92;
}

.dm-field-inline--filter {
    gap: 0;
}

/* 顶栏项目 / 筛选项：保持紧凑横排，不被抽屉内 100% 宽度带偏 */
.dm-multi.dm-multi--toolbar {
    width: 12.5rem;
    min-width: 11rem;
    max-width: 18rem;
    flex: 0 0 auto;
    z-index: 30;
}

.dm-multi.dm-multi--filter {
    width: 9.25rem;
    min-width: 8.75rem;
    max-width: 12rem;
    flex: 0 0 auto;
    z-index: 20;
}

.dm-filters .dm-multi__control,
.dm-topbar__right .dm-multi__control {
    align-items: center;
    min-height: 2.05rem;
    height: 2.05rem;
    padding: 0.2rem 0.55rem 0.2rem 0.7rem;
}

.dm-field-inline--project .dm-multi__control {
    border: none;
    background: transparent;
    box-shadow: none;
    min-height: 1.85rem;
    height: 1.85rem;
    padding: 0.15rem 0.45rem 0.15rem 0.15rem;
}

.dm-field-inline--project .dm-multi__control:hover,
.dm-field-inline--project .dm-multi.is-open .dm-multi__control {
    border: none;
    background: transparent;
    box-shadow: none;
}

.dm-field-inline--project.dm-field-inline--open,
.dm-field-inline--project:has(.dm-multi.is-open) {
    border-color: rgba(225, 29, 72, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 3px rgba(225, 29, 72, 0.08);
}

.dm-filters .dm-multi__summary,
.dm-topbar__right .dm-multi__summary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-multi__control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 2.05rem;
    padding: 0.28rem 0.55rem 0.28rem 0.7rem;
    border: 1px solid rgba(251, 113, 133, 0.22);
    border-radius: 0.65rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.72));
    color: var(--dm-ink);
    font-size: 0.8125rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(190, 18, 60, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dm-multi__control:hover {
    border-color: rgba(225, 29, 72, 0.35);
    box-shadow: 0 4px 12px rgba(190, 18, 60, 0.07);
}

.dm-multi.is-open .dm-multi__control {
    border-color: rgba(225, 29, 72, 0.42);
    box-shadow:
        0 0 0 3px rgba(225, 29, 72, 0.1),
        0 6px 16px rgba(190, 18, 60, 0.08);
}

.dm-multi__control.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.dm-multi__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
    flex: 1 1 auto;
    min-width: 0;
    color: #1f2937;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.dm-multi__summary.is-placeholder {
    display: block;
    color: #94a3b8;
    font-weight: 500;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-multi__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    padding: 0.08rem 0.2rem 0.08rem 0.4rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #f8fafc;
    color: #334155;
    line-height: 1.25;
}

.dm-multi__tag-text {
    min-width: 0;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
}

.dm-multi__tag-rm {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0.22rem;
    background: transparent;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

.dm-multi__tag-rm:hover {
    color: #475569;
    background: #e2e8f0;
}

.dm-multi__caret {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: none;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 241, 242, 0.95), rgba(254, 226, 226, 0.75));
    box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.18);
    position: relative;
    font-size: 0;
    line-height: 0;
    color: transparent;
    transition: transform 0.16s ease, background 0.15s ease;
}

.dm-multi__caret::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 46%;
    width: 0.34rem;
    height: 0.34rem;
    border-right: 1.5px solid #be123c;
    border-bottom: 1.5px solid #be123c;
    transform: translate(-50%, -60%) rotate(45deg);
}

.dm-multi.is-open .dm-multi__caret {
    transform: rotate(180deg);
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.95), rgba(255, 228, 230, 0.85));
}

.dm-multi__panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    max-height: 14rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.35rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(251, 113, 133, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 250, 0.96));
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(190, 18, 60, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 113, 133, 0.35) transparent;
    animation: dm-pick-in 0.14s ease-out;
}

.dm-multi--toolbar .dm-multi__panel {
    left: auto;
    right: 0;
    min-width: 15rem;
    width: max(100%, 15rem);
}

.dm-multi--filter .dm-multi__panel {
    min-width: 11rem;
    width: max(100%, 11rem);
}

@keyframes dm-pick-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dm-multi__panel::-webkit-scrollbar {
    width: 6px;
    height: 0;
}

.dm-multi__panel::-webkit-scrollbar-thumb {
    background: rgba(251, 113, 133, 0.35);
    border-radius: 999px;
}

.dm-multi__panel::-webkit-scrollbar-track {
    background: transparent;
}

.dm-multi__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.52rem 0.65rem;
    border: none;
    border-radius: 0.55rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.35;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
}

.dm-multi__opt:hover {
    background: rgba(255, 241, 242, 0.9);
    color: #9f1239;
}

.dm-multi__opt.is-checked {
    background: linear-gradient(135deg, rgba(255, 228, 230, 0.95), rgba(255, 247, 237, 0.9));
    color: #9f1239;
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.12);
}

.dm-multi__opt.is-checked:hover {
    background: linear-gradient(135deg, rgba(254, 205, 211, 0.95), rgba(255, 237, 213, 0.92));
}

.dm-multi__opt-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.dm-multi__opt.is-checked .dm-multi__opt-text {
    font-weight: 700;
}

.dm-multi__opt-mark {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    background: rgba(225, 29, 72, 0.12);
    color: transparent;
    font-size: 0;
    position: relative;
}

.dm-multi__opt-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 46%;
    width: 0.28rem;
    height: 0.48rem;
    border-right: 1.6px solid #e11d48;
    border-bottom: 1.6px solid #e11d48;
    transform: translate(-50%, -60%) rotate(45deg);
}

.dm-multi__empty {
    padding: 0.9rem 0.6rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
}

.dm-handler-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-width: 13rem;
}

.dm-handler-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.06rem 0.35rem;
    border-radius: 0.28rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f8fafc;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 450;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 0;
}

.dm-chips__empty {
    font-size: 0.75rem;
    color: #94a3b8;
}

.dm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    max-width: 100%;
    border-radius: 999px;
    background: #fff1f2;
    border: 1px solid rgba(251, 113, 133, 0.3);
    padding: 0.16rem 0.4rem 0.16rem 0.55rem;
    font-size: 0.72rem;
    color: #9f1239;
}

.dm-chip__title {
    min-width: 0;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.dm-chip__result {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.3;
    background: #f1f5f9;
    color: #64748b;
}

.dm-chip__result--pass { background: #dcfce7; color: #166534; }
.dm-chip__result--fail { background: #fee2e2; color: #991b1b; }
.dm-chip__result--blocked { background: #ffedd5; color: #9a3412; }
.dm-chip__result--skip { background: #e2e8f0; color: #475569; }
.dm-chip__result--unset { background: #f8fafc; color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.35); }

.dm-chip button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #be123c;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.1rem;
}

.dm-comments {
    display: grid;
    gap: 0.45rem;
}

.dm-comments-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.dm-comments-pager.is-hidden {
    display: none !important;
}

.dm-comments-pager__info {
    font-size: 0.72rem;
    color: var(--dm-muted);
    font-weight: 600;
    min-width: 6.5rem;
    text-align: center;
}

.dm-comments-pager .dm-btn--sm {
    min-height: 1.55rem;
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
}

.dm-comment {
    border-radius: 0.55rem;
    background: rgba(255, 247, 237, 0.7);
    border: 1px solid rgba(251, 146, 60, 0.18);
    padding: 0.45rem 0.55rem;
}

.dm-comment__meta {
    font-size: 0.72rem;
    color: var(--dm-muted);
    margin-bottom: 0.15rem;
}

.dm-comment__body {
    font-size: 0.84rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.dm-drawer__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1.05rem;
    border-top: 1px solid rgba(251, 113, 133, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), #fff7ed);
}

.dm-drawer__foot-spacer {
    flex: 1 1 auto;
    min-width: 0.5rem;
}

/* —— 活动时间线 —— */
.dm-activity {
    min-width: 0;
}
.dm-activity__empty {
    padding: 1.4rem 0.6rem;
    text-align: center;
    font-size: 0.84rem;
    color: #94a3b8;
}
.dm-activity__list {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.dm-activity__item {
    display: grid;
    grid-template-columns: 0.85rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    position: relative;
    padding: 0 0 0.85rem;
}
.dm-activity__item:last-child {
    padding-bottom: 0.1rem;
}
.dm-activity__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.85rem;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.45), rgba(148, 163, 184, 0.08));
}
.dm-activity__dot {
    width: 0.68rem;
    height: 0.68rem;
    margin-top: 0.28rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
    z-index: 1;
}
.dm-activity__card {
    min-width: 0;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.92);
}
.dm-activity__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
}
.dm-activity__action {
    font-size: 0.84rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}
.dm-activity__actor {
    margin-top: 0.22rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}
.dm-activity__actor-label {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 0.1rem;
}
.dm-activity__actor-name {
    color: #475569;
    font-weight: 600;
}
.dm-activity__time {
    font-size: 0.72rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* —— 缺陷抽屉 · 血缘卡片 —— */
.dm-l5-lineage {
    margin: 0 0 0.15rem;
}
.dm-l5-lineage__card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(251, 113, 133, 0.24);
    background: linear-gradient(165deg, #fff 0%, #fff7ed 55%, #fff1f2 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}
.dm-l5-lineage__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}
.dm-l5-lineage__eyebrow {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e11d48;
}
.dm-l5-lineage__title {
    margin: 0.1rem 0 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #9f1239;
}
.dm-l5-lineage__status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ffedd5;
    color: #c2410c;
}
.dm-l5-lineage__status--confirmed { background: #dbeafe; color: #1d4ed8; }
.dm-l5-lineage__status--in_progress { background: #e0e7ff; color: #4338ca; }
.dm-l5-lineage__status--resolved { background: #dcfce7; color: #15803d; }
.dm-l5-lineage__status--closed { background: #f1f5f9; color: #475569; }
.dm-l5-lineage__status--rejected { background: #fee2e2; color: #b91c1c; }
.dm-l5-lineage__identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.dm-l5-lineage__id {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(251, 113, 133, 0.25);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9f1239;
}
.dm-l5-lineage__note {
    font-size: 0.72rem;
    color: #94a3b8;
}
.dm-l5-lineage__block {
    padding: 0.55rem 0.6rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(231, 229, 228, 0.95);
}
.dm-l5-lineage__block-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #78716c;
}
.dm-l5-lineage__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ffe4e6;
    color: #9f1239;
    font-size: 0.68rem;
    font-weight: 700;
}
.dm-l5-lineage__cases {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}
.dm-l5-lineage__case {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.55rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    background: #fafaf9;
    border: 1px solid rgba(231, 229, 228, 0.9);
}
.dm-l5-lineage__case-link {
    flex: 1 1 auto;
    min-width: 0;
    color: #be123c;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}
.dm-l5-lineage__case-link:hover {
    text-decoration: underline;
}
.dm-l5-lineage__result {
    flex: 0 0 auto;
    display: inline-flex;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}
.dm-l5-lineage__result--pass { background: #dcfce7; color: #166534; }
.dm-l5-lineage__result--fail { background: #fee2e2; color: #991b1b; }
.dm-l5-lineage__result--blocked { background: #ffedd5; color: #9a3412; }
.dm-l5-lineage__result--skip { background: #f1f5f9; color: #475569; }
.dm-l5-lineage__empty,
.dm-l5-lineage__loading {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
}
.dm-l5-lineage__error {
    margin: 0;
    font-size: 0.8rem;
    color: #be123c;
}
.dm-l5-lineage__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.15rem;
    border-top: 1px dashed rgba(251, 113, 133, 0.28);
}

.dm-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 230;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dm-modal {
    width: min(36rem, 100%);
    max-height: min(34rem, 88vh);
    display: flex;
    flex-direction: column;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, #fffaf5, #ffffff);
    border: 1px solid rgba(251, 113, 133, 0.28);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
}

.dm-modal--cases {
    width: min(52rem, 96vw);
    height: min(34rem, 90vh);
    max-height: min(34rem, 90vh);
    overflow: hidden;
}

.dm-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(251, 113, 133, 0.18);
    flex: 0 0 auto;
}

.dm-modal__head strong {
    font-size: 0.95rem;
    color: #9f1239;
}

.dm-modal__split {
    display: grid;
    grid-template-columns: 12.5rem minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    border-bottom: 1px solid rgba(251, 113, 133, 0.12);
}

.dm-case-modal-tree-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 247, 237, 0.45);
}

.dm-case-modal-side-label {
    margin: 0;
    padding: 0.55rem 0.7rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--dm-muted);
    flex: 0 0 auto;
}

.dm-case-modal-tree {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0.4rem 0.6rem;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.dm-case-modal-tree__item {
    margin: 0;
}

.dm-case-modal-tree__row {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
}

.dm-case-modal-tree__twist {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
}

.dm-case-modal-tree__twist.is-leaf {
    visibility: hidden;
    cursor: default;
}

.dm-case-modal-tree__label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.32rem 0.4rem;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-case-modal-tree__label:hover {
    background: rgba(255, 255, 255, 0.75);
}

.dm-case-modal-tree__item.is-active > .dm-case-modal-tree__row > .dm-case-modal-tree__label {
    background: #fff1f2;
    color: #9f1239;
    font-weight: 650;
}

.dm-case-modal-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.dm-modal__toolbar {
    display: flex;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem 0.4rem;
    flex: 0 0 auto;
}

.dm-modal__toolbar .dm-input {
    flex: 1 1 auto;
    min-width: 0;
}

.dm-case-modal-list {
    display: grid;
    gap: 0.28rem;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.15rem 0.75rem 0.4rem;
}

.dm-case-modal-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.45rem;
    background: #fff;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--dm-ink);
}

.dm-case-modal-item:hover {
    border-color: rgba(100, 116, 139, 0.45);
    background: #f8fafc;
}

.dm-case-modal-item.is-selected {
    border-color: rgba(225, 29, 72, 0.4);
    background: #fff1f2;
}

.dm-case-modal-item input {
    margin-top: 0.12rem;
    flex: 0 0 auto;
    accent-color: #e11d48;
}

.dm-case-modal-item__title {
    font-weight: 550;
    line-height: 1.35;
    min-width: 0;
    word-break: break-word;
}

.dm-case-modal-empty {
    margin: 1.5rem 0;
    text-align: center;
    color: var(--dm-muted);
    font-size: 0.82rem;
}

.dm-case-modal-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem 0.55rem;
    flex: 0 0 auto;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.dm-case-modal-pager span {
    font-size: 0.75rem;
    color: var(--dm-muted);
}

.dm-modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.65rem 0.9rem;
    flex: 0 0 auto;
}

.dm-modal__hint {
    margin-right: auto;
    font-size: 0.78rem;
    color: var(--dm-muted);
}

@media (max-width: 640px) {
    .dm-modal__split {
        grid-template-columns: 1fr;
        grid-template-rows: 8.5rem minmax(0, 1fr);
    }

    .dm-case-modal-tree-wrap {
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    }
}

.dm-icon-btn {
    border: none;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: var(--dm-muted);
    padding: 0.1rem 0.35rem;
}

.dm-icon-btn:hover {
    color: var(--dm-accent);
}

.dm-modal--members {
    width: min(34rem, 96vw);
    height: min(32rem, 90vh);
    max-height: min(32rem, 90vh);
    overflow: hidden;
}

.dm-members-lead {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--dm-muted);
    font-weight: 450;
}

.dm-members-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.65rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dm-members-invite {
    padding: 0.65rem 0.7rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(251, 113, 133, 0.22);
    background: rgba(255, 241, 242, 0.45);
}

.dm-members-invite.is-hidden {
    display: none;
}

.dm-members-invite__title {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 650;
    color: #9f1239;
}

.dm-members-search-bar {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.dm-members-search-bar .dm-input {
    flex: 1 1 auto;
    min-width: 0;
}

.dm-members-search-list {
    margin-top: 0.4rem;
    display: grid;
    gap: 0.25rem;
    max-height: 7.5rem;
    overflow: auto;
}

.dm-members-search-list.is-empty:empty {
    display: none;
}

.dm-members-search-empty {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--dm-muted);
    text-align: center;
}

.dm-members-search-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.4rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    color: var(--dm-ink);
}

.dm-members-search-item:hover,
.dm-members-search-item.is-active {
    border-color: rgba(225, 29, 72, 0.35);
    background: #fff1f2;
}

.dm-members-search-item strong {
    font-size: 0.8rem;
}

.dm-members-search-item__meta {
    font-size: 0.7rem;
    color: var(--dm-muted);
}

.dm-members-picked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(251, 113, 133, 0.18);
}

.dm-members-picked.is-hidden {
    display: none;
}

.dm-members-picked__user {
    flex: 1 1 8rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dm-members-picked__user strong {
    font-size: 0.8rem;
}

.dm-members-picked__user span {
    font-size: 0.7rem;
    color: var(--dm-muted);
}

.dm-members-picked .dm-select {
    width: 5.5rem;
    flex: 0 0 auto;
}

.dm-members-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--dm-muted);
}

.dm-members-count {
    font-weight: 500;
}

.dm-members-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.5rem;
    overflow: auto;
    max-height: 14rem;
}

.dm-members-table {
    margin: 0;
}

.dm-members-table th,
.dm-members-table td {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
}

.dm-members-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.4rem;
    border-radius: 0.28rem;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #475569;
    font-size: 0.7rem;
    font-weight: 550;
}

.dm-members-role-badge--owner {
    background: #fff1f2;
    border-color: rgba(225, 29, 72, 0.28);
    color: #9f1239;
}

.dm-members-role-badge--pending {
    background: #fff7ed;
    border-color: rgba(251, 146, 60, 0.35);
    color: #c2410c;
}

.dm-members-table .dm-select {
    min-height: 1.7rem;
    height: 1.7rem;
    padding: 0.1rem 1.4rem 0.1rem 0.4rem;
    font-size: 0.75rem;
}

.dm-btn--sm {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    min-height: 0;
}

/* —— 缺陷管理专用危险确认对话框（不影响工作台 / CM） —— */
.dm-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(ellipse 65% 45% at 50% 35%, rgba(251, 113, 133, 0.16), transparent 62%),
        rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.dm-dialog-mask.is-hidden {
    display: none !important;
}
.dm-dialog {
    position: relative;
    width: min(420px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(251, 113, 133, 0.36);
    background: linear-gradient(165deg, #fffaf8 0%, #ffffff 52%, #fff5f5 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 28px 60px -18px rgba(136, 19, 55, 0.28);
    overflow: hidden;
    padding: 1.15rem 1.15rem 1rem;
}
.dm-dialog__glow {
    position: absolute;
    top: -42%;
    right: 8%;
    width: 55%;
    height: 70%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(254, 205, 211, 0.55), transparent 68%);
    filter: blur(18px);
}
.dm-dialog__head,
.dm-dialog__body,
.dm-dialog__actions {
    position: relative;
    z-index: 1;
}
.dm-dialog__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.55rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #9f1239;
    background: rgba(255, 228, 230, 0.95);
    border: 1px solid rgba(251, 113, 133, 0.35);
}
.dm-dialog__badge-icon {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
}
.dm-dialog__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
}
.dm-dialog__desc {
    margin: 0.55rem 0 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #475569;
}
.dm-dialog__desc.is-hidden,
.dm-dialog__meta.is-hidden {
    display: none !important;
}
.dm-dialog__meta {
    margin-top: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.55rem;
    background: rgba(255, 241, 242, 0.9);
    border: 1px solid rgba(251, 113, 133, 0.22);
    font-size: 0.8125rem;
    color: #881337;
    word-break: break-word;
}
.dm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.1rem;
}
.dm-dialog--danger #dm-dialog-ok {
    background: linear-gradient(180deg, #fb7185, #e11d48);
    border-color: rgba(190, 18, 60, 0.55);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(225, 29, 72, 0.7);
}
.dm-dialog--danger #dm-dialog-ok:hover {
    filter: brightness(1.04);
}
.dm-dialog--danger #dm-dialog-ok:focus-visible {
    outline: 2px solid rgba(225, 29, 72, 0.45);
    outline-offset: 2px;
}
