* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #fafaf9;
    --bg-pure: #ffffff;
    --bg-2: #f5f5f4;
    --text: #0c0a09;
    --text-2: #44403c;
    --text-3: #a8a29e;
    --line: #e7e5e4;
    --line-2: #d6d3d1;
    --primary: #f97316;
    --primary-2: #ea580c;
    --accent: #ec4899;
    --green: #10b981;
    --col1: 240px;
    --col2: 420px;
    --col4: 280px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px -10px rgba(0,0,0,0.15), 0 4px 12px -4px rgba(0,0,0,0.08);
}
body {
    font-family: -apple-system, "Inter", "PingFang SC", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* ================= 顶栏 ================= */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: 48px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center;
    padding: 0 12px 0 20px;
    z-index: 100; gap: 16px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 14px;
    letter-spacing: -0.02em;
}
.brand-logo {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.brand-logo svg { width: 14px; height: 14px; }
.tabs { display: flex; gap: 1px; margin-left: 8px;
    background: var(--bg-2);
    padding: 3px;
    border-radius: 8px;
}
.tab {
    height: 28px; padding: 0 12px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 6px;
    color: var(--text-2);
    cursor: pointer;
    font-size: 12.5px; font-weight: 500;
    transition: all 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
    background: white;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 1px var(--line);
}
.tab svg { width: 13px; height: 13px; }
.tab .badge {
    background: var(--primary);
    color: white;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 100px;
    font-weight: 600;
    margin-left: 2px;
}

.topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    display: flex; align-items: center; gap: 5px;
    transition: all 0.15s;
    font-weight: 500;
}
.btn:hover { background: var(--bg-2); color: var(--text); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-primary {
    background: var(--text);
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover { background: #000; }
.btn-magic {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.btn-magic:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4); }
.btn svg { width: 13px; height: 13px; }
.kbd {
    display: inline-flex; align-items: center;
    font-size: 10px;
    background: rgba(0,0,0,0.06);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-family: ui-monospace, monospace;
    color: var(--text-2);
}

/* ================= 四列 ================= */
.app {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    display: grid;
    height: calc(100vh - 48px);
    grid-template-columns: var(--col1) 1px var(--col2) 1px 1fr 1px var(--col4);
}
.col { display: flex; flex-direction: column; overflow: hidden; }
.col-1 { background: var(--bg-pure); }
.col-2 { background: var(--bg-pure); }
.col-3 { background: var(--bg); }
.col-4 { background: var(--bg-pure); }
.line {
    background: transparent;
    width: 6px;
    cursor: col-resize;
    position: relative;
    transition: background 0.15s;
}
.line:hover,
.line.dragging { background: var(--primary); }
.line::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 2px; height: 24px;
    background: var(--line-2);
    border-radius: 2px;
    pointer-events: none;
}
.line:hover::after,
.line.dragging::after { background: white; }

.col-head {
    height: 42px; padding: 0 16px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--line);
    font-size: 11px; font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.08em;
    flex-shrink: 0;
}
.col-head svg { width: 12px; height: 12px; stroke-width: 2.5; }
.col-head .count {
    color: var(--text-3);
    font-weight: 500;
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.col-head .action {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
}
.col-head .action:hover { background: var(--bg-2); color: var(--text); }
.col-head .action svg { width: 12px; height: 12px; }
.col-body { flex: 1; overflow-y: auto; padding-left: 12px; }

/* ================= 分类 ================= */
.cat-group { padding: 8px 0; }
.cat-section {
    padding: 10px 16px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 700;
    display: flex; align-items: center; justify-content: space-between;
}
.cat-section button {
    width: 18px; height: 18px;
    border: none; background: transparent;
    color: var(--text-3);
    cursor: pointer;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
}
.cat-section button:hover { background: var(--bg-2); color: var(--text); }
.cat-section button svg { width: 11px; height: 11px; stroke-width: 2.5; }

.cat-item {
    margin: 0 8px;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all 0.12s;
    position: relative;
}
.cat-item:hover { background: var(--bg-2); }
.cat-item.active {
    background: var(--text);
    color: white;
}
.cat-item.active .ic { color: white; }
.cat-item.active .num { color: rgba(255,255,255,0.6); }
.cat-item .ic {
    width: 14px; height: 14px;
    color: var(--text-2);
    flex-shrink: 0;
    transition: color 0.12s;
}
.cat-item .name { flex: 1; font-weight: 500; }
.cat-item .num { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-item .caret { color: var(--text-3); width: 10px; height: 10px; stroke-width: 3; }
.cat-item.active .caret { color: rgba(255,255,255,0.6); }
.cat-children { margin-left: 14px; padding-left: 8px; border-left: 1px solid var(--line); }

.cat-add {
    margin: 8px 12px;
    height: 30px;
    border: 1px dashed var(--line-2);
    background: transparent;
    border-radius: 6px;
    color: var(--text-3);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    transition: all 0.15s;
    font-weight: 500;
}
.cat-add:hover { border-color: var(--primary); color: var(--primary); background: var(--bg); }
.cat-add svg { width: 12px; height: 12px; stroke-width: 2.5; }

/* ================= 列表 ================= */
.search-bar {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}
.search-wrap { position: relative; }
.search-wrap svg {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    width: 13px; height: 13px;
    color: var(--text-3);
    pointer-events: none;
}
.search-input {
    width: 100%;
    height: 30px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 10px 0 32px;
    font-size: 12.5px;
    color: var(--text);
    font-family: inherit;
    transition: all 0.15s;
}
.search-input:focus { outline: none; background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
.search-input::placeholder { color: var(--text-3); }

.filter-row {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 4px;
    font-size: 11px;
    flex-wrap: wrap;
}
.filter-pill {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px 0 10px;
    border-radius: 100px;
    background: var(--text);
    color: white;
    font-size: 11px;
    font-weight: 500;
}
.filter-pill .x {
    width: 14px; height: 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.filter-pill .x:hover { background: rgba(255,255,255,0.3); }
.filter-log {
    color: var(--text-3);
    font-size: 10px;
    margin-left: auto;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.filter-add {
    height: 22px; padding: 0 8px;
    background: transparent;
    border: 1px dashed var(--line-2);
    color: var(--text-3);
    border-radius: 100px;
    font-size: 10.5px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.filter-add:hover { border-color: var(--primary); color: var(--primary); }

.list-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
}
.list-item:hover { background: var(--bg); }
.list-item.active { background: var(--bg); }
.list-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.list-item-title {
    font-size: 13px; font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.35;
    color: var(--text);
}
.list-item-sub {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}
.list-item-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.list-item-time {
    margin-left: auto;
    color: var(--text-3);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

/* ================= 主区 ================= */
.detail { padding: 36px 48px 60px; max-width: 760px; }

.detail-meta-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.detail-meta-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.detail-title {
    font-size: 34px; font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--text);
    background: linear-gradient(180deg, var(--text) 0%, #292524 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.detail-summary {
    display: flex; gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff7ed 0%, #fdf2f8 100%);
    border: 1px solid #fed7aa;
    border-radius: 8px;
    margin-bottom: 32px;
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.55;
    position: relative;
    overflow: hidden;
}
.detail-summary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.detail-summary-ic {
    width: 18px; height: 18px;
    color: var(--primary-2);
    flex-shrink: 0;
    margin-top: 1px;
    stroke-width: 2;
}

.detail-content {
    font-size: 15px; line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 32px;
    font-weight: 400;
}
.detail-content.collapsed {
    max-height: 280px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.expand-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 auto 32px;
    height: 30px;
    padding: 0 14px;
    background: var(--bg-pure);
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
}
.expand-btn:hover { border-color: var(--text); color: var(--text); }
.expand-btn svg { width: 12px; height: 12px; stroke-width: 2.5; }

/* section */
.section { margin-bottom: 36px; }
.section-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 700;
}
.section-head svg { width: 13px; height: 13px; stroke-width: 2.5; }
.section-head .label-count {
    background: var(--bg-2);
    color: var(--text-2);
    padding: 1px 7px;
    border-radius: 100px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.section-head .action {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-head .action:hover { color: var(--text); }
.section-head .action svg { width: 12px; height: 12px; stroke-width: 2.5; }

/* 关联卡片 - 重设计 */
    font-size: 10px;
    text-transform: uppercase;
    margin-right: 4px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* 关联图 */
.graph {
    background: var(--bg-pure);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
}
.graph-tools {
    position: absolute;
    top: 12px; right: 12px;
    display: flex; gap: 2px;
    background: var(--bg-2);
    padding: 2px;
    border-radius: 6px;
}
.gt {
    width: 24px; height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.12s;
}
.gt:hover { background: white; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.gt svg { width: 12px; height: 12px; stroke-width: 2.5; }
.graph-svg { width: 100%; height: 300px; display: block; }
.graph-legend {
    display: flex; gap: 18px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px dashed var(--line);
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
}
.ld { display: flex; align-items: center; gap: 6px; }
.ld-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}
.ld-dot.cur {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}
.ld-dot.rel { background: var(--bg-pure); border: 2px solid var(--primary); }

/* ================= 旁支 ================= */
.side { padding: 14px; }
.side-section {
    margin-bottom: 20px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.side-section.featured {
    background: linear-gradient(135deg, #fff7ed 0%, #fdf2f8 100%);
    border-color: #fed7aa;
}
.side-head {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex; align-items: center; justify-content: space-between;
}
.side-head button {
    background: none; border: none;
    color: var(--text-3);
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}
.side-head button:hover { color: var(--text); }
.side-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.stag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 10px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
}
.stag:hover { border-color: var(--text); }
.stag .x {
    width: 14px; height: 14px;
    background: var(--bg-2);
    color: var(--text-3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    margin-left: 2px;
}
.stag .x:hover { background: #fecaca; color: #dc2626; }
.stag.ai {
    background: transparent;
    color: var(--text-2);
    border-style: dashed;
}
.stag-add {
    height: 24px; padding: 0 10px;
    background: transparent;
    border: 1px dashed var(--line-2);
    color: var(--text-3);
    border-radius: 100px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 3px;
    font-weight: 500;
}
.stag-add:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }
.meta-row {
    display: flex; justify-content: space-between;
    padding: 5px 0;
    font-size: 12px;
}
.meta-key { color: var(--text-3); font-weight: 500; }
.meta-val { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
.meta-val.highlight { color: var(--primary-2); font-weight: 700; }

.progress-bar {
    height: 6px;
    background: var(--bg-2);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 100px;
    width: 85%;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 标注 */
.label {
    position: fixed;
    bottom: 20px; right: 20px;
    background: var(--text);
    color: white;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    z-index: 200;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
}
/* ========== 多级分类树（递归） ========== */
.cat-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin:0 6px 0 2px; flex-shrink:0; }
.cat-item.cat-depth-0 { font-weight: 600; }
.cat-item.cat-depth-1 { font-weight: 500; }
.cat-item.cat-depth-2 { font-weight: 400; color: var(--text-2); }
.cat-item.cat-depth-3 { font-weight: 400; color: var(--text-3); font-size: 12px; }
.cat-item .ic { transition: transform 0.15s; }

/* ========== 标签库 多级树 ========== */
.tags-tree { font-size: 14px; }
.tag-tree-row { border-radius: 6px; }
.tag-tree-row:hover { background: var(--bg-2, #f5f5f7); }
.tag-tree-main {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; cursor: pointer; user-select: none;
    border-bottom: 1px solid var(--bg-2, #f0f0f0);
}
.tag-tree-main .ic { width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; color: var(--text-3); }
.tag-tree-main .cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tag-tree-main .name { flex: 1; }
.tag-tree-main .tag-path { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.tag-tree-main .num { background: var(--bg-2, #f0f0f0); padding: 1px 8px; border-radius: 100px; font-size: 11px; color: var(--text-2); }
/* 深度颜色梯度 */
.tag-tree-row.cat-depth-0 .name { font-weight: 600; font-size: 15px; }
.tag-tree-row.cat-depth-1 .name { font-weight: 500; }
.tag-tree-row.cat-depth-2 .name { font-weight: 400; color: var(--text-2); }
.tag-tree-row.cat-depth-3 .name { font-weight: 400; color: var(--text-3); font-size: 13px; }

/* ========== 标签云 v3 极简版 ========== */

/* === 顶部 tab 切换 === */
.col1-tabs {
    display: flex;
    background: var(--bg-2);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
}
.col1-tab {
    flex: 1;
    padding: 6px 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    cursor: pointer;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.12s;
    user-select: none;
}
.col1-tab:hover { color: var(--text-2); }
.col1-tab.active {
    background: white;
    color: var(--text);
    box-shadow: var(--shadow);
}

/* === 搜索框 === */
.tag-search {
    position: relative;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    height: 34px;
    background: var(--bg-2);
    border-radius: 8px;
    padding: 0 6px 0 10px;
    transition: all 0.12s;
    border: 1px solid transparent;
}
.tag-search:focus-within {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.tag-search input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 4px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 13px;
    outline: none;
    color: var(--text);
}
.tag-search input::placeholder { color: var(--text-3); }
#tag-search-go {
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    color: #a8a29e;
    transition: all 0.12s;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    flex-shrink: 0;
}
#tag-search-go:hover {
    background: var(--line);
    color: #57534e;
}
.tag-search .ic-search {
    width: 14px; height: 14px;
    color: var(--text-3);
    flex-shrink: 0;
    margin-right: 4px;
}
.tag-search .ic-clear {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--line-2);
    color: white;
    font-size: 11px;
    line-height: 1;
    display: none;  /* JS 控 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;
}
.tag-search.has-value .ic-clear { display: flex; }
.tag-search .ic-clear:hover { background: var(--text-3); }

/* === 已选标签区（紧凑横排） === */
.selected-section {
    margin-bottom: 16px;
}
.selected-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 0 2px;
}
.selected-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 6px;
}
.selected-section-label .count {
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 0 5px;
    border-radius: 100px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    letter-spacing: 0;
}
.selected-section-label .count.empty { background: var(--line-2); }

.logic-toggle {
    display: flex;
    background: var(--bg-2);
    border-radius: 6px;
    padding: 2px;
    font-size: 10.5px;
}
.logic-toggle button {
    border: none;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.12s;
}
.logic-toggle button.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 4px 0 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--primary);
    color: white;
    font-weight: 500;
}
.selected-chip .x {
    width: 16px; height: 16px;
    display: inline-flex; align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    transition: background 0.1s;
}
.selected-chip .x:hover { background: rgba(255,255,255,0.4); }

/* 空状态 */
.empty-selected {
    color: var(--text-3);
    font-size: 11.5px;
    padding: 10px 0 4px;
    font-style: italic;
}

/* col-3 笔记详情区空状态（选一条看看） */
.empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%;
    color: var(--text-3);
    user-select: none;
}
.empty-icon { margin-bottom: 16px; }
.empty-icon svg {
    width: 64px; height: 64px;
    opacity: 0.25;
    display: block;
}
.empty-title { font-size: 14px; font-weight: 500; color: #44403c; }
.empty-sub { font-size: 12px; margin-top: 4px; opacity: 0.7; }

/* === 标签列表 === */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}
.tag-list-empty {
    color: var(--text-3);
    font-size: 12px;
    padding: 12px;
    text-align: center;
    background: var(--bg-2);
    border-radius: 8px;
}
.section-title {
    font-size: 10.5px;
    color: var(--text-3);
    margin: 14px 0 6px;
    padding: 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title .label-text {
    display: inline-flex; align-items: center; gap: 5px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    border-radius: 13px;
    font-size: 12px;
    background: white;
    border: 1px solid var(--line);
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
    transition: all 0.12s;
    font-weight: 500;
}
.chip:hover {
    border-color: var(--line-2);
    color: var(--text);
    background: var(--bg-2);
}
.chip .dot {
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}
.chip .count {
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 500;
    margin-left: 1px;
}
.chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.chip.selected:hover {
    background: var(--primary-2);
    border-color: var(--primary-2);
    color: white;
}
.chip.selected .count { color: rgba(255,255,255,0.8); }
.chip.selected .dot { box-shadow: 0 0 0 1.5px white; }

/* === 底部操作 === */
.col1-actions {
    display: flex;
    gap: 4px;
    margin-top: 14px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}
.btn-link {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 11.5px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.12s;
}
.btn-link:hover { background: var(--bg-2); color: var(--text); }
.btn-link.primary { color: var(--primary); }
.btn-link.primary:hover { background: rgba(249,115,22,0.08); }

/* === 列表过滤条 === */
.col-filter-summary {
    padding: 8px 12px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.col-filter-summary .filter-icon { color: var(--primary); }

.filter-tag-chip {
    background: #0ea5e9; color: white;
    border-radius: 100px; padding: 0 6px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.filter-tag-chip:hover { background: #0284c7; }
.filter-tag-chip .x {
    display: inline-block;
    width: 14px; height: 14px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    text-align: center;
    line-height: 12px;
    font-size: 12px;
    cursor: pointer;
}
.filter-tag-chip .x:hover { background: white; color: #0ea5e9; }
.filter-clear-btn {
    margin-left: auto;
    height: 22px; padding: 0 10px;
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 100px;
    color: #0c4a6e;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.filter-clear-btn:hover { background: #e0f2fe; }

.col-filter-summary .filter-count {
    margin-left: auto;
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 500;
    background: white;
    padding: 1px 7px;
    border-radius: 100px;
    border: 1px solid var(--line);
}

/* === 新笔记列表（标签云模式） === */
.note-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.1s;
    margin-bottom: 0;
}
/* === note-item-del 跟系统 icon-btn 同款 === */


.note-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}
.note-item-body { flex: 1; min-width: 0; }
.note-item-cb {
    width: 16px; height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--line-2);
    flex-shrink: 0;
    margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    color: white;
    cursor: pointer;
    background: white;
    transition: all 0.1s;
}
.note-item-cb.on {
    background: var(--primary);
    border-color: var(--primary);
}
.note-item.select-mode { padding-left: 8px; }
.note-item.checked { background: rgba(249, 115, 22, 0.04); }
.note-item-del {
    position: absolute;
    top: 8px; right: 8px;
    width: 18px; height: 18px;
    border-radius: 4px;
    background: var(--bg-2);
    border: none;
    color: var(--text-3);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: all 0.1s;
    z-index: 2;
}
.note-item-del:hover { background: #fee2e2; color: #b91c1c; }

/* 顶栏管理按钮 */
.col-mgr-btn {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 11.5px;
    padding: 4px 10px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: auto;
    font-weight: 500;
    white-space: nowrap;
}
.col-mgr-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.col-mgr-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* 批量操作栏 */
.note-bulk-bar {
    display: none;
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--line);
    padding: 10px 12px;
    z-index: 5;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.note-bulk-bar.show { display: flex; }
.bulk-cnt {
    font-size: 12px;
    color: var(--text-2);
    margin-right: auto;
}
.bulk-cnt b { color: var(--primary); font-size: 14px; }
.bulk-btn {
    background: white;
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 11.5px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
.bulk-btn:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.bulk-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bulk-btn.danger { color: #b91c1c; border-color: #fecaca; }
.bulk-btn.danger:hover:not(:disabled) { background: #fee2e2; border-color: #fca5a5; }
.bulk-btn.ghost { color: var(--text-3); }

.note-item:hover .note-item-del, .list-item:hover 


.note-item:hover { background: var(--bg-2); }
.note-item.active {
    background: rgba(249, 115, 22, 0.06);
    border-left: 3px solid var(--primary);
    padding-left: 9px;
}
.note-item-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    color: var(--text);
    line-height: 1.4;
}
.note-item-meta {
    font-size: 10.5px;
    color: var(--text-3);
    display: flex;
    gap: 5px;
    align-items: center;
}
.note-item-tags {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 5px;
}
.note-item-tag {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 100px;
    background: var(--bg-2);
    color: var(--text-2);
}
.note-item-tag.matched {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    font-weight: 600;
}/* === 列表过滤条 === */
.col-filter-summary {
    padding: 8px 12px;
    background: #f0f9ff;
    border-bottom: 1px solid #e8e8ed;
    font-size: 12px;
    color: #0c4a6e;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.col-filter-summary .filter-icon { font-size: 13px; }
.col-filter-summary .filter-tag-chip {
    background: #0ea5e9; color: white;
    border-radius: 100px; padding: 0 6px;
    font-size: 10px; font-weight: 500;
}
.col-filter-summary .filter-count {
    background: rgba(14,165,233,0.15); color: #0c4a6e;
    border-radius: 100px; padding: 0 6px;
    font-size: 10px; margin-left: auto;
    font-weight: 600;
}

/* === 新笔记列表（label云模式） === */
.note-item { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.1s; }
.note-item:hover { background: #fafafa; }
.note-item.active { background: #fff7ed; border-left: 3px solid #f97316; padding-left: 9px; }
.note-item-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; color: #1d1d1f; line-height: 1.4; }
.note-item-meta { font-size: 10px; color: #6e6e73; display: flex; gap: 4px; align-items: center; }
.note-item-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.note-item-tag {
    font-size: 10px; padding: 1px 6px; border-radius: 100px;
    background: #f5f5f7; color: #1d1d1f;
}
.note-item-tag.matched {
    background: #fff7ed; color: #c2410c;
    font-weight: 600; border: 1px solid #fed7aa;
}


/* === 标签树（VSCode 风格虚线） === */
.tag-tree {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 8px;
}
.tag-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 8px 0 0;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #44403c;
    transition: background 0.1s;
    font-weight: 500;
}

/* === AI 标签治理: candidate / max-depth 视觉 === */
.tag-row.is-candidate { opacity: 0.6; }
.tag-row.is-candidate .name { color: var(--text-2); font-style: italic; }
.tag-row.is-candidate .count { color: var(--primary); font-weight: 600; }
.tag-status-badge.candidate { color: #f97316; font-size: 11px; margin-left: 4px; }
.tag-row.is-candidate:hover { opacity: 0.9; background: #fff7ed; }

.tag-row.is-max-depth { opacity: 0.7; border-left: 2px solid #ef4444; padding-left: 8px !important; }
.tag-row.is-max-depth .name { color: #b91c1c; font-style: italic; }
.tag-status-badge.max-depth { color: #ef4444; font-size: 11px; margin-left: 4px; font-weight: 700; }
.tag-row:hover { background: #fafaf9; }
.tag-row .name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tag-row .count {
    color: #a8a29e;
    font-size: 10.5px;
    font-weight: 500;
    background: #fafaf9;
    padding: 1px 6px;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}
/* icon */
.tag-row .tag-folder {
    width: 13px;
    height: 13px;
    color: #a8a29e;
    flex-shrink: 0;
}
.tag-row .tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px white;
}

/* === 缩进 + 虚线（核心） === */
.tag-indent {
    display: inline-block;
    width: 14px;
    height: 100%;
    position: relative;
    flex-shrink: 0;
}
.tag-indent::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 50%;
    width: 0;
    border-left: 1px dashed #d6d3d1;
}
.tag-indent::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 0;
    border-top: 1px dashed #d6d3d1;
}

/* 顶级：粗体 + 文件夹深色 */
.tag-row.tag-d0 {
    font-weight: 600;
    font-size: 12.5px;
    color: #0c0a09;
}
.tag-row.tag-d0 .tag-folder { color: #44403c; }
.tag-row.tag-d0 .count {
    background: transparent;
    color: #a8a29e;
    font-size: 10.5px;
}

/* 二级：常规 */
.tag-row.tag-d1 {
    font-size: 12.5px;
    font-weight: 500;
}
/* 三级：浅色 + 圆点小 */
.tag-row.tag-d2 {
    font-size: 12px;
    font-weight: 400;
    color: #44403c;
}
.tag-row.tag-d2 .tag-dot { width: 7px; height: 7px; }
/* 4 级：再浅 */
.tag-row.tag-d3 {
    font-size: 11.5px;
    font-weight: 400;
    color: #6e6e73;
}
.tag-row.tag-d3 .tag-dot { width: 6px; height: 6px; opacity: 0.7; }

/* 选中态：橙色背景 */
.tag-row.selected {
    background: rgba(249, 115, 22, 0.1) !important;
    color: #c2410c;
}
.tag-row.selected .count {
    background: #f97316;
    color: white;
}
.tag-row.selected .tag-folder { color: #f97316; }
.tag-row.selected .tag-indent::before,
.tag-row.selected .tag-indent::after {
    border-color: #fed7aa;
}

/* === 标签库 tab 全屏管理界面 === */
.taglib {
    /* 改: 左 60% / 右 280px, 之前 1fr + 340px 比例失衡 */
    
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 56px - 48px);
    margin: -4px -16px 0;  /* 抵掉 view-pad padding */
}

/* 左侧主区 */
.taglib-main {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e7e5e4;
    overflow: hidden;
}
.taglib-head {
    padding: 14px 28px 14px 28px;
    border-bottom: 1px solid #e7e5e4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.taglib-title { font-size: 16px; font-weight: 600; }
.taglib-meta { font-size: 11.5px; color: #a8a29e; margin-top: 2px; }
.taglib-actions { display: flex; gap: 6px; }
.tl-btn {
    height: 30px; padding: 0 12px;
    background: white; border: 1px solid #e7e5e4;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    color: #44403c; cursor: pointer; font-family: inherit;
    transition: all 0.12s;
}
.tl-btn:hover { background: #fafaf9; }
.tl-btn.primary { background: #f97316; border-color: #f97316; color: white; }
.tl-btn.primary:hover { background: #ea580c; }

.taglib-search { padding: 10px 28px; background: #fafaf9; border-bottom: 1px solid #e7e5e4; }
.tl-search-wrap { position: relative; }
.tl-search-ic {
    position: absolute; left: 9px; top: 50%;
    transform: translateY(-50%);
    width: 13px; height: 13px;
    color: #a8a29e;
}
.tl-search-input {
    width: 100%; height: 30px; padding: 0 10px 0 30px;
    border: 1px solid #e7e5e4; border-radius: 7px;
    font-size: 12.5px; outline: none; background: white;
    font-family: inherit;
}
.tl-search-input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.08); }

.taglib-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 20px 28px;
}

.tl-group-head {
    font-size: 10.5px; color: #a8a29e;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600;
    padding: 6px 10px;
    background: #fafaf9;
    border-radius: 5px;
    margin-bottom: 6px;
}

.tl-row {
    position: relative;
}
.tl-row-main {
    display: flex; align-items: center; gap: 5px;
    height: 32px; padding: 0 8px 0 0;
    border-radius: 5px; cursor: pointer;
    user-select: none; font-size: 13px;
    color: #0c0a09; transition: background 0.1s;
}
.tl-row-main:hover { background: #fafaf9; }
.tl-row.active > .tl-row-main {
    background: rgba(249, 115, 22, 0.08) !important;
    color: #c2410c;
    font-weight: 500;
}
.tl-row .tl-folder { width: 14px; height: 14px; color: #a8a29e; flex-shrink: 0; }
.tl-row.tl-d0 .tl-folder { color: #44403c; }
.tl-row .tl-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; box-shadow: 0 0 0 1.5px white;
}
.tl-row .tl-indent { display: inline-block; height: 100%; flex-shrink: 0; }
.tl-row .tl-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row .tl-num {
    background: #fafaf9; color: #6e6e73;
    font-size: 10.5px; padding: 1px 6px; border-radius: 100px;
    font-weight: 500; min-width: 22px; text-align: center;
}
.tl-row.active .tl-num { background: #f97316; color: white; }
.tl-row .tl-add-btn {
    width: 18px; height: 18px; border-radius: 4px;
    background: transparent; border: 1px dashed #d6d3d1;
    color: #6e6e73; font-size: 12px; line-height: 1;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; flex-shrink: 0;
    font-family: inherit;
}
.tl-row:hover .tl-add-btn { display: flex; }
.tl-row .tl-add-btn:hover { background: #f97316; color: white; border-color: #f97316; }

/* 深度 */
.tl-row.tl-d0 .tl-row-main { font-weight: 600; font-size: 13.5px; }
.tl-row.tl-d1 .tl-row-main { font-size: 12.5px; }
.tl-row.tl-d2 .tl-row-main { font-size: 12px; color: #44403c; }
.tl-row.tl-d3 .tl-row-main { font-size: 11.5px; color: #6e6e73; }
.tl-row.tl-d3 .tl-dot { width: 6px; height: 6px; }

.tl-empty {
    color: #a8a29e; font-size: 13px; text-align: center;
    padding: 40px 20px;
}

/* === 右侧详情 === */
.taglib-aside {
    background: #fafaf9;
    overflow-y: auto;
}
.tl-detail-empty {
    height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #a8a29e; padding: 40px;
}
.tl-detail-empty-icon { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }
.tl-detail-empty-title { font-size: 14px; font-weight: 500; color: #44403c; }
.tl-detail-empty-sub { font-size: 12px; margin-top: 4px; }

.tl-detail { display: flex; flex-direction: column; }
.tl-detail-head {
    padding: 16px 18px;
    background: white;
    border-bottom: 1px solid #e7e5e4;
}
.tl-detail-name {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.tl-detail-dot {
    width: 12px; height: 12px; border-radius: 50%;
    box-shadow: 0 0 0 2px white, 0 0 0 3px #e7e5e4;
}
.tl-detail-sub { font-size: 11.5px; color: #a8a29e; margin-top: 4px; }

.tl-detail-body { padding: 16px 18px; }
.tl-section { margin-bottom: 20px; }
.tl-section:last-child { margin-bottom: 0; }
.tl-section-title {
    font-size: 10.5px; color: #a8a29e;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600; margin-bottom: 8px;
}

.tl-path-display {
    background: white; border: 1px solid #e7e5e4; border-radius: 6px;
    padding: 7px 10px; font-size: 11.5px;
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.tl-crumb {
    padding: 1px 6px; border-radius: 3px;
    background: #fafaf9; color: #44403c;
}
.tl-crumb.root { color: #44403c; }
.tl-crumb.current { background: rgba(249,115,22,0.1); color: #c2410c; font-weight: 500; }
.tl-sep { color: #a8a29e; font-size: 10px; }

.tl-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 12.5px;
}
.tl-stat-key { color: #6e6e73; }
.tl-stat-val { color: #0c0a09; font-weight: 500; }
.tl-stat-val.highlight { color: #f97316; }

.tl-note-list {
    background: white; border: 1px solid #e7e5e4; border-radius: 6px;
    max-height: 220px; overflow-y: auto;
}
.tl-note-item {
    padding: 7px 10px; font-size: 11.5px; color: #44403c;
    border-bottom: 1px solid #f5f5f4; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 0.1s;
}
.tl-note-item:hover { background: #fafaf9; color: #f97316; }
.tl-note-item:last-child { border-bottom: none; }
.tl-loading { padding: 12px; font-size: 11.5px; color: #a8a29e; text-align: center; }

.tl-actions { display: flex; flex-direction: column; gap: 6px; }
.tl-action {
    width: 100%; height: 32px; padding: 0 12px;
    background: white; border: 1px solid #e7e5e4;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    color: #44403c; cursor: pointer; text-align: left;
    display: flex; align-items: center; gap: 6px;
    font-family: inherit; transition: all 0.12s;
}
.tl-action:hover { background: #fafaf9; border-color: #d6d3d1; }
.tl-action.danger { color: #ef4444; }
.tl-action.danger:hover { background: #fef2f2; border-color: #fecaca; }

/* === tabs 切换：grid 布局自适应 === */
/* 标签库 / 总览 / 复习：col3 占满 */
.app.tab-tags .col-1, .app.tab-tags .col-2, .app.tab-tags .col-4,
.app.tab-todos .col-1, .app.tab-todos .col-2, .app.tab-todos .col-4,
.app.tab-projects .col-1, .app.tab-projects .col-2, .app.tab-projects .col-4,
.app.tab-review .col-1, .app.tab-review .col-2, .app.tab-review .col-4,
.app.tab-overview .col-1, .app.tab-overview .col-2, .app.tab-overview .col-4 {
    display: none !important;
}

/* 关键：tab 切换时 .app 不要再用 6 列 grid（隐藏元素不释放 grid 槽） */
.app.tab-todos,
.app.tab-projects,
.app.tab-overview,
.app.tab-review {
    display: flex !important;
    grid-template-columns: none !important;
    padding: 0 !important;
    gap: 0 !important;
}
.app.tab-todos > .col-3,
.app.tab-projects > .col-3,
.app.tab-overview > .col-3,
.app.tab-review > .col-3 {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}
.app.tab-tags .line:nth-of-type(1),
.app.tab-tags .line:nth-of-type(2),
.app.tab-tags .line:nth-of-type(3),
.app.tab-overview .line:nth-of-type(1),
.app.tab-overview .line:nth-of-type(2),
.app.tab-overview .line:nth-of-type(3),
.app.tab-review .line:nth-of-type(1),
.app.tab-review .line:nth-of-type(2),
.app.tab-review .line:nth-of-type(3) {
    display: none !important;
}
/* 收件箱：恢复全部 */
.app.tab-inbox .col-1, .app.tab-inbox .col-2, .app.tab-inbox .col-3, .app.tab-inbox .col-4 {
    display: flex !important;
}

/* 标签库 col-3 全屏：撑满 + 自适应内容 */
.app.tab-tags .col-3 {
    display: flex !important;
    width: 100%;
    height: 100%;
}
.app.tab-tags .col-3 > .taglib {
    /* 改: 左 60% / 右 280px, 之前 1fr + 340px 比例失衡 */
    
    width: 100%;
    height: 100%;
}

/* === 标签库 col-3 强制高度撑满 === */
.app.tab-tags .col-3 {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.app.tab-tags .col-3 > .taglib {
    /* 改: 左 60% / 右 280px, 之前 1fr + 340px 比例失衡 */
    
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
}
/* 强制 .taglib 内的 grid 显式撑开 */
.app.tab-tags .col-3 > .taglib {
    /* 改: 左 60% / 右 280px, 之前 1fr + 340px 比例失衡 */
    
    display: grid !important;
    grid-template-columns: 1fr 1fr;
}

/* === 关键：col-3 内的 .taglib 必须撑满 === */
.app.tab-tags .col-3 {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 0;
}
.app.tab-tags .col-3 > .taglib {
    /* 改: 左 60% / 右 280px, 之前 1fr + 340px 比例失衡 */
    
    flex: 1;
    width: 100%;
    min-height: 0;
}

/* === 关键 fix：tab-tags 时彻底干掉 .app 的 grid，用 flex 替代 === */
.app.tab-tags {
    display: flex !important;
    flex-direction: row;
    width: 100%;
    grid-template-columns: none !important;
}
.app.tab-todos, .app.tab-projects,
.app.tab-overview, .app.tab-review {
    display: flex !important;
    flex-direction: row;
    width: 100%;
    grid-template-columns: none !important;
}
.app.tab-tags .col-3, .app.tab-overview .col-3, .app.tab-review .col-3 {
    flex: 1;
    width: 100%;
    height: 100%;
    display: block;
    overflow: auto;
}

/* === 标签库 chevron 视觉提示 === */
.tl-chevron {
    width: 18px; height: 18px;
    color: var(--text-3);
    font-size: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
    border-radius: 3px;
    transition: all 0.1s;
    margin-right: 4px;
    cursor: pointer;
    margin-right: -3px;
}
.tl-chevron:hover { color: #44403c; }



/* === chevron 大按钮化 === */
.tl-chevron {
    width: 18px;
    height: 18px;
    color: #44403c;
    background: #fafaf9;
    border-radius: 4px;
    padding: 2px;
    flex-shrink: 0;
    transition: all 0.15s;
    cursor: pointer;
    margin-right: 0;
    box-sizing: content-box;
}
.tl-chevron:hover {
    background: #e7e5e4;
    color: #0c0a09;
}
.tl-chevron.expanded {
    transform: rotate(90deg);
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}


/* === 行右边操作按钮 === */
.tl-row-actions {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}
.tl-row:hover .tl-row-actions { display: flex; }
.tl-row.active .tl-row-actions { display: flex; }
.tl-row-act {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #6e6e73;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    font-family: inherit;
}
.tl-row-act svg { width: 13px; height: 13px; }
.tl-row-act:hover {
    background: var(--bg-2);
    color: #f97316;
}
/* 隐藏旧的 + 按钮（被新按钮替代） */
.tl-add-btn { display: none !important; }

/* === 关联笔记 - 方案 D：紧凑列表 === */
.rel-loading {
    padding: 12px;
    font-size: 11.5px;
    color: #a8a29e;
    text-align: center;
}
.rel-empty {
    padding: 24px 12px;
    text-align: center;
}
.rel-empty-icon {
    font-size: 32px;
    opacity: 0.3;
    margin-bottom: 6px;
}
.rel-empty-text {
    font-size: 12px;
    color: #6e6e73;
    font-weight: 500;
}
.rel-empty-sub {
    font-size: 10.5px;
    color: #a8a29e;
    margin-top: 3px;
}
.rel-card {
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.12s;
}
.rel-card:hover {
    border-color: #f97316;
    box-shadow: 0 1px 3px rgba(249,115,22,0.1);
}
.rel-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.rel-card-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rel-card-title {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #0c0a09;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rel-card-strength {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 100px;
    flex-shrink: 0;
    min-width: 26px;
    text-align: center;
}
.rel-card-reason {
    font-size: 10.5px;
    color: #6e6e73;
    line-height: 1.5;
    margin-bottom: 5px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.rel-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.rel-card-tag {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 100px;
    background: #fafaf9;
    color: #44403c;
}

/* === 待办页面 === */
.todo-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--bg);
    overflow: hidden;
    min-height: 0;
}
.todo-page > * { width: 100%; min-width: 0; }
.todo-quick {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--line);
}
.todo-quick input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.todo-quick input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }
.todo-quick-btn {
    height: 36px;
    padding: 0 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.todo-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}
.todo-main > * { min-width: 0; }
.todo-week { flex: 1 1 0; min-width: 0; }
.todo-inbox {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--line);
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.todo-inbox-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.todo-inbox-title { font-size: 13px; font-weight: 600; }
.todo-inbox-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 6px;
    border-bottom: 1px solid var(--line);
    background: rgba(0,0,0,0.01);
    flex-wrap: nowrap;
    overflow-x: auto;
}
.todo-inbox-tab {
    font-size: 11px;
    color: var(--text-2);
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}
.todo-inbox-tab:hover {
    background: var(--bg-2);
}
.todo-inbox-tab.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
.todo-inbox-tab i {
    font-style: normal;
    background: rgba(0,0,0,0.08);
    padding: 0 5px;
    border-radius: 8px;
    font-size: 10px;
    min-width: 14px;
    text-align: center;
}
.todo-inbox-tab.active i {
    background: rgba(255,255,255,0.25);
    color: white;
}
.todo-mini-chip.sched-chip {
    background: rgba(249,115,22,0.12);
    color: #ea580c;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.todo-card.has-sched {
    background: white;
    position: relative;
    border-left: 3px solid #a8a29e;
}
.todo-card.has-sched::before {
    content: 'SCHEDULED';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 800;
    color: #d6d3d1;
    letter-spacing: 2px;
    pointer-events: none;
    opacity: 0.6;
}
.todo-mini-chip.sched-chip {
    background: rgba(249,115,22,0.15);
    color: #c2410c;
    font-weight: 500;
    font-size: 10px;
    padding: 1px 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.todo-inbox-count { background: var(--bg-2); color: var(--text-2); font-size: 11px; padding: 1px 8px; border-radius: 100px; }
.todo-inbox-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.todo-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
}

/* todo 卡片 */
.todo-card {
    background: white;
    border: 1.5px solid var(--line);
    border-left-width: 4px;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: grab;
    transition: all 0.12s;
    user-select: none;
}
.todo-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.todo-card.dragging { opacity: 0.4; }
.todo-card.p-low { border-left-color: #a8a29e; }
.todo-card.p-normal { border-left-color: #3b82f6; }
.todo-card.p-high { border-left-color: #f59e0b; }
.todo-card.p-urgent {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239,68,68,0.04) 0%, transparent 50%);
}
.todo-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.todo-check {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d6d3d1;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.todo-check:hover {
    border-color: #f97316;
}
.todo-check.done {
    background: #f97316;
    border-color: #f97316;
}
.todo-check.done::before {
    content: '✓';
    color: white;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}
.todo-card-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.todo-card.done .todo-card-title { text-decoration: line-through; color: var(--text-3); }
.todo-card-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.todo-mini-chip {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 100px;
    background: var(--bg-2);
    color: var(--text-2);
}
.todo-mini-chip.project-chip { background: rgba(99,102,241,0.1); color: #4f46e5; }
.todo-mini-chip.due-soon { background: rgba(239,68,68,0.1); color: #dc2626; }
.todo-mini-chip.prio-low { background: #fafaf9; color: #6e6e73; }
.todo-mini-chip.prio-normal { background: rgba(59,130,246,0.1); color: #2563eb; }
.todo-mini-chip.prio-high { background: rgba(245,158,11,0.1); color: #d97706; }
.todo-mini-chip.prio-urgent { background: rgba(239,68,68,0.1); color: #dc2626; }

/* 周视图 */
.todo-week {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}
.todo-week-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.todo-week-title { font-size: 14px; font-weight: 600; }
.todo-week-range { font-size: 11.5px; color: var(--text-2); margin-left: 8px; }
.todo-week-nav { display: flex; gap: 4px; }
.todo-week-nav button {
    height: 28px; padding: 0 10px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-2);
    font-family: inherit;
}
.todo-week-nav button:hover { background: var(--bg-2); }
.todo-week-grid {
    flex: 1;
    display: grid;
    /* 列宽等分, 行高按 busy 自适应 */
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: 32px repeat(5, minmax(28px, 1fr));
    overflow: hidden;
}
/* busy 级别 (按 todo 数) */
.todo-week-grid[data-busy-mode="1"] .todo-cell[data-busy="2"],
.todo-week-grid[data-busy-mode="1"] .todo-day-head[data-busy="2"] { grid-column: span 1; }

.todo-corner {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
.todo-day-head {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
}
.todo-day-head .num { font-size: 16px; color: var(--text); font-weight: 600; line-height: 1.2; }
.todo-day-head.today .num { color: var(--primary); }
.todo-day-head.today { background: rgba(249,115,22,0.05); }
.todo-day-head.weekend .num { color: var(--text-3); }
.todo-slot-label {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--bg-2);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-2);
    padding: 4px 2px;
}
.todo-slot-label .ic { font-size: 13px; margin-bottom: 2px; }
.todo-cell {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--bg-2);
    padding: 4px;
    min-height: 0;
    overflow: hidden;
    transition: background 0.12s;
    min-width: 60px;
}
/* busy 1 级 (1-3 todo): 不变 */
.todo-cell[data-busy="2"] {
    /* busy 2 级 (4-6 todo): 微橙底 */
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.04) 0%, transparent 30%);
}
/* busy 3 级 (7+ todo): 强橙底 */
.todo-cell[data-busy="3"] {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.08) 0%, transparent 40%);
    border-left: 2px solid var(--primary);
}
/* 当 day busy 级别 >=2 时, 整列视觉强调 */
.todo-day-head[data-busy="2"] {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.08) 0%, transparent 100%);
    font-weight: 700;
}
.todo-day-head[data-busy="3"] {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    font-weight: 700;
}

.todo-cell.drag-over { background: rgba(249,115,22,0.1); outline: 2px dashed #f97316; }
.todo-cell.today-col { background: rgba(249,115,22,0.02); }
.todo-mini {
    background: white;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 3px;
    font-size: 10.5px;
    color: var(--text);
    cursor: grab;
    line-height: 1.3;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.todo-mini .t {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todo-mini.p-urgent { border-left-color: #ef4444; }
.todo-mini.p-high { border-left-color: #f59e0b; }
.todo-mini.p-low { border-left-color: #a8a29e; }
.todo-mini.done { text-decoration: line-through; opacity: 0.5; }
.todo-mini .t {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 项目卡片 */
.project-card {
    transition: all 0.12s;
}
.project-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* === todos tab 撑满 col-3 === */
/* tab-todos/projects col-3 由 .app flex 接管，不再单独设 height/width */


/* inbox 接收拖拽 */
.todo-inbox-body.drag-over {
    background: rgba(249,115,22,0.08) !important;
    outline: 2px dashed #f97316;
    outline-offset: -4px;
}



/* ============================================================
   ==== ING 抽屉 (右侧 320px, 橙色左条) ====
   ============================================================ */
.todo-ing {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--line);
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.todo-ing-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(249,115,22,0.04) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.todo-ing-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.todo-ing-count {
    background: rgba(249,115,22,0.1);
    color: var(--primary);
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 100px;
    font-weight: 600;
}
.todo-ing-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ING 卡片 */
.ing-card {
    background: white;
    border: 1.5px solid var(--line);
    /* 左边框改为中性灰 (track 区分用头部横条) */
    border-left: 1.5px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.12s;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.ing-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
/* track 用头部横条区分, 边框统一灰 */

.ing-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-top: 4px;
    /* 让头部 + 头部有微调: track-focus 给点橙底 */
    transition: all 0.2s;
}
.ing-card.track-focus .ing-card-head {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.04) 0%, transparent 100%);
}
.ing-card.track-bg .ing-card-head {
    background: linear-gradient(180deg, rgba(168, 162, 158, 0.06) 0%, transparent 100%);
}
.ing-card.track-wait .ing-card-head {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}
.ing-card-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ing-card-track-badge {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    color: white;
    font-weight: 600;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.ing-card.track-focus .ing-card-track-badge { background: var(--primary); color: white; }
.ing-card.track-bg .ing-card-track-badge { background: var(--accent); }
.ing-card.track-wait .ing-card-track-badge { background: var(--green); }



/* ING 抽屉卡: 左侧 track 颜色细条 (3px) */
.ing-card .ing-card-track-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--line);
}
.ing-card.track-focus .ing-card-track-bar { background: var(--primary); }
.ing-card.track-bg .ing-card-track-bar { background: var(--accent); }
.ing-card.track-wait .ing-card-track-bar { background: var(--green); }

/* === 方案3: 便签默认折叠 (单行) === */
.ing-mimo-folded {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    font-size: 11px;
    color: #78350f;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.1s;
}
.ing-mimo-folded:hover { background: #fef9c3; }
.ing-mimo-folded .mimo-icon { flex-shrink: 0; }
.ing-mimo-folded .mimo-preview {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.ing-mimo-folded .mimo-arrow {
    color: var(--text-3);
    font-size: 10px;
    flex-shrink: 0;
}
.ing-mimo-folded .mimo-todo-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 600;
    flex-shrink: 0;
}

/* 便签展开态 */
.ing-mimo-expanded {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 11.5px;
    color: #78350f;
    line-height: 1.55;
    position: relative;
}
.ing-mimo-expanded .mimo-close {
    position: absolute;
    top: 4px;
    right: 6px;
    color: var(--text-3);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.ing-mimo-expanded .mimo-close:hover { color: #b45309; }
.ing-mimo-expanded textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 11.5px;
    color: #78350f;
    line-height: 1.55;
    font-family: inherit;
    resize: vertical;
    min-height: 36px;
    box-sizing: border-box;
}
.ing-mimo-meta {
    font-size: 9.5px;
    color: var(--text-3);
    text-align: right;
    margin-top: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}
.ing-mimo-meta.saving { color: var(--primary); }

/* mini todo 紧凑列表 */
.ing-mini-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 6px;
}
.ing-mini-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
}
.ing-mini-item:hover .ing-mini-check { border-color: var(--primary); }
.ing-mini-check {
    width: 13px; height: 13px;
    border-radius: 3px;
    border: 1.5px solid var(--line-2);
    flex-shrink: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}
.ing-mini-check.done {
    background: var(--green);
    border-color: var(--green);
}
.ing-mini-check.done::before {
    content: '✓';
    color: white;
    font-size: 9.5px;
    line-height: 1;
    font-weight: 700;
}
.ing-mini-title {
    flex: 1;
}
.ing-mini-item.done .ing-mini-title {
    text-decoration: line-through;
    color: var(--text-3);
}
.ing-mini-time {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-3);
}
.ing-mini-del {
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    width: 14px;
    text-align: center;
    line-height: 1;
}
.ing-mini-item:hover .ing-mini-del { opacity: 1; }
.ing-mini-del:hover { color: #dc2626; }

.ing-mini-add {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}
.ing-mini-add input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 11.5px;
    color: var(--text);
    font-family: inherit;
    padding: 2px 0;
}
.ing-mini-add input::placeholder { color: var(--text-3); }
.ing-mini-add-btn {
    font-size: 10.5px;
    color: var(--primary);
    background: rgba(249, 115, 22, 0.08);
    border: none;
    border-radius: 4px;
    padding: 3px 9px;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.ing-mini-meta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-3);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* 3 按钮 (在卡片底部) */
.ing-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
}
.ing-btn {
    height: 26px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: inherit;
    transition: all 0.1s;
}
.ing-btn:hover { background: var(--bg-2); }
.ing-btn.btn-start.active { background: var(--primary); color: white; border-color: var(--primary); }
.ing-btn.btn-wait.active { background: var(--green); color: white; border-color: var(--green); }
.ing-btn.btn-done:hover { background: var(--text); color: white; border-color: var(--text); }

/* ING 拖入区域高亮 */
.todo-ing-body.drag-over {
    background: rgba(249,115,22,0.05) !important;
    outline: 2px dashed var(--primary);
    outline-offset: -4px;
}

/* === in-ing 高亮 (收件箱 + 日历) === */
.todo-card { position: relative; }
/* === in-ing: 旋转高光边框 === */
/* === in-ing: 走马灯旋转高光 (transform rotate, 匀速) === */
@keyframes ing-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes ing-shine {
    /* 内部遮罩缓慢呼吸, 配合走马灯 */
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.todo-card.in-ing {
    border: 2px solid transparent;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 16px rgba(234, 88, 12, 0.4);
}
/* 旋转环 (背景层) */
.todo-card.in-ing::before {
    content: '';
    position: absolute;
    inset: 0;
    /* 让旋转层正好等于卡片大小, 不会有进出视差错觉 */
    background: conic-gradient(
        #c2410c 0deg, #ea580c 25deg, #f97316 50deg, #ea580c 75deg, #c2410c 100deg,
        #fbbf24 125deg,
        transparent 145deg, transparent 360deg
    );
    animation: ing-spin 3s linear infinite;
    transform-origin: center;
    will-change: transform;
    z-index: -2;
}
.todo-mini.in-ing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(
        #c2410c 0deg, #ea580c 25deg, #f97316 50deg, #ea580c 75deg, #c2410c 100deg,
        #fbbf24 125deg,
        transparent 145deg, transparent 360deg
    );
    animation: ing-spin 3s linear infinite;
    transform-origin: center;
    will-change: transform;
    z-index: -2;
}
/* 内白底遮罩 (遮住中心, 只露边框) */
.todo-card.in-ing::after {
    content: '';
    position: absolute;
    inset: 3px;  /* 露更多边框 */
    background: linear-gradient(90deg, rgba(255,255,255,0.88) 0%, white 30%, white 100%);
    border-radius: 4px;
    pointer-events: none;
    z-index: -1;
}
.todo-card.in-ing .ing-badge {
    position: absolute;
    top: 50%;
    right: 8px;
    margin-top: -8px;
    font-size: 9px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(249,115,22,0.18);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.04em;
    pointer-events: none;
    z-index: 3;
    display: inline-block;
    line-height: 1;
}

.todo-card.in-ing .ing-badge .ic {
    display: inline-block;
    animation: ingSpinIcon 2s linear infinite;
    transform-origin: center;
}

@keyframes ingSpinIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* === Chain v11: 延续链 三角 (right-bottom corner) === */
.chain-corner {
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    font-size: 10px; font-weight: 700;
    padding: 3px 8px 3px 12px;
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%);
    cursor: pointer;
    transition: all 0.15s;
    z-index: 4;
    min-width: 40px; text-align: right;
    line-height: 1.2;
    box-shadow: -2px -2px 6px rgba(249,115,22,0.25);
}
.chain-corner.faded {
    background: linear-gradient(135deg, #a8a29e, #78716c);
    box-shadow: -1px -1px 3px rgba(0,0,0,0.1);
}
.chain-corner:hover {
    padding: 4px 10px 4px 14px;
    min-width: 46px;
}

/* mini 片上的三角 (日历 todo-mini 专用) */
.chain-corner-mini {
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    font-size: 8px; font-weight: 700;
    padding: 1px 5px 1px 7px;
    clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
    cursor: pointer;
    z-index: 2;
    line-height: 1.2;
    pointer-events: auto;
}
.chain-corner-mini.faded {
    background: linear-gradient(135deg, #a8a29e, #78716c);
}

/* mini 延续按钮 (14×14, hover 显示) */
.mini-continue-btn {
    position: absolute;
    top: 2px; right: 2px;
    width: 14px; height: 14px;
    display: flex; align-items: center; justify-content: center;
    background: white;
    border: 1px solid #fed7aa;
    color: #c2410c;
    border-radius: 3px;
    font-size: 9.5px; font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, all 0.12s;
    z-index: 3;
    padding: 0;
    line-height: 1;
}
.todo-mini:hover .mini-continue-btn { opacity: 1; }
.mini-continue-btn:hover {
    background: #f97316; color: white; border-color: #f97316;
    transform: scale(1.15);
}
.todo-mini.done .mini-continue-btn { display: none; }
.todo-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 5;
}
.todo-card:hover .todo-card-actions { opacity: 1; }
.todo-continue-btn, .todo-del-btn {
    font-size: 10.5px; font-weight: 600;
    padding: 2px 7px; border-radius: 4px;
    border: 1px solid #e7e5e4;
    background: white; color: #57534e;
    cursor: pointer; transition: all 0.12s;
    line-height: 1.4;
}
.todo-continue-btn {
    background: #fff7ed; color: #c2410c; border-color: #fed7aa;
}
.todo-continue-btn:hover { background: #f97316; color: white; border-color: #f97316; }
.todo-del-btn:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Chain 弹窗 */
.chain-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.chain-modal {
    background: white; border-radius: 16px; max-width: 520px; width: 100%;
    max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.chain-modal-head {
    padding: 20px 24px 14px; border-bottom: 1px solid #f5f5f4;
}
.chain-modal-head h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.chain-modal-head p { font-size: 12px; color: #78716c; }
.chain-modal-body { padding: 16px 24px; overflow-y: auto; }
.chain-modal-foot {
    padding: 12px 24px; background: #fafaf9;
    display: flex; justify-content: flex-end; border-top: 1px solid #f5f5f4;
}
.chain-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 6px;
    border: 1px solid #f5f5f4; background: #fafaf9;
    font-size: 13px;
}
.chain-row.current {
    background: white; border: 1.5px solid #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.chain-dot {
    width: 10px; height: 10px; border-radius: 50%;
    margin-top: 4px; flex-shrink: 0;
}
.chain-dot.done { background: #10b981; }
.chain-dot.active { background: #f97316; }
.chain-dot.future { background: #d6d3d1; }
.chain-seq {
    font-weight: 700; font-size: 11px;
    background: #1c1917; color: white;
    padding: 2px 8px; border-radius: 4px; flex-shrink: 0;
}
.chain-row.current .chain-seq { background: #f97316; }
.chain-label { flex: 1; min-width: 0; }
.chain-title { font-weight: 600; }
.chain-note { font-size: 11px; color: #78716c; margin-top: 2px; }
.chain-time { color: #10b981; font-size: 14px; flex-shrink: 0; }
.chain-row.current .chain-time { color: #f97316; }
.chain-empty { text-align: center; padding: 32px; color: #a8a29e; }
.btn-secondary {
    background: white; border: 1px solid #e7e5e4;
    color: #57534e; padding: 6px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px;
}

.todo-mini.in-ing {
    border: 2px solid transparent;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.5);
}
    content: '';
    position: absolute;
    inset: 0;
    /* 让旋转层正好等于卡片大小, 不会有进出视差错觉 */
    background: conic-gradient(
        #c2410c 0deg, #ea580c 25deg, #f97316 50deg, #ea580c 75deg, #c2410c 100deg,
        #fbbf24 125deg,
        transparent 145deg, transparent 360deg
    );
    animation: ing-spin 3s linear infinite;
    transform-origin: center;
    will-change: transform;
    z-index: -2;
}
.todo-mini.in-ing::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    pointer-events: none;
    z-index: -1;
}
.todo-mini.in-ing .ing-badge-mini {
    position: absolute;
    top: 50%;
    right: 3px;
    margin-top: -7px;
    font-size: 10px;
    color: var(--primary);
    pointer-events: none;
    z-index: 3;
    display: inline-block;
    line-height: 1;
}

.todo-mini.in-ing .ing-badge-mini .ic {
    display: inline-block;
    animation: ingSpinIcon 2s linear infinite;
    transform-origin: center;
}

/* === 弹窗 === */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e7e5e4;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-foot {
    padding: 14px 28px 14px 28px;
    border-top: 1px solid #e7e5e4;
    background: #fafafa;
}


/* === 专注模式（方案 A · 极简留白） === */
.focus-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.focus-a {
    height: 100%;
    padding: 32px 40px;
    display: flex; flex-direction: column;
    background: var(--bg);
    max-width: 1100px; margin: 0 auto;
}
.focus-a .a-head {
    display: flex; align-items: center;
    font-size: 12px; color: var(--text-3);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.focus-a .a-head .a-back { cursor: pointer; }
.focus-a .a-head .a-back:hover { color: var(--text); }
.focus-a .a-head .spacer { flex: 1; }
.focus-a .a-head .a-x { cursor: pointer; padding: 0 8px; }
.focus-a .a-head .a-x:hover { color: var(--text); }

.focus-a .a-main {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 24px;
    min-height: 0;
}
.focus-a .a-now {
    font-size: 13px; color: var(--text-2);
    display: flex; align-items: center; gap: 8px;
    font-weight: 500;
}
.focus-a .a-now .dot {
    width: 8px; height: 8px; background: var(--green);
    border-radius: 50%; animation: focus-pulse 1.5s ease-in-out infinite;
}
@keyframes focus-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.4); }
}
.focus-a .a-now .a-proj { color: var(--text-3); font-size: 12px; }

.focus-a .a-time {
    font-size: 96px; font-weight: 200; letter-spacing: -4px;
    font-family: 'SF Mono', ui-monospace, 'JetBrains Mono', monospace;
    color: var(--text); line-height: 1;
}
.focus-a .a-time .ms { font-size: 32px; color: var(--text-3); margin-left: 4px; font-weight: 200; }

.focus-a .a-ctrl { display: flex; gap: 8px; }
.focus-a .a-ctrl .t-btn { min-width: 100px; justify-content: center; height: 36px; }
.focus-a .a-ctrl [data-fc="finish"] {
    background: var(--text); border-color: var(--text); color: white; font-weight: 600;
}

.focus-a .a-next {
    font-size: 11px; color: var(--text-3);
    padding: 6px 14px; background: var(--bg-2);
    border-radius: 100px;
}
.focus-a .a-next b { color: var(--text-2); font-weight: 500; }

.focus-a .a-foot {
    display: flex; align-items: center; gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.focus-a .a-foot .a-note {
    flex: 1; padding: 10px 14px;
    background: white; border: 1px solid var(--line);
    border-radius: 8px; color: var(--text);
    font-size: 13px; font-family: inherit;
    resize: none; min-height: 20px; max-height: 60px;
    outline: none;
}
.focus-a .a-foot .a-note:focus { border-color: var(--primary); }
.focus-a .a-foot .a-save-note { width: 36px; height: 36px; padding: 0; justify-content: center; }
.focus-a .a-foot .a-save-note:hover { background: var(--primary); border-color: var(--primary); color: white; }

/* 卡片上 ▶ 按钮 */

.todo-card { position: relative; }


/* last-fix:  1788521320  */


/* Toast 容器（居中靠上） */
#toast-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}
.toast {
    background: #1c1917;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s;
    max-width: 280px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: fit-content;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast-success { background: #047857; }
.toast-error   { background: #b91c1c; }
.toast-info    { background: #1c1917; }


/* 扔笔记弹窗：推荐 tag */
.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 0;
    align-items: center;
    max-height: 100px;
    overflow-y: auto;
}
.tag-suggestions .suggest-label {
    font-size: 11px;
    color: var(--text-3);
    margin-right: 2px;
}
.tag-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
}
.tag-suggestion:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.tag-suggestion.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.tag-suggestion .tag-count {
    font-size: 10px;
    opacity: 0.6;
}


/* === 笔记详情（方案 A · 大正文 + 信息条） === */

.note-title-row {
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 14px;
}
.note-title {
    flex: 1;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.5px;
    outline: none;
    margin-bottom: 0;
    text-decoration: none;
    border-bottom: none;
}
.note-title:empty::before {
    content: attr(data-placeholder);
    color: var(--text-3);
}
.note-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center;
    margin-bottom: 0;
}
.note-summary {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    margin: 0 0 14px;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    font-style: normal;
    box-shadow: none;
    outline: none;
}
.note-meta {
    display: flex;
    align-items: center;
    gap: 6px 4px;
    flex-wrap: wrap;
    padding: 10px 32px 16px;
    background: white;
    font-size: 12px;
    color: var(--text-3);
}
.note-meta .meta-row {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px;
    flex-shrink: 0;
}
.note-meta .meta-key {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.note-meta .meta-val {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}
.note-meta .meta-sep {
    color: var(--line-2);
    margin: 0 6px;
}

.note-content-wrap {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.note-content {
    width: 100%;
    flex: 1;
    padding: 12px 60px 32px 32px;
    font-family: -apple-system, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    color: #292524;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: transparent;
    overflow-y: auto;
    box-sizing: border-box;
}
.note-content:empty::before {
    content: "点击 ¹2e0f 编辑正文";
    color: #a8a29e;
    font-style: italic;
}
.note-content-edit {
    width: 100%;
    width: 100%;
    flex: 1 1 auto;
    min-height: 60vh;
    height: 60vh;
    padding: 16px 20px;
    border: 2px solid #f97316;
    border-radius: 6px;
    outline: none;
    font-family: -apple-system, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    color: #292524;
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fff7ed;
    box-sizing: border-box;
    margin: 0 0 12px 0;
}
.note-content-edit-btn {
    position: absolute;
    top: 8px;
    right: 16px;
    width: 32px; height: 32px;
    border: 1px solid #e7e5e4;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #78716c;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.12s;
    z-index: 5;
}
.note-content-edit-btn:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff7ed;
}
.note-content::placeholder { color: var(--text-3); }

/* 详情页内：note-head 是普通 block，跟随整体滚动 */

.note-foot .hint { color: var(--text-3); }
/* tag 样式（已经在 .stag 里了，但 .stag-add 缺） */
.stag-add {
    height: 22px; padding: 0 10px;
    background: transparent;
    border: 1px dashed var(--line-2);
    border-radius: 100px;
    color: var(--text-3);
    font-size: 11px; cursor: pointer;
    font-family: inherit;
}
.stag-add:hover { border-color: var(--primary); color: var(--primary); }

/* 顶 icon 按钮 */
.icon-btn {
    position: absolute;
    top: 36px;
    right: 48px;
    width: 28px; height: 28px;
    background: white; border: 1px solid var(--line);
    border-radius: 6px; cursor: pointer;
    color: var(--text-3);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--text-3); }
.icon-btn svg { width: 14px; height: 14px; }


/* 详情底栏 - 删除按钮（红填充） */
#note-delete {
    height: 30px; padding: 0 14px;
    background: white;
    color: var(--text-3);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
}
#note-delete:hover { color: #dc2626; border-color: #fecaca; }
#note-delete svg { width: 14px; height: 14px; }

#save-status { color: var(--text-3); font-size: 11px; }
/* VERSION-TAG-2026-09-04-20-29 */

#col-3 {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}




/* === 笔记详情 v3 · 一体化 === */
#col-3 {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

/* 顶栏 */
.note-bar {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    background: white;
    flex-shrink: 0;
}
.note-bar-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-bar-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}
.note-bar-btn {
    height: 30px;
    padding: 0 10px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    gap: 3px;}
.note-bar-btn:hover { background: var(--bg); border-color: var(--text-3); }
.note-bar-btn.danger { color: #dc2626; border-color: #fecaca; }

.note-bar-btn.active {
    border-color: #f97316;
    color: #c2410c;
    font-weight: 600;
}

.note-bar-btn.danger:hover { background: #fef2f2; }

/* 中间内容（一体化） */
.note-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px 40px;
    background: white;
}
.note-body .note-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    outline: none;
    text-decoration: none;
    border-bottom: none;
}
.note-body .note-summary {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 14px;
    background: transparent;
    border: none;
    padding: 0;
    font-style: normal;
    box-shadow: none;
    outline: none;
}
.note-body .note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    align-items: center;
}
.note-body .note-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border: none;
}
.note-body .note-meta .k { color: var(--text-3); }
.note-body .note-meta .v { color: var(--text); font-weight: 500; }
.note-body .note-meta .meta-sep { color: var(--line); margin: 0 4px; }
.note-body .note-meta .v.highlight { color: var(--primary-2); }
.status-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.status-dot.pending { background: var(--text-3); }

/* 正文 */
.note-content {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    outline: none;
    font-family: -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 2.6;
    color: #333;
    resize: none;
    background: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 500px;
    /* 双换行 = 段落间距，2.6 行高 × 双换行 ≈ 78px 间距 */
}
.note-content::placeholder { color: var(--text-3); }

/* 底部保存状态（无边框） */
.note-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-3);
}
.note-save-bar .hint { color: var(--text-3); }


/* === 笔记右键菜单 === */
.context-menu {
    position: fixed;
    z-index: 9999;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    min-width: 160px;
    padding: 4px;
    font-size: 13px;
    animation: cm-fade 0.1s ease;
}
@keyframes cm-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text);
    user-select: none;
}
.context-menu-item:hover { background: var(--bg-2); }
.context-menu-item.danger { color: #dc2626; }
.context-menu-item.danger:hover { background: #fef2f2; }
.context-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }


/* === 多选 toolbar === */
.multi-select-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1917;
    color: white;
    border-radius: 100px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 9999;
    animation: ms-slide 0.2s ease;
}
@keyframes ms-slide { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.ms-btn {
    height: 32px; padding: 0 12px;
    background: transparent;
    color: white;
    border: none;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ms-btn:hover { background: rgba(255,255,255,0.1); }
.ms-btn.danger { color: #fca5a5; }
.ms-count { padding: 0 12px; font-size: 12px; color: #a8a29e; }
.ms-spacer { width: 1px; height: 20px; background: rgba(255,255,255,0.2); margin: 0 4px; }

/* 多选模式下的笔记 */
.list-item.selected {
    background: rgba(249,115,22,0.08) !important;
    border-left: 3px solid var(--primary);
    padding-left: 11px;
}
/* selected 时, active 的左侧 2px 竖条被 border-left 替代, 隐藏 ::before */
.list-item.selected.active::before { display: none; }

/* selected 自己的 ✓ 圆圈放左下角 (避开 active 区域的视觉冲突) */
.list-item.selected::after {
    content: '\2713';
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}
.list-item.selected { padding-left: 38px; }



/* === 添加标签弹窗 - 层级树 === */
.tag-picker-tree {
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    overflow-y: auto;
}
.tag-pick-row { padding: 0; }
.tag-pick-children {
    display: none;
    flex-direction: column;
    padding-left: 18px;
    border-left: 1px dashed var(--line);
    margin-left: 11px;
}
.tag-pick-children.open { display: flex; }
.tag-picker-tree .tag-pick {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: all 0.1s;
}
.tag-picker-tree .tag-pick:hover {
    background: var(--bg-2);
    border-left-color: transparent;
    border-color: var(--line);
}
.tag-picker-tree .tag-pick[style*="primary"], .tag-picker-tree .tag-pick.selected {
    background: rgba(249,115,22,0.08);
    border-color: var(--primary);
    color: var(--primary-2);
}
.tag-picker-tree .tag-pick[data-depth="0"] {
    font-weight: 500;
    color: var(--text);
}

.tag-picker-tree .tag-pick[data-depth="1"] { padding-left: 20px; }
.tag-picker-tree .tag-pick[data-depth="2"] { padding-left: 32px; }
.tag-picker-tree .tag-pick[data-depth="3"] { padding-left: 64px; }

.tag-picker-tree .tag-pick[data-depth]:not([data-depth="0"])::before {
    content: '└';
    color: var(--text-3);
    margin-right: 4px;
    font-size: 11px;
    font-family: monospace;
}
.tag-picker-tree .tag-pick-name { flex: 1; }
.tag-picker-tree .tag-pick-count { color: var(--text-3); font-size: 10px; }

.tag-pick-toggle.none { visibility: hidden; width: 0; padding: 0; margin: 0; border: 0; }
.tag-pick-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    border-radius: 3px;
    transition: all 0.1s;
}
.tag-pick-chevron:hover { background: var(--bg-2); }
/* 三角形 - 用 border 画 */
.tag-pick-chevron::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #78716c;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.15s;
}
.tag-pick-chevron.open::after {
    border-top: none;
    border-bottom: 5px solid #f97316;
    transform: translate(-50%, -50%) rotate(180deg);
}
.tag-pick-name { flex: 1; }
.tag-pick-count { color: var(--text-3); font-size: 10px; }
.tl-chevron.none { visibility: hidden; }
.tl-chevron:hover { background: var(--bg-2); color: var(--text); }

/* 收件箱分类树 chevron */
.tag-chevron {
    width: 18px; height: 18px;
    color: var(--text-3);
    font-size: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
    border-radius: 3px;
    margin-left: auto;
    transition: all 0.1s;
}
.tag-chevron:hover { background: var(--bg-2); color: var(--text); }
.tag-chevron.none { visibility: hidden; }
.tag-chevron.open { color: var(--primary-2); }
.mini-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d6d3d1;
  border-radius: 4px;
  margin-right: 6px;
  cursor: pointer;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  color: white;
  background: white;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.mini-check:hover {
  border-color: #f97316;
}
.mini-check.done {
  background: #f97316;
  border-color: #f97316;
}
.mini-check.done::before {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}


/* Markdown 渲染 */
.note-content h1, .note-content h2, .note-content h3 {
    margin: 1.4em 0 0.6em;
    font-weight: 700;
    color: #1c1917;
    line-height: 1.3;
}
.note-content h1 { font-size: 1.6em; border-bottom: 1px solid #e7e5e4; padding-bottom: 6px; }
.note-content h2 { font-size: 1.3em; }
.note-content h3 { font-size: 1.1em; }
.note-content h4, .note-content h5, .note-content h6 {
    margin: 1.2em 0 0.4em;
    font-weight: 600;
}
.note-content p { margin: 0 0 0.8em; }
.note-content ul, .note-content ol { margin: 0 0 0.8em 1.5em; }
.note-content li { margin: 0.2em 0; }
.note-content code {
    background: #f5f5f4;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.9em;
    color: #c2410c;
}
.note-content pre {
    background: #0c0a09;
    color: #d6d3d1;
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0 0 0.8em;
    font-size: 13px;
    line-height: 1.5;
}
.note-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}
.note-content blockquote {
    border-left: 3px solid #f97316;
    padding: 4px 12px;
    margin: 0 0 0.8em;
    color: #57534e;
    background: #fff7ed;
    border-radius: 0 4px 4px 0;
}
.note-content a {
    color: #f97316;
    text-decoration: none;
    border-bottom: 1px solid #fed7aa;
}
.note-content a:hover {
    border-bottom-color: #f97316;
}
.note-content hr {
    border: none;
    border-top: 1px solid #e7e5e4;
    margin: 1.5em 0;
}
.note-content table {
    border-collapse: collapse;
    margin: 0 0 0.8em;
    width: 100%;
    font-size: 14px;
}
.note-content th, .note-content td {
    border: 1px solid #e7e5e4;
    padding: 6px 10px;
    text-align: left;
}
.note-content th {
    background: #fafaf9;
    font-weight: 600;
}


/* Markdown 切换按钮 */
.note-content-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 0;
}
.md-toggle {
    height: 26px;
    padding: 0 10px;
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 6px;
    font-size: 11px;
    color: #78716c;
    cursor: pointer;
    transition: all 0.12s;
}
.md-toggle:hover {
    border-color: #f97316;
    color: #f97316;
}
.md-toggle.active {
    border-color: #f97316;
    color: #c2410c;
    font-weight: 600;
}
.note-content-raw {
    width: 100%;
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    color: #292524;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 6px;
    margin: 0;
    overflow-y: auto;
    box-sizing: border-box;
}


/* 双击编辑提示 */
.note-content-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    padding: 4px 0 0;
}
.note-content-hint {
    font-size: 11px;
    color: #a8a29e;
    font-style: italic;
}
.note-content[contenteditable],
.note-content-raw[contenteditable] {
    outline: none;
    border-radius: 6px;
    cursor: text;
}

/* === 删分类弹窗 === */
.cat-del-dlg {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.cat-del-mask {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
}
.cat-del-box {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 480px; max-width: 92vw;
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cat-del-title {
    font-size: 16px; font-weight: 700; margin-bottom: 6px;
}
.cat-del-warn {
    font-size: 12.5px; color: #c2410c; margin-bottom: 12px;
    background: #fff7ed; padding: 8px 10px; border-radius: 6px;
    border: 1px solid #fed7aa;
}
.cat-del-tree {
    flex: 1; overflow-y: auto;
    background: #fafaf9; border-radius: 6px;
    padding: 10px; max-height: 320px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px; line-height: 1.7;
    color: #1c1917;
    margin-bottom: 14px;
}
.cat-del-row { white-space: nowrap; }
.cat-del-sub { padding-left: 0; }
.cat-del-note { color: #a8a29e; font-size: 11.5px; }
.cat-del-empty { color: #a8a29e; padding: 8px; }
.cat-del-reparent {
    padding: 6px 10px; cursor: pointer; border-radius: 4px;
    font-size: 12.5px; font-family: inherit;
}
.cat-del-reparent:hover { background: #fff7ed; color: #c2410c; }
.cat-del-actions {
    display: flex; gap: 8px; justify-content: flex-end;
}
.cat-del-btn {
    border: none; border-radius: 6px;
    padding: 8px 16px; font-size: 12.5px;
    cursor: pointer; font-weight: 600;
}
.cat-del-btn.cancel { background: #fafaf9; color: #57534e; }
.cat-del-btn.cancel:hover { background: #e7e5e4; }
.cat-del-btn.reparent { background: white; border: 1px solid #f97316; color: #f97316; }
.cat-del-btn.reparent:hover { background: #fff7ed; }
.cat-del-btn.cascade { background: #ef4444; color: white; }
.cat-del-btn.cascade:hover { background: #dc2626; }

/* ============ 标签库全屏 子 tab 切换 ============ */
.tl-subtabs {
    display: flex;
    gap: 4px;
    padding: 8px 18px 0 28px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.tl-subtab {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 500;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tl-subtab:hover { color: var(--text); }
.tl-subtab.active {
    color: #f97316;
    border-bottom-color: #f97316;
    font-weight: 600;
}
.tl-subtab .badge {
    font-size: 10px;
    background: var(--line-2);
    color: var(--text-3);
    padding: 0 6px;
    border-radius: 8px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}
.tl-subtab.active .badge { background: #fff7ed; color: #c2410c; }
.tl-subtab .badge.cand { background: #f97316; color: white; }
.tl-subtab.active .badge.cand { background: #f97316; color: white; }

/* ============ 候选池 / 异常 分组 ============ */
.tree-group {
    margin-top: 10px;
    border-top: 1px dashed #e7e5e4;
    padding-top: 4px;
}
.tree-group-head {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.tree-group-head.cand { color: #c2410c; }
.tree-group-head.warn { color: #b91c1c; }
.tree-group-head .count {
    margin-left: auto;
    background: #f5f5f4;
    color: var(--text-3);
    font-size: 9.5px;
    padding: 0 5px;
    border-radius: 6px;
    height: 13px;
    display: inline-flex;
    align-items: center;
}
.tree-group-head.cand .count { background: #fff7ed; color: #c2410c; }
.tree-group-head.warn .count { background: #fef2f2; color: #b91c1c; }
.tree-group-actions {
    display: flex;
    gap: 4px;
    padding: 0 10px 6px;
}
.tree-group-actions .mini {
    flex: 1;
    border: 1px solid #fed7aa;
    background: white;
    color: #c2410c;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10.5px;
    cursor: pointer;
    font-family: inherit;
}
.tree-group-actions .mini:hover { background: #fff7ed; }
.tree-group-actions .mini.warn { border-color: #fecaca; color: #b91c1c; }
.tree-group-actions .mini.warn:hover { background: #fef2f2; }

/* ============ 治理 tab 内容 ============ */
.taglib-gov {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 18px 28px;
}
.gov-hero {
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 50%, #fef3c7 100%);
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.gov-hero-label {
    font-size: 11px;
    color: #c2410c;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gov-hero-label::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background: #f97316;
    border-radius: 50%;
}
.gov-hero-big {
    font-size: 38px;
    font-weight: 700;
    color: #c2410c;
    line-height: 1.1;
    margin: 6px 0 4px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.gov-hero-big .unit {
    font-size: 14px;
    font-weight: 500;
    color: #a16207;
}
.gov-hero-sub {
    font-size: 12px;
    color: #a16207;
}
.gov-hero-sub .warn {
    color: #b91c1c;
    font-weight: 600;
}

.gov-run-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
}
.gov-run-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.gov-run-btn {
    width: 100%;
    background: #f97316;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.gov-run-btn:hover { background: #ea580c; }
.gov-run-btn:disabled { background: #d6d3d1; color: var(--text-3); cursor: not-allowed; }
.gov-progress {
    margin-top: 10px;
    font-size: 12px;
    color: #c2410c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: ui-monospace, monospace;
    word-break: break-all;
    display: none;
}
.gov-progress:not(:empty) { display: block; }

.gov-params {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.gov-params-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.gov-param-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12.5px;
    border-top: 1px solid #f5f5f4;
}
.gov-param-row:first-of-type { border-top: none; }
.gov-param-row .label { color: var(--text-2); flex: 1; }
.gov-param-row .desc { font-size: 11px; color: var(--text-3); }
.gov-param-row select {
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 12px;
    background: white;
    font-family: inherit;
}

.gov-last {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.gov-last-time {
    font-size: 12px;
    color: var(--text-2);
    font-weight: 600;
    margin-bottom: 6px;
}
.gov-last-chips {
    display: flex;
    gap: 5px;
}
.gov-last-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0fdf4;
    color: #15803d;
    font-weight: 600;
}
.gov-last-chip.warn { background: #fef2f2; color: #b91c1c; }
.gov-last-chip.neutral { background: var(--line-2); color: var(--text-2); }

.gov-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.gov-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 12.5px;
    transition: all 0.12s;
}
.gov-link:hover { border-color: #f97316; color: #f97316; }
.gov-link .gov-link-title { font-weight: 600; }
.gov-link .gov-link-desc { font-size: 11px; color: var(--text-3); }

/* ============ 治理 tab 右侧详情 ============ */
.tl-gov-aside {
    padding: 18px;
    flex: 1;
    overflow-y: auto;
}
.tl-gov-aside-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.tl-gov-aside-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.tl-gov-aside-card h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tl-gov-aside-card .num {
    margin-left: auto;
    font-size: 18px;
    font-weight: 700;
    color: #f97316;
}
.tl-gov-aside-card p {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.6;
}


/* ING 卡片右上角移出按钮 */
.ing-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    border: none;
    padding: 0;
    transition: all 0.1s;
    z-index: 2;
}
.ing-card-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}
/* 给卡片让出右上角空间 (避免跟 track-badge 重叠) */
.ing-card { position: relative; padding-top: 14px; }
.ing-card-track-badge { margin-right: 24px; }


/* ING wait 计时显示 */
.ing-wait-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #047857;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 3px 7px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
    width: fit-content;
}
.ing-wait-timer::before {
    content: '⏳';
    font-size: 11px;
}
.ing-wait-timer.running {
    color: #b45309;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}
.ing-wait-timer.running::before {
    content: '⏱';
}
/* wait badge 在头部 */
.ing-card-head .wait-badge {
    font-size: 9.5px;
    color: var(--green);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: -2px;
}


/* ING 卡拖出时的视觉提示: 收集箱/日历 cell 高亮 = 放这取消 ING */
.inbox-list.ing-out-drag-over,
.todo-inbox.ing-out-drag-over,
.week-cell.ing-out-drag-over {
    background: rgba(168, 162, 158, 0.08) !important;
    outline: 2px dashed #a8a29e !important;
    outline-offset: -2px !important;
    position: relative;
}
.inbox-list.ing-out-drag-over::before,
.todo-inbox.ing-out-drag-over::before {
    content: '松开 = 取消 ING';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(168, 162, 158, 0.95);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
}

/* ING 卡 drag 时给点透视觉 */
.ing-card.dragging {
    opacity: 0.4;
    transform: rotate(-2deg);
}


/* start 按钮 → 计时器状态 (橙黄主题) */
.ing-btn.btn-start.timing {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    animation: btn-pulse 1.5s ease-in-out infinite;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.ing-btn.btn-start.timing:hover {
    background: #ea580c;
    border-color: #ea580c;
}
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}


/* ING 抽屉收起状态: 48px 细條, 只留 展开箭头 */
.todo-ing.collapsed {
    width: 48px !important;
    position: relative;
    align-items: center;
}
/* 收起时 隐藏 head 中的标题 + 计数 */
.todo-ing.collapsed .todo-ing-title,
.todo-ing.collapsed .todo-ing-count {
    display: none !important;
}
/* 收起时 隐藏 body (卡片区) */
.todo-ing.collapsed .todo-ing-body {
    display: none !important;
}
/* 收起时 head 只留 toggle 按钮 */
.todo-ing.collapsed .todo-ing-head {
    padding: 0;
    border-bottom: none;
    background: transparent;
    justify-content: center;
    align-items: center;
    min-height: auto;
}
/* 展开按钮: 居中垂直展示 */
.todo-ing.collapsed .todo-ing-toggle {
    margin: auto;
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* 切换按钮 */
.todo-ing-toggle {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(249, 115, 22, 0.08);
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.12s;
}
.todo-ing-toggle:hover {
    background: rgba(249, 115, 22, 0.18);
}

/* 头部布局: title + count + toggle */
.todo-ing-head {
    gap: 8px;
}
.todo-ing-count {
    margin-left: auto;
}


/* ING 空状态 v2 - 示例卡片 */
.todo-ing-empty-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px 24px;
    text-align: center;
}
.empty-hero {
    font-size: 56px;
    margin-bottom: 12px;
    animation: empty-pulse 2.4s ease-in-out infinite;
}
@keyframes empty-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}
.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #1c1917;
    margin-bottom: 6px;
}
.empty-sub {
    font-size: 12px;
    color: #78716c;
    margin-bottom: 20px;
    line-height: 1.5;
}
.empty-samples {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-bottom: 16px;
}
.sample-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border-radius: 8px;
    border: 1px dashed #d6d3d1;
    font-size: 12px;
    color: #a8a29e;
}
.sample-card .ic { font-size: 16px; }
.sample-card .t { flex: 1; text-align: left; }
.sample-card .badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 100px;
    color: white;
    background: #f97316;
}
.sample-card .badge.wait { background: #10b981; }
.sample-card .badge.bg { background: #78716c; }
.empty-hint {
    font-size: 11px;
    color: #a8a29e;
    line-height: 1.6;
    padding: 12px;
    background: rgba(249,115,22,0.05);
    border-radius: 8px;
    border-left: 3px solid #f97316;
    text-align: left;
}


/* ===== 延续弹窗 ===== */
.continue-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.15s;
}
.continue-modal {
    background: white;
    border-radius: 14px;
    width: 480px; max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.2s;
}
.continue-modal-head {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f5f5f4;
}
.continue-modal-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    flex-shrink: 0;
}
.continue-modal-title {
    font-size: 16px; font-weight: 700; color: #1c1917;
}
.continue-modal-sub {
    font-size: 13px; color: #78716c;
    margin-top: 2px;
    max-width: 340px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.continue-modal-close {
    margin-left: auto;
    background: none; border: none;
    color: #a8a29e;
    font-size: 22px; cursor: pointer;
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.continue-modal-close:hover { background: #f5f5f4; color: #1c1917; }
.continue-modal-body {
    padding: 18px 22px;
}
.continue-modal-label {
    display: block;
    font-size: 13px; font-weight: 600; color: #44403c;
    margin-bottom: 8px;
}
.continue-modal-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #1c1917;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.continue-modal-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.continue-modal-hint {
    margin-top: 6px;
    font-size: 11.5px;
    color: #a8a29e;
}
.continue-modal-actions {
    padding: 12px 22px 18px;
    display: flex; gap: 8px; justify-content: flex-end;
    border-top: 1px solid #f5f5f4;
    background: #fafaf9;
}
.continue-modal-btn-cancel,
.continue-modal-btn-confirm {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.12s;
}
.continue-modal-btn-cancel {
    background: white;
    border-color: #e7e5e4;
    color: #57534e;
}
.continue-modal-btn-cancel:hover { background: #f5f5f4; }
.continue-modal-btn-confirm {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}
.continue-modal-btn-confirm:hover { filter: brightness(1.1); }
.continue-modal-btn-confirm:disabled { opacity: 0.6; cursor: wait; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }


/* === Chain 结构: CRUD actions === */
.chain-row {
    cursor: pointer;
    position: relative;
    transition: background 0.12s;
}
.chain-row:hover { background: rgba(254, 243, 199, 0.4); }
.chain-actions {
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity 0.12s;
    margin-left: 8px;
}
.chain-row:hover .chain-actions { opacity: 1; }
.chain-edit-btn,
.chain-del-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid #e7e5e4;
    background: white;
    color: #57534e;
    cursor: pointer;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.12s;
}
.chain-edit-btn:hover {
    background: #fff7ed; color: #c2410c;
    border-color: #fed7aa;
}
.chain-del-btn:hover {
    background: #fef2f2; color: #b91c1c;
    border-color: #fecaca;
}
.chain-row.current .chain-actions { opacity: 1; }


/* === Chain row edit 专门窗 === */
.chain-row-edit-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s;
}
.chain-row-edit-modal {
    background: white;
    border-radius: 14px;
    width: 460px; max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: slideUp 0.2s;
}
.chain-row-edit-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f5f5f4;
}
.chain-row-edit-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.chain-row-edit-title {
    font-size: 15px; font-weight: 700; color: #1c1917;
}
.chain-row-edit-sub {
    font-size: 12px; color: #78716c;
    margin-top: 2px;
}
.chain-row-edit-close {
    margin-left: auto;
    background: none; border: none;
    color: #a8a29e;
    font-size: 20px; cursor: pointer;
    width: 28px; height: 28px;
    border-radius: 6px;
}
.chain-row-edit-close:hover { background: #f5f5f4; color: #1c1917; }
.chain-row-edit-body {
    padding: 16px 20px;
}
.chain-row-edit-label {
    display: block;
    font-size: 12px; font-weight: 600; color: #57534e;
    margin-bottom: 6px; margin-top: 8px;
}
.chain-row-edit-label:first-child { margin-top: 0; }
.chain-row-edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #1c1917;
    outline: none;
    box-sizing: border-box;
}
.chain-row-edit-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.chain-row-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #1c1917;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}
.chain-row-edit-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.chain-row-edit-hint {
    margin-top: 8px;
    font-size: 11.5px;
    color: #a8a29e;
}
.chain-row-edit-actions {
    padding: 12px 20px 16px;
    display: flex; gap: 8px; justify-content: flex-end;
    border-top: 1px solid #f5f5f4;
    background: #fafaf9;
}
.chain-row-edit-btn-cancel,
.chain-row-edit-btn-confirm {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.12s;
}
.chain-row-edit-btn-cancel {
    background: white;
    border-color: #e7e5e4;
    color: #57534e;
}
.chain-row-edit-btn-cancel:hover { background: #f5f5f4; }
.chain-row-edit-btn-confirm {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}
.chain-row-edit-btn-confirm:hover { filter: brightness(1.1); }
.chain-row-edit-btn-confirm:disabled { opacity: 0.6; cursor: wait; }

/* tag picker \u7236\u7ea7\u8def\u5f84\u6837\u5f0f */
.tag-pick-parent {
    color: #a8a29e;
    font-size: 11px;
    font-weight: normal;
}
.tag-pick-leaf {
    color: var(--text-2);
    font-weight: 500;
}
