/* ============================================================
   memory-concepts.css — 刀 B-C3：概念工作台（静态壳）
   概念稿 §21.5 / 主线稿 §5.11

   ⚠️ 当前阶段（2026-08-01）：**生产 UI 已挂载 fixture 静态壳**
      （记忆索引台第 4 个 tab）。但边界未松：仍不接真实 route、
      不读概念 service、不接 reader 上下文、不消费 ambiguousAlias，
      数据全部来自注入的 fixture 适配器（见 memory-concepts.js 顶部）。

   规则（沿用 memory-desk.css 的既有约束）：
   - 所有类名 mconcept- 前缀，样式独立维护在本文件；
     style.css 本轮**只**删除了已废弃的旧 Memory Chain `.mc-*` 规则
   - AZOTH 真实主题变量集是 --bg / --text / --card-bg / --accent / --highlight / --shadow；
     --text-primary/--text-secondary/--border 任何主题都没定义。
   - 主文字一律继承 body（主题必然正确），次级文字用 opacity 弱化**不锁颜色**——
     fallback 写错比不写更糟（v1 暗色 fallback 在墟构白底上糊成浅灰的教训）。
   - 🔴 审美红线：**彩色左边条卡片全域禁用**。状态用小圆点 + 文字，不用色条。
   ============================================================ */

.mconcept-root {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.55;
}

/* ---- 二级页签：概念 / 待确认 / 处理记录 ---- */
.mconcept-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    padding: 0;
    border-bottom: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
    flex: 0 0 auto;
}

.mconcept-tab {
    appearance: none;
    background: none;
    border: none;
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    color: inherit;
    opacity: 0.55;
    font-size: 14px;
    letter-spacing: 0.02em;
    touch-action: manipulation;
}

.mconcept-tab:hover { opacity: 0.8; }

.mconcept-tab.is-active {
    opacity: 1;
    background: rgba(var(--accent-rgb, 93, 105, 115), 0.09);
    box-shadow: inset 0 -2px 0 var(--accent, #5D6973);
}

.mconcept-tab-badge {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

/* ---- 三栏：列表 / 详情 / 抽屉 ---- */
.mconcept-body {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 12px;
}

.mconcept-pane {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mconcept-pane-list {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}

/* ---- 列表侧 ---- */
.mconcept-listhead {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.mconcept-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.22);
    background: var(--card-bg, #fff);
    color: inherit;
    font-size: 13px;
}

.mconcept-search::placeholder { color: inherit; opacity: 0.4; }

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

.mconcept-chip {
    appearance: none;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.22);
    background: none;
    color: inherit;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    opacity: 0.6;
    cursor: pointer;
    touch-action: manipulation;
}

.mconcept-chip.is-active {
    opacity: 1;
    background: rgba(var(--accent-rgb, 93, 105, 115), 0.12);
    border-color: rgba(var(--accent-rgb, 93, 105, 115), 0.4);
}

.mconcept-btn {
    appearance: none;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.3);
    background: var(--card-bg, #fff);
    color: inherit;
    border-radius: 999px;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    touch-action: manipulation;
}

.mconcept-btn:hover { background: rgba(var(--accent-rgb, 93, 105, 115), 0.08); }
.mconcept-btn[disabled] { opacity: 0.4; cursor: default; }
.mconcept-btn-primary { border-color: var(--accent, #5D6973); }
.mconcept-btn-quiet { background: transparent; }
.mconcept-btn-danger { border-color: rgba(150, 45, 45, 0.55); }

/* 🔴 没有彩色左边条。整卡一个边框，状态靠圆点。 */
.mconcept-item {
    display: block;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    padding: 13px 14px;
    margin-bottom: 8px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.mconcept-item:hover { border-color: rgba(var(--accent-rgb, 93, 105, 115), 0.36); }

.mconcept-item.is-selected {
    border-color: var(--accent, #5D6973);
    box-shadow: 0 0 0 1px var(--accent, #5D6973) inset;
}

.mconcept-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mconcept-item-name {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
}

.mconcept-item-sense {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    opacity: 0.62;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mconcept-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 11.5px;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}

.mconcept-item-meta > span:last-child {
    margin-left: auto;
    white-space: nowrap;
}

/* 状态点：只用透明度与形状区分，不引入第二套色板 */
.mconcept-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
    transform: translateY(-1px);
}

.mconcept-dot.is-active { opacity: 0.85; }
.mconcept-dot.is-candidate { opacity: 0.45; }
.mconcept-dot.is-stale { opacity: 0.85; border-radius: 1px; }   /* 方点 = 需更新 */
.mconcept-dot.is-hidden { opacity: 0.28; }
.mconcept-dot.is-frozen { opacity: 0.7; border: 1px solid currentColor; background: transparent; }

.mconcept-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
    font-size: 11px;
    opacity: 0.75;
}

/* ---- 详情侧 ---- */
.mconcept-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
}

.mconcept-title {
    font-size: 19px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.01em;
}

.mconcept-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}

.mconcept-detail-head > .mconcept-actions {
    width: 100%;
    margin-left: 0;
    padding-top: 4px;
}

.mconcept-section { margin-top: 18px; }

.mconcept-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mconcept-note {
    font-size: 12px;
    opacity: 0.55;
    font-weight: 400;
}

/* 「系统整理，不是原话」——这条标识不允许被样式弱化到看不见 */
.mconcept-derived-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px dashed rgba(var(--accent-rgb, 93, 105, 115), 0.5);
    font-size: 11px;
    opacity: 0.85;
}

.mconcept-prose {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
    border-radius: 10px;
    padding: 12px 14px;
    white-space: pre-wrap;
}

.mconcept-prose.is-empty { opacity: 0.5; font-style: italic; }
/* 定义修订候选：「现在」一段淡一档，「改成」保持正文色 */
.mconcept-revision-before { opacity: 0.62; }

.mconcept-sense {
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--card-bg, #fff);
}

.mconcept-sense-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mconcept-member {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.14);
    border-radius: 9px;
    margin-bottom: 6px;
    background: var(--card-bg, #fff);
}

.mconcept-member-main { flex: 1 1 auto; min-width: 0; }

/* 相关记忆收起 / 展开：整行宽的轻按钮，接在露出的几组下面 */
.mconcept-members-toggle {
    display: block;
    width: 100%;
    margin-top: 2px;
    text-align: center;
    opacity: 0.75;
}

.mconcept-member-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
}

.mconcept-member-summary {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.45;
}

.mconcept-member-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.mconcept-group-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0 0 3px;
    font: 600 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
    opacity: 0.62;
    cursor: pointer;
    word-break: break-all;
    text-align: left;
}

