/*! 日程通服务端 · 界面设计系统（滴答清单 dida365 风格）
 *  纯 CSS，无构建步骤、无外部依赖（不引 CDN，内网/离线可用）
 *  约定：旧类名（.card/.btn/.row/.pill/.muted/.ok/.err/pre.report/table）全部保留，
 *        因此任何页面都能平滑获得新外观；新组件类前缀统一为 xc-。
 *  色板：品牌蓝 #4772FA；优先级 高#E5533D 中#F2994A 低#4A90E2；正文 #202020。
 */
:root {
    --brand: #4772fa;
    --brand-strong: #3a63e0;
    --brand-soft: #eef2ff;
    --brand-softer: #f5f7ff;
    --bg: #f7f8fa;
    --bg-sunken: #f2f3f5;
    --surface: #ffffff;
    --sidebar: #f6f7f9;
    --hover: #f0f1f3;
    --active: #e8edff;

    --fg: #202020;
    --fg-2: #4a4a4a;
    --mut: #8a8f99;
    --mut-2: #b0b5bd;

    --bd: #ebedf0;
    --bd-strong: #dfe2e7;

    --pri-high: #e5533d;
    --pri-mid: #f2994a;
    --pri-low: #4a90e2;
    --ok: #27ae60;
    --ok-soft: #eaf7f0;
    --warn: #f2994a;
    --danger: #e5533d;
    --danger-soft: #fdeeeb;

    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --r-pill: 999px;

    --sd-1: 0 1px 2px rgba(16, 24, 40, .06);
    --sd-2: 0 2px 8px rgba(16, 24, 40, .08);
    --sd-3: 0 8px 28px rgba(16, 24, 40, .14);

    --sidebar-w: 236px;
    --topbar-h: 56px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font: 14px/1.62 var(--font);
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 600; color: var(--fg); line-height: 1.35; }
h1 { font-size: 20px; letter-spacing: .2px; }
h2 { font-size: 15px; margin: 22px 0 10px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }

code, kbd {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--bg-sunken);
    color: #33415c;
    padding: 2px 6px;
    border-radius: var(--r-sm);
    word-break: break-all;
}

pre.report {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    padding: 16px 18px;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.75;
    color: var(--fg-2);
    box-shadow: var(--sd-1);
}

hr { border: 0; border-top: 1px solid var(--bd); margin: 18px 0; }

.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hide { display: none !important; }
.grow { flex: 1 1 auto; }