.mconcept-group-link:hover { opacity: 1; text-decoration: underline; }

.mconcept-tool-panel { margin: 10px 0 4px; }
.mconcept-resummary-targets { display: grid; gap: 6px; margin: 9px 0; }
.mconcept-resummary-targets.is-disabled { opacity: 0.55; }
.mconcept-check { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.mconcept-check-inline { margin: 9px 0; }
.mconcept-version { padding: 10px 0; border-top: 1px dashed rgba(var(--accent-rgb, 93, 105, 115), 0.2); }
.mconcept-version:first-of-type { border-top: 0; }

.mconcept-member-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    font-size: 11.5px;
    opacity: 0.55;
}

.mconcept-member-footer .mconcept-member-meta { margin-top: 0; }

/* 反例区不允许折叠进「更多」——否则概念卡只积累支持不积累修正 */
.mconcept-counter {
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.3);
    border-radius: 10px;
    padding: 10px 12px;
}

.mconcept-empty {
    padding: 26px 16px;
    text-align: center;
    opacity: 0.55;
    font-size: 13px;
}

.mconcept-empty-hint { margin-top: 6px; font-size: 12px; opacity: 0.8; }

/* 静态壳横幅：真接线之前必须一眼看出来这不是真数据 */
.mconcept-shellbar {
    flex: 0 0 auto;
    margin-bottom: 10px;
    padding: 7px 11px;
    border: 1px dashed rgba(var(--accent-rgb, 93, 105, 115), 0.5);
    border-radius: 8px;
    font-size: 12px;
    opacity: 0.8;
}

/* ---- 当前视角条（B-C3 接线）----
   🔴 这里**只显示视角**，绝不显示「另有 N 个含义不可见」：
   §21.5 性质 3 硬规则，服务端也不返回那类计数（双保险）。 */