/* ---------------------------------------------------------------- 按钮 */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    font: 500 13.5px/1 var(--font);
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .06s;
    -webkit-appearance: none;
    appearance: none;
}
button:hover, .btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 2px solid rgba(71, 114, 250, .45);
    outline-offset: 1px;
}
button[disabled], .btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn.ghost, button.ghost {
    background: var(--surface);
    color: var(--fg-2);
    border-color: var(--bd-strong);
    box-shadow: none;
}
.btn.ghost:hover, button.ghost:hover { background: var(--hover); color: var(--fg); border-color: #cfd4db; }

.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn.soft:hover { background: #e3e9ff; color: var(--brand-strong); }

.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #cf4530; border-color: #cf4530; }

.btn.link { background: none; border-color: transparent; color: var(--brand); padding: 0 6px; height: auto; }
.btn.link:hover { background: none; color: var(--brand-strong); text-decoration: underline; }

.btn.sm { height: 26px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn.lg { height: 40px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.btn.block { width: 100%; }

/* 行内图标按钮（列表/卡片右侧操作） */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    padding: 0;
    color: var(--mut);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }
svg { display: block; flex: none; }

/* ---------------------------------------------------------------- 表单 */
label { display: block; font-size: 12.5px; color: var(--mut); font-weight: 500; }

input[type=text], input[type=password], input[type=email], input[type=date], input[type=number],
input[type=url], input[type=tel], input[type=search], input:not([type]), select, textarea {
    width: 100%;
    min-height: 32px;
    padding: 5px 10px;
    font: 400 13.5px/1.5 var(--font);
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--bd-strong);
    border-radius: var(--r-sm);
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
}
textarea { min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
}
input:hover, select:hover, textarea:hover { border-color: #ccd2da; }
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(71, 114, 250, .13);
    outline: none;
}
input[type=checkbox], input[type=radio] {
    width: 15px; height: 15px; min-height: 0; padding: 0; margin: 0 4px 0 0;
    vertical-align: -2px; accent-color: var(--brand);
}
input[type=file] { padding: 4px; }
::placeholder { color: var(--mut-2); }

/* 表单行：<div class="row"><div><label/><input/></div>…</div> */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row.stack, .row[style*="column"] { align-items: stretch; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* ---------------------------------------------------------------- 卡片 */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--sd-1);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.tight { padding: 12px 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--bd);
}
.card-hd h2, .card-hd h3 { margin: 0; }
.card-bd { padding: 16px 18px; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* 统计小块（滴答首页的「今日/已完成」那种数字块） */
.tile {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--sd-1);
}
.tile .k { font-size: 12.5px; color: var(--mut); display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 24px; font-weight: 600; letter-spacing: .3px; line-height: 1.3; }
.tile .v small { font-size: 12.5px; color: var(--mut); font-weight: 500; margin-left: 4px; }
.tile .d { font-size: 12px; color: var(--mut-2); }
.tile.is-brand .v { color: var(--brand); }
.tile.is-danger .v { color: var(--danger); }
.tile.is-ok .v { color: var(--ok); }
.tile.is-warn .v { color: var(--warn); }

/* 任务树：主任务/子任务阶梯缩进（--depth 由模板按层级写进行内样式） */
.task-row { position: relative; padding-left: calc(12px + var(--depth, 0) * 22px); }
.task-row::before {
    content: "";
    position: absolute; top: 0; bottom: 0;
    left: calc(12px + (var(--depth, 1) - 1) * 22px + 8px);
    border-left: 1px dashed #e1e4e9;
    display: none;
}
.task-row[data-depth]:not([data-depth="0"])::before { display: block; }
.task-row[data-depth]:not([data-depth="0"]) .task-title { font-size: 13.5px; }
.task-row[data-depth]:not([data-depth="0"]) .check { width: 16px; height: 16px; }
.task-row[data-depth]:not([data-depth="0"]) .check svg { width: 10px; height: 10px; }

.twist {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin: 3px 2px 0 -2px; padding: 0;
    border: 0; background: transparent; color: var(--mut);
    border-radius: 4px; cursor: pointer;
}
.twist svg { width: 12px; height: 12px; transition: transform .15s; }
.twist:hover { background: var(--hover); color: var(--fg); }
.twist[aria-expanded="false"] svg { transform: rotate(-90deg); }
.twist-ghost { flex: none; width: 18px; margin-right: 2px; }
.subcount {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11.5px; color: var(--mut);
    background: var(--bg-sunken); border-radius: var(--r-pill); padding: 0 7px; line-height: 17px;
}
.subcount.all-done { background: var(--ok-soft); color: #1e8e4e; }

/* 明细页：父任务面包屑 + 子任务列表 */
.subtasks { display: flex; flex-direction: column; }
.subtask {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 0 8px 10px;
    border-bottom: 1px dashed var(--bd);
    border-left: 2px solid var(--bd);
    margin-left: 2px;
}
.subtask:last-child { border-bottom: 0; }
.subtask .t { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.subtask .t a { color: inherit; }
.subtask .t a:hover { color: var(--brand); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); margin-bottom: 8px; }
.breadcrumb svg { width: 13px; height: 13px; }

/* ==================================================================
 *  日历：侧栏迷你日历 + 月 / 周 / 日程视图
 * ================================================================== */
.mini-cal {
    margin: 4px 2px 10px;
    padding: 8px 8px 6px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--sd-1);
}
.mc-hd { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; }
.mc-hd .icon-btn { width: 22px; height: 22px; }
.mc-hd .icon-btn svg { width: 13px; height: 13px; }
.mc-title { flex: 1 1 auto; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.mc-title:hover { color: var(--brand); }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mc-dow { text-align: center; font-size: 10.5px; color: var(--mut-2); line-height: 18px; }
.mc-day {
    position: relative;
    display: grid; place-items: center;
    height: 22px;
    font-size: 11.5px;
    color: var(--fg-2);
    border-radius: var(--r-sm);
}
.mc-day:hover { background: var(--hover); color: var(--fg); }
.mc-day.is-out { color: var(--mut-2); }
.mc-day.is-today { background: var(--brand); color: #fff; font-weight: 600; }
.mc-day.is-today:hover { background: var(--brand-strong); color: #fff; }
.mc-day.has-items::after {
    content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    width: 3px; height: 3px; border-radius: 50%; background: var(--brand);
}
.mc-day.is-today.has-items::after { background: #fff; }

/* 日历视图：月 */
.cal { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-lg); box-shadow: var(--sd-1); overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fafbfc; border-bottom: 1px solid var(--bd); }
.cal-dow span { padding: 8px 10px; font-size: 12px; color: var(--mut); font-weight: 600; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 116px; padding: 4px 5px 6px; border-right: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-out { background: #fcfcfd; }
.cal-cell.is-out .cal-daynum { color: var(--mut-2); }
.cal-cell.is-today { background: var(--brand-softer); }
.cal-daynum {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px; margin-bottom: 2px;
    font-size: 12px; color: var(--fg-2); border-radius: 50%;
}
.cal-cell.is-today .cal-daynum { background: var(--brand); color: #fff; font-weight: 600; }
.cal-daynum:hover { background: var(--hover); color: var(--fg); }
.cal-cell.is-today .cal-daynum:hover { background: var(--brand-strong); color: #fff; }
.cal-items { display: flex; flex-direction: column; gap: 2px; }
.cal-chip {
    display: flex; align-items: center; gap: 4px;
    padding: 1px 5px;
    border-radius: var(--r-sm);
    font-size: 11.5px; line-height: 17px;
    color: var(--fg-2);
    overflow: hidden;
}
.cal-chip .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip .tm { color: inherit; opacity: .75; font-variant-numeric: tabular-nums; flex: none; }
.cal-chip .rec { flex: none; opacity: .7; }
.cal-chip.ev { background: #eaf0ff; color: #2f4bb8; }
.cal-chip.ev.mini { display: inline-flex; background: #eaf0ff; color: #2f4bb8; padding: 0 6px; }
.cal-chip.tk { background: transparent; padding-left: 2px; }
.cal-chip.tk a { color: var(--fg); }
.cal-chip.tk a:hover { color: var(--brand); }
.cal-chip.tk.is-done a { color: var(--mut); text-decoration: line-through; }
.cal-chip.tk.is-overdue { background: var(--danger-soft); }
.cal-chip.tk.is-overdue a { color: #a5371f; }
.cal-more { font-size: 11.5px; color: var(--brand); padding-left: 2px; }
.cal-more:hover { text-decoration: underline; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 12px; font-size: 12px; color: var(--mut); border-top: 1px solid var(--bd); background: #fafbfc; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* 日历视图：周 */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-col { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-lg); box-shadow: var(--sd-1); padding: 8px; min-height: 200px; }
.cal-col.is-today { border-color: #c9d6ff; box-shadow: 0 0 0 3px rgba(71, 114, 250, .08); }
.cal-col-hd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--bd); }
.cal-col-hd b, .cal-col-hd > span { white-space: nowrap; }
.cal-col-hd b { font-size: 13px; }
.cal-col-hd .icon-btn { margin-left: auto; }
.cal-ev {
    display: flex; gap: 6px;
    padding: 4px 6px; margin-bottom: 3px;
    background: #eaf0ff; color: #2f4bb8;
    border-radius: var(--r-sm);
    font-size: 12px; line-height: 1.5;
}
.cal-ev .tm { flex: none; opacity: .8; font-variant-numeric: tabular-nums; }
.cal-ev .tx { min-width: 0; word-break: break-word; }
.cal-tk { display: flex; align-items: flex-start; gap: 6px; padding: 4px 2px; font-size: 12.5px; }
.cal-tk .tx { min-width: 0; }
.cal-tk .tx a { color: var(--fg); }
.cal-tk .tx a:hover { color: var(--brand); }
.cal-tk.is-done .tx a { color: var(--mut); text-decoration: line-through; }
.cal-tk .muted { display: block; font-size: 11.5px; }
.cal-empty { color: var(--mut-2); text-align: center; font-size: 12px; padding: 12px 0; }

/* 日历视图：日程（列表） */
.cal-agenda { display: flex; flex-direction: column; gap: 10px; }
.ag-day { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-lg); box-shadow: var(--sd-1); padding: 10px 14px; }
.ag-date { flex: none; width: 74px; display: flex; flex-direction: column; }
.ag-date b { font-size: 15px; }
.ag-date span { font-size: 11.5px; color: var(--mut); }
.ag-date.is-today b { color: var(--brand); }
.ag-items { flex: 1 1 auto; min-width: 0; }

/* ---------------------------------------------------------------- 表格 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sd-1);
    font-size: 13.5px;
}
th, td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--bd); }
th {
    background: #fafbfc;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mut);
    white-space: nowrap;
}
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
table tr:hover td { background: #fcfcfd; }
td.actions, th.actions { white-space: nowrap; text-align: right; }
td.actions form, .inline-form { display: inline; }
td.actions .btn, td.actions button { margin-left: 4px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table-wrap table { min-width: 640px; }

/* 表格里的一行主标题+副标题 */
.cell-main { font-weight: 500; color: var(--fg); }
.cell-sub { font-size: 12px; color: var(--mut); margin-top: 2px; }

/* ---------------------------------------------------------------- 徽标/标签 */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    padding: 1px 9px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
}
.pill.gray { background: var(--bg-sunken); color: var(--mut); }
.pill.ok { background: var(--ok-soft); color: #1e8e4e; }
.pill.warn { background: #fdf3e8; color: #c9762a; }
.pill.danger { background: var(--danger-soft); color: #c0402c; }
.pill.high { background: #fdeeeb; color: var(--pri-high); }
.pill.mid { background: #fdf3e8; color: #c9762a; }
.pill.low { background: #ecf3fd; color: #2f74c0; }

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-sunken);
    color: var(--fg-2);
    border-radius: var(--r-sm);
    padding: 1px 7px;
    font-size: 12px;
    line-height: 18px;
}
.dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; display: inline-block; background: var(--mut-2); flex: none; }
.dot.high { background: var(--pri-high); }
.dot.mid { background: var(--pri-mid); }
.dot.low { background: var(--pri-low); }
.dot.ok { background: var(--ok); }
.dot.danger { background: var(--danger); }
.dot.brand { background: var(--brand); }

/* ---------------------------------------------------------------- 提示条
 *  注意：.ok/.warn 同时也是 .pill/.dot/.bar 的修饰类（.pill.ok / .dot.ok / .bar.ok），
 *  因此这里的旧名选择器用 :not() 排除组件，避免把 10px/14px 的内边距套到小圆点与胶囊上。 */
.alert, .ok:not(.pill):not(.dot):not(.bar):not(.tag), .err, .alert-err, .flash, .alert-info,
.warn:not(.pill):not(.dot):not(.bar):not(.tag), .alert-warn {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 14px;
    border-radius: var(--r);
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.ok:not(.pill):not(.dot):not(.bar):not(.tag), .alert-ok { background: var(--ok-soft); border-color: #bfe6d1; color: #17663c; }
.err, .alert-err { background: var(--danger-soft); border-color: #f6cfc8; color: #a5371f; }
.warn:not(.pill):not(.dot):not(.bar):not(.tag), .alert-warn { background: #fdf6ec; border-color: #f6e0c0; color: #8a5a1c; }
.flash, .alert-info { background: var(--brand-softer); border-color: #d9e1ff; color: #2f4bb8; }
.alert code, .ok code, .err code, .warn code, .flash code { background: rgba(255, 255, 255, .7); }

/* 空状态 */
.empty {
    text-align: center;
    color: var(--mut);
    padding: 46px 20px;
    background: var(--surface);
    border: 1px dashed var(--bd-strong);
    border-radius: var(--r-lg);
}
.empty svg { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--mut-2); }
.empty b { display: block; color: var(--fg-2); font-size: 14px; margin-bottom: 4px; }

/* ==================================================================
 *  1) 应用外壳（租户后台 /app）：左侧清单栏 + 顶部条 + 内容区
 * ================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--bd);
    z-index: 40;
}
.sidebar-top {
    display: flex; align-items: center; gap: 10px;
    height: var(--topbar-h);
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--bd);
}
.brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: var(--fg);
    text-decoration: none;
    letter-spacing: .2px;
}
.brand:hover { color: var(--brand); }
.brand .logo {
    display: grid; place-items: center;
    width: 26px; height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4772fa, #6f8dff);
    color: #fff;
}
.brand .logo svg { width: 15px; height: 15px; }
.brand .sub { font-size: 11.5px; color: var(--mut); font-weight: 500; }

.side-search { padding: 12px 12px 6px; }
.side-search form { position: relative; }
.side-search svg {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--mut-2);
}
.side-search input {
    padding-left: 28px;
    background: var(--surface);
    border-color: transparent;
    box-shadow: var(--sd-1);
    height: 32px;
}

.side-nav { flex: 1 1 auto; overflow-y: auto; padding: 6px 10px 16px; }
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-thumb { background: #dcdfe4; border-radius: 8px; }
.side-group { margin-top: 10px; }
.side-group:first-child { margin-top: 0; }
.side-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--mut-2);
    letter-spacing: .4px;
}
.side-item {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    height: 34px;
    padding: 0 9px;
    margin: 1px 0;
    border-radius: var(--r-sm);
    color: var(--fg-2);
    font-size: 13.5px;
    text-decoration: none;
    transition: background .14s, color .14s;
}
.side-item:hover { background: var(--hover); color: var(--fg); }
.side-item svg { width: 16px; height: 16px; color: var(--mut); }
.side-item:hover svg { color: var(--fg-2); }
.side-item .label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .count {
    font-size: 11.5px;
    color: var(--mut);
    background: #e9eaee;
    border-radius: var(--r-pill);
    padding: 0 7px;
    line-height: 17px;
    min-width: 20px;
    text-align: center;
}
.side-item.active { background: var(--active); color: var(--brand); font-weight: 600; }
.side-item.active svg { color: var(--brand); }
.side-item.active .count { background: #fff; color: var(--brand); }
/* 选中项：只保留浅蓝底 + 蓝字加粗（不再画左侧竖条）。
   注意：这里曾用 .side-item .bar 当指示条，与下方「工作量进度条」的 .bar 类名冲突
   （进度条带 min-width:90px / height:8px），被撑成一条大蓝条 —— 别再用 .bar 这个类名。 */

.side-foot {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px;
    border-top: 1px solid var(--bd);
    background: #f2f3f6;
}
.avatar {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f8dff, #4772fa);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex: none;
}
.avatar.gray { background: linear-gradient(135deg, #b9bfc9, #98a0ad); }
.side-foot .who { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.side-foot .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { display: block; font-size: 11.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 auto; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    min-height: var(--topbar-h);
    padding: 8px 22px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--bd);
}
.page-title { margin: 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.page-title .pill { font-weight: 500; }
.topbar .spacer { flex: 1 1 auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-actions .btn, .topbar-actions button { height: 30px; }

.content { padding: 20px 22px 56px; max-width: 1440px; width: 100%; }
.content.narrow { max-width: 720px; }
.content.center-page { max-width: 560px; margin: 0 auto; padding-top: 34px; }

.nav-toggle, .nav-scrim { display: none; }

/* 分段视图切换（列表/看板/甘特/工作量） */
.segmented {
    display: inline-flex;
    padding: 2px;
    background: var(--bg-sunken);
    border-radius: var(--r);
    gap: 2px;
}
.segmented a {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--fg-2);
    font-size: 13px;
    text-decoration: none;
}
.segmented a:hover { color: var(--fg); background: rgba(255, 255, 255, .7); }
.segmented a.active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--sd-1); }
.segmented svg { width: 15px; height: 15px; }

/* 工具条：筛选条 + 计数 */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.toolbar .sep { width: 1px; height: 18px; background: var(--bd-strong); }
.chipbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filterbar {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--sd-1);
}
.filterbar summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-2);
    list-style: none;
    display: flex; align-items: center; gap: 8px;
}
.filterbar summary::-webkit-details-marker { display: none; }
.filterbar summary .chev { transition: transform .18s; color: var(--mut); }
.filterbar[open] summary .chev { transform: rotate(90deg); }
.filterbar[open] summary { margin-bottom: 12px; }

/* ==================================================================
 *  2) 任务列表（滴答式任务行：圆环复选框 + 标题 + 元信息）
 * ================================================================== */
.task-list { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-lg); box-shadow: var(--sd-1); overflow: hidden; }
.task-group-hd {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: #fafbfc;
    border-bottom: 1px solid var(--bd);
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-2);
}
.task-group-hd .count { color: var(--mut); font-weight: 500; }

.task-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 16px 9px 12px;
    border-bottom: 1px solid #f2f3f5;
    transition: background .12s;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fbfcfe; }
.task-row.is-done .task-title { color: var(--mut); text-decoration: line-through; }
.task-row.is-overdue { background: #fffbfa; }

.check {
    position: relative;
    flex: none;
    width: 18px; height: 18px;
    margin-top: 2px;
    padding: 0;
    border: 1.6px solid var(--mut-2);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.check:hover { border-color: var(--brand); background: var(--brand-softer); }
.check svg { width: 12px; height: 12px; margin: 0 auto; color: #fff; opacity: 0; transition: opacity .12s; }
.check.checked { background: var(--brand); border-color: var(--brand); }
.check.checked svg { opacity: 1; }
.check.p-high { border-color: var(--pri-high); }
.check.p-high:hover { background: #fdeeeb; }
.check.p-high.checked { background: var(--pri-high); border-color: var(--pri-high); }
.check.p-mid { border-color: var(--pri-mid); }
.check.p-mid:hover { background: #fdf3e8; }
.check.p-mid.checked { background: var(--pri-mid); border-color: var(--pri-mid); }
.check.p-low { border-color: var(--pri-low); }
.check.p-low.checked { background: var(--pri-low); border-color: var(--pri-low); }
.check.inline-form { display: inline-flex; }

.checkform { flex: none; display: flex; margin: 0; }
.checkform .check { margin-top: 2px; }

.task-main { flex: 1 1 auto; min-width: 0; }
.task-title { font-size: 14px; color: var(--fg); word-break: break-word; }
.task-title a { color: inherit; }
.task-title a:hover { color: var(--brand); }
.task-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 3px;
    font-size: 12px;
    color: var(--mut);
}
.task-meta .meta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.task-meta .meta svg { width: 12px; height: 12px; }
.task-meta .due { color: var(--mut); }
.task-meta .due.overdue { color: var(--danger); font-weight: 600; }
.task-meta .due.today { color: var(--brand); font-weight: 600; }
.task-desc { margin-top: 3px; font-size: 12.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.task-side { display: flex; align-items: center; gap: 6px; flex: none; }
.task-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .14s; }
.task-row:hover .task-actions, .task-row:focus-within .task-actions { opacity: 1; }
.task-progress { width: 54px; height: 5px; border-radius: 3px; background: var(--bg-sunken); overflow: hidden; }
.task-progress span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* 内联快速添加（滴答的「+ 添加任务」） */
.quick-add {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    box-shadow: var(--sd-1);
    margin-bottom: 14px;
}
.quick-add .plus { color: var(--brand); flex: none; }
.quick-add input[name=summary] { flex: 1 1 auto; border-color: transparent; background: transparent; font-size: 14px; }
.quick-add input[name=summary]:hover { background: var(--bg); }
.quick-add input[name=summary]:focus { background: var(--surface); border-color: var(--brand); }
.quick-add .extra { display: flex; align-items: center; gap: 8px; }
.quick-add:focus-within { border-color: #cdd7ff; box-shadow: 0 0 0 3px rgba(71, 114, 250, .08); }

/* ==================================================================
 *  3) 看板
 * ================================================================== */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.board-col {
    flex: 1 1 0;
    min-width: 258px;
    background: var(--bg-sunken);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 10px;
}
.board-col > h3 {
    display: flex; align-items: center; gap: 7px;
    margin: 2px 4px 10px;
    font-size: 13px;
    color: var(--fg-2);
}
.board-col > h3 .count {
    font-size: 11.5px; color: var(--mut); background: #fff;
    border-radius: var(--r-pill); padding: 0 7px; line-height: 17px;
}
.board-card {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-left: 3px solid var(--mut-2);
    border-radius: var(--r);
    padding: 10px 12px;
    margin-bottom: 9px;
    box-shadow: var(--sd-1);
    transition: box-shadow .14s, transform .14s;
}
.board-card:hover { box-shadow: var(--sd-2); }
.board-card .t { font-size: 13.5px; font-weight: 500; margin-bottom: 5px; word-break: break-word; }
.board-card .m { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.board-card .m .meta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.board-card .m svg { width: 12px; height: 12px; }
.board-card .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; opacity: .55; transition: opacity .14s; }
.board-card:hover .acts { opacity: 1; }
.board-card.p-high { border-left-color: var(--pri-high); }
.board-card.p-mid { border-left-color: var(--pri-mid); }
.board-card.p-low { border-left-color: var(--pri-low); }

/* ==================================================================
 *  4) 甘特
 * ================================================================== */
.gantt { overflow-x: auto; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-lg); box-shadow: var(--sd-1); padding: 16px 18px 18px; }
.gantt-inner { position: relative; padding-left: 236px; min-width: 720px; }
.gantt-head { position: relative; height: 26px; border-bottom: 1px solid var(--bd-strong); }
.gantt-tick { position: absolute; top: 0; height: 26px; border-left: 1px solid #f0f1f3; }
.gantt-label { position: absolute; top: 0; height: 26px; line-height: 26px; padding-left: 4px; font-size: 10.5px; color: var(--mut); white-space: nowrap; }
.gantt-today { position: absolute; top: 0; bottom: -100000px; width: 1px; background: var(--danger); opacity: .75; pointer-events: none; }
.gantt-today::before {
    content: ""; position: absolute; top: -1px; left: -3px;
    width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}
.gantt-row { position: relative; height: 32px; border-bottom: 1px dashed #f2f3f5; }
.gantt-row:hover { background: #fbfcfe; }
.gantt-name {
    position: absolute; left: -236px; top: 7px; width: 224px;
    font-size: 12.5px; color: var(--fg-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gantt-bar {
    position: absolute; top: 8px; height: 16px;
    border-radius: var(--r-pill);
    background: var(--brand);
    box-shadow: var(--sd-1);
    display: flex; align-items: center;
    overflow: hidden;
}
.gantt-bar span { font-size: 10px; color: #fff; padding-left: 7px; font-weight: 600; }

/* ==================================================================
 *  5) 工作量 / 进度条
 * ================================================================== */
.bar { height: 8px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--pri-mid); }
.bar.blue-soft { background: #e8f0fe; }
.bar.blue-soft > span { background: #4a90e2; }
.bar.orange-soft { background: #fdf3e8; }
.bar.orange-soft > span { background: var(--pri-mid); }

/* ==================================================================
 *  6) 登录 / 前台 / 公开页
 * ================================================================== */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.public-nav {
    display: flex; align-items: center; gap: 18px;
    height: 60px; padding: 0 28px;
    border-bottom: 1px solid var(--bd);
    background: rgba(255, 255, 255, .94);
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(8px);
}
.public-nav .brand { font-size: 16px; }
.public-nav nav { display: flex; gap: 16px; align-items: center; margin-left: auto; }
.public-nav nav a { color: var(--fg-2); font-size: 13.5px; }
.public-nav nav a:hover { color: var(--brand); }
.public-body { flex: 1 1 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: 26px 24px 64px; }
.public-shell .footer { border-top: 1px solid var(--bd); color: var(--mut); font-size: 12.5px; }
.public-shell .footer .inner { max-width: 1080px; margin: 0 auto; padding: 16px 24px; display: flex; gap: 10px; flex-wrap: wrap; }

.hero { text-align: center; padding: 40px 10px 26px; }
.hero h1 { font-size: 30px; line-height: 1.35; letter-spacing: .2px; margin-bottom: 12px; }
.hero p { color: var(--mut); font-size: 15px; max-width: 720px; margin: 0 auto 6px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.hero .badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--sd-1);
    display: flex; flex-direction: column; gap: 10px;
    transition: box-shadow .16s, transform .16s, border-color .16s;
}
.plan:hover { box-shadow: var(--sd-2); transform: translateY(-2px); }
.plan .name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.plan .price { font-size: 26px; font-weight: 700; color: var(--fg); letter-spacing: .3px; }
.plan .price small { font-size: 12.5px; color: var(--mut); font-weight: 500; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--fg-2); }
.plan ul li { display: flex; align-items: center; gap: 8px; }
.plan ul li svg { width: 14px; height: 14px; color: var(--ok); flex: none; }

.auth-wrap { display: flex; flex-direction: column; align-items: center; padding: 6vh 20px 60px; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
    padding: 26px 26px 22px;
    box-shadow: var(--sd-2);
}
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .lead { color: var(--mut); font-size: 13px; margin-bottom: 18px; }
.auth-card .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.auth-card .field label { font-size: 12.5px; color: var(--fg-2); }
.auth-card input { height: 36px; }
.auth-card button[type=submit] { width: 100%; height: 38px; font-size: 14.5px; margin-top: 6px; }
.auth-card .hint { margin-top: 14px; font-size: 12.5px; color: var(--mut); line-height: 1.7; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font-weight: 700; font-size: 16px; }
.auth-foot { margin-top: 16px; font-size: 12.5px; color: var(--mut); text-align: center; }

.copyline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copyline code { flex: 0 1 auto; }

.kv { display: grid; grid-template-columns: 128px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; word-break: break-all; }

/* 详情页两栏（任务明细：左字段，右操作/注释） */
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.field-table th { width: 132px; background: #fafbfc; color: var(--fg-2); font-weight: 500; }
.comment {
    display: flex; gap: 9px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--bd);
    font-size: 13.5px;
}
.comment:last-child { border-bottom: 0; }
.comment .idx { color: var(--mut-2); font-family: var(--font-mono); font-size: 12px; flex: none; }
.comment .body { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; word-break: break-word; }

.qrbox {
    display: grid; place-items: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r-lg);
}
.qrbox svg { width: 190px; height: 190px; }

/* 步骤条（配置指引） */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--bd); }
.step:last-child { border-bottom: 0; }
.step .no {
    flex: none; display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    font-size: 12px; font-weight: 700;
}
.step .body { font-size: 13.5px; color: var(--fg-2); }
.step .body b { color: var(--fg); }

/* ==================================================================
 *  7) 响应式
 * ================================================================== */
@media (max-width: 1180px) {
    .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--sd-3); }
    .main { margin-left: 0; }
    .nav-toggle { display: inline-flex; }
    .nav-scrim {
        display: none; position: fixed; inset: 0; z-index: 35;
        background: rgba(16, 24, 40, .38);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-scrim { display: block; }
    .topbar { padding: 8px 14px; }
    .content { padding: 14px 14px 48px; }
    .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gantt-inner { padding-left: 150px; }
    .gantt-name { left: -150px; width: 140px; }
    .cal { overflow-x: auto; }
    .cal-dow, .cal-grid { min-width: 760px; }
    .cal-week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .grid.c2, .grid.c3, .grid.c4, .grid.auto { grid-template-columns: minmax(0, 1fr); }
    .hero h1 { font-size: 23px; }
    .public-nav { padding: 0 16px; gap: 10px; }
    .public-body { padding: 18px 16px 48px; }
    .card { padding: 14px; }
    .row { gap: 10px; }
    .row > div { flex: 1 1 100% !important; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dt { margin-top: 8px; }
    .board { flex-direction: column; }
    .board-col { width: 100%; }
    .cal-week { grid-template-columns: minmax(0, 1fr); }
    .ag-day { flex-direction: column; gap: 6px; }
    .ag-date { width: auto; flex-direction: row; gap: 8px; align-items: baseline; }
}
@media print {
    .sidebar, .topbar, .nav-scrim, .topbar-actions, .filterbar { display: none !important; }
    .main { margin-left: 0; }
    .card, table { box-shadow: none; }
}