.mconcept-readerbar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.16);
    border-radius: 12px;
    background: var(--card-bg, #fff);
    font-size: 13px;
}

.mconcept-readerbar.is-empty { display: none; }
.mconcept-pending-notice {
    margin-bottom: 8px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px dashed rgba(var(--accent-rgb, 93, 105, 115), 0.45);
    font-size: 12.5px;
    opacity: 0.9;
}

/* ---- 人工治理表单（B-C3 完整接线）---- */
.mconcept-form {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
    border-radius: 10px;
    background: var(--card-bg, #fff);
}

.mconcept-field { margin-bottom: 10px; }

/* 「移到哪个含义」只在选了 move 时才出现；用 class 切换，别把可见性写进内联 style */
.mconcept-field.is-hidden { display: none; }

/* 🔴 多行聚合页的 scope 选择器（哥哥 delta7-P1-3）：
   页级动作（改名 / 隐藏 / 新增含义）必须先指明作用在哪一行。单行页不渲染它。 */
.mconcept-scopepick {
    width: 100%;
    margin: 8px 0 2px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed rgba(var(--accent-rgb, 93, 105, 115), 0.32);
}

.mconcept-scopepick .mconcept-input { max-width: 420px; }

.mconcept-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    opacity: 0.7;
}

.mconcept-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.22);
    background: var(--bg, #fff);
    color: inherit;
    font-size: 13px;
    font-family: inherit;
}

textarea.mconcept-input { min-height: 4.5em; resize: vertical; }

.mconcept-attach-list { margin-top: 8px; max-height: 260px; overflow-y: auto; }

.mconcept-readerbar-kicker {
    font-size: 11px;
    letter-spacing: 0.08em;
    opacity: 0.5;
}

.mconcept-readerbar-label {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb, 93, 105, 115), 0.09);
    font-weight: 600;
}

.mconcept-space-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    font-size: 12px;
    opacity: 0.85;
}

.mconcept-readerbar-space {
    /* 🔴 塔拉真机反馈：原来这个 select 又宽又丑、还把裸 key 摊在一行上。
       限宽 + 省略号，配合服务端给的人话名字，让它读起来像个筛选器而不是一段 id。 */
    appearance: none;
    max-width: 18em;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
    background: var(--card-bg, #fff);
    color: inherit;
    border-radius: 8px;
    min-height: 34px;
    padding: 5px 26px 5px 10px;
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    cursor: pointer;
    touch-action: manipulation;
    /* 自绘小箭头（appearance:none 之后原生箭头没了） */
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 13px) center, calc(100% - 9px) center;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}

.mconcept-readerbar-space:hover { border-color: rgba(var(--accent-rgb, 93, 105, 115), 0.5); }

/* 多条总体定义时，每条自己的来源标签行 */
.mconcept-defscope {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0 6px;
}

.mconcept-defscope:first-child { margin-top: 0; }

.mconcept-form-title {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.mconcept-attach-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
}

.mconcept-input-compact { min-width: 0; }

/* 与记忆工作台同型：背景遮罩 + 底部抽屉；桌面端居中。 */
.mconcept-drawer {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.mconcept-root.is-detail .mconcept-drawer { display: flex; }

.mconcept-pane-detail {
    position: relative;
    display: block;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    background: var(--bg, #fff);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.18);
}

.mconcept-drawer-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    margin-bottom: 8px;
    background: var(--bg, #fff);
}

.mconcept-drawer-close,
.mconcept-drawer-save {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
    border-radius: 8px;
    background: var(--bg, #fff);
    color: inherit;
    cursor: pointer;
}

.mconcept-drawer-save:disabled { opacity: 0.38; cursor: default; }
.mconcept-drawer-toolbar > .mconcept-note { margin-right: auto; }

.mconcept-record-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
    padding: 4px;
    gap: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.12);
    border-radius: 14px;
    background: rgba(var(--accent-rgb, 93, 105, 115), 0.045);
}
.mconcept-record-tabs .mconcept-tab { border-radius: 10px; opacity: 0.72; }
.mconcept-record-tabs .mconcept-tab.is-active {
    background: var(--card-bg, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-weight: 600;
    opacity: 1;
}
.mconcept-record-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mconcept-record-heading .mconcept-section-title { margin: 0; font-size: 15px; opacity: 1; }
.mconcept-record-heading .infolayer-info-btn { width: 36px; height: 36px; font: italic 16px Georgia, serif; opacity: 0.7; }
.mconcept-root .infolayer-info { margin-bottom: 16px; line-height: 1.8; }
.mconcept-run {
    display: flex; flex-direction: column; gap: 7px;
    width: 100%; padding: 16px; margin-bottom: 10px; text-align: left;
    color: inherit; background: var(--card-bg, #fff); font: inherit;
    border: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.14); border-radius: 14px;
    cursor: pointer; overflow-wrap: anywhere;
}
.mconcept-run .mconcept-note { opacity: 0.7; font-variant-numeric: tabular-nums; }
.mconcept-run:hover { border-color: rgba(var(--accent-rgb, 93, 105, 115), 0.4); }
.mconcept-root .mconcept-run-pager { width: 100%; display: flex; align-items: center; justify-content: space-between; margin: 18px 0 0; }
.mconcept-pending-card, .mconcept-legacy-list .mconcept-member { padding: 16px; margin-bottom: 12px; border-radius: 14px; gap: 14px; }
.mconcept-pending-card { flex-wrap: wrap; }
.mconcept-pending-card > .mconcept-member-main { flex-basis: 100%; }
.mconcept-pending-card .mconcept-member-summary, .mconcept-legacy-list .mconcept-member-summary { font-size: 16px; font-weight: 600; }
.mconcept-pending-card .mconcept-member-meta { display: grid; gap: 9px; margin-top: 8px; font-size: 13px; line-height: 1.7; opacity: 0.72; }
.mconcept-pending-card .mconcept-actions { margin: 0; width: 100%; flex-wrap: wrap; }
.mconcept-root .mconcept-association-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.mconcept-association-actions > .mconcept-note { grid-column: 1 / -1; opacity: 0.8; overflow-wrap: anywhere; }
.mconcept-association-actions > .mconcept-note:empty { display: none; }
.mconcept-pending-card .mconcept-btn, .mconcept-legacy-list .mconcept-btn, .mconcept-run-pager .mconcept-btn { min-height: 42px; padding: 9px 14px; border-radius: 10px; }
.mconcept-root button:focus-visible { outline: 2px solid var(--accent, #5D6973); outline-offset: 3px; }
.mconcept-form { padding: 18px; border-radius: 14px; }
.mconcept-field { margin-bottom: 16px; }
.mconcept-field-label { margin-bottom: 7px; font-size: 13px; opacity: 0.8; }
.mconcept-input { min-height: 42px; padding: 10px 12px; }
.mconcept-evidence { padding: 12px 0; overflow-wrap: anywhere; }
.mconcept-source-excerpt {
    white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh;
    overflow-y: auto; margin: 12px 0; padding: 12px; background: var(--bg, #fff);
}
.mconcept-form, .mconcept-field { min-width: 0; }
.mconcept-form .mconcept-actions { flex-wrap: wrap; }

/* ---- 窄屏：不并排，逐层推入 ---- */
@media (max-width: 780px) {
    .mconcept-readerbar { align-items: stretch; }
    .mconcept-readerbar-kicker { align-self: center; }
    .mconcept-space-filter { width: 100%; margin-left: 0; }
    .mconcept-readerbar-space { flex: 1 1 auto; max-width: none; }
    .mconcept-attach-filters { grid-template-columns: 1fr; gap: 0; }
    .mconcept-pane-detail { padding: 15px 14px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .mconcept-actions { margin-left: 0; width: 100%; }
    .mconcept-actions .mconcept-btn { flex: 0 0 auto; }
    .mconcept-member { flex-wrap: wrap; padding: 10px; }
    .mconcept-member-actions { width: 100%; padding-left: 19px; }
    .mconcept-member-footer .mconcept-member-actions { width: auto; padding-left: 0; }
    .mconcept-section-title .mconcept-btn { flex: 0 0 auto; }
}

@media (min-width: 720px) {
    .mconcept-drawer { align-items: center; padding: 24px; }
    .mconcept-pane-detail {
        max-height: 84vh;
        border-bottom: 1px solid rgba(var(--accent-rgb, 93, 105, 115), 0.28);
        border-radius: 16px;
    }
}
