/* ============================================
   科室协同管理平台 - Milanote 真实风格 CSS
   极简黑白灰 · 64px 窄侧栏 · 深色顶栏
   ============================================ */

/* ====== 变量 ====== */
:root {
    /* 顶栏 & 暗色 */
    --topbar-bg: #2b2d31;
    --topbar-text: #e0e0e0;
    --topbar-text-dim: #8a8a8a;

    /* 侧栏 */
    --sidebar-w: 64px;
    --sidebar-bg: #f7f6f3;
    --sb-text: #555;
    --sb-text-active: #222;
    --sb-hover-bg: #eeebe5;
    --sb-active-bg: #ddd9cf;

    /* 画布 */
    --canvas-bg: #fafafa;
    --dot-color: rgba(180, 180, 180, 0.35);

    /* 卡片 */
    --card-bg: #fff;
    --card-border: #dddcd7;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 6px 16px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.04);

    /* 文字 */
    --text-primary: #2c2c2a;
    --text-secondary: #666;
    --text-tertiary: #999;

    /* 功能色 */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;

    /* 圆角 */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
}

/* 暗色模式 */
body.dark {
    --topbar-bg: #1a1a1a;
    --topbar-text: #ccc;
    --topbar-text-dim: #666;
    --sidebar-bg: #1e1e1e;
    --sb-text: #999;
    --sb-text-active: #e0e0e0;
    --sb-hover-bg: #2a2a2a;
    --sb-active-bg: #333;
    --canvas-bg: #141414;
    --dot-color: rgba(255,255,255,0.04);
    --card-bg: #1e1e1e;
    --card-border: #333;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 6px 20px rgba(0,0,0,0.4);
    --text-primary: #e8e8e8;
    --text-secondary: #aaa;
    --text-tertiary: #666;
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--canvas-bg);
    -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; outline: none; }
input, select, textarea {
    font: inherit;
    color: inherit;
    outline: none;
}
label { font-weight: 500; color: var(--text-secondary); font-size: 12px; display: block; margin-bottom: 4px; }

/* ====== 点阵背景（画布）===== */
body.light .canvas::before,
body:not(.dark) .canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1.2px, transparent 1.2px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}
body.dark .canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}


/* ====== 顶部导航栏（深色）====== */
.topbar {
    height: 40px;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    display: flex;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 100;
    user-select: none;
}
.topbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}
.topbar-icon-btn {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--topbar-text);
    transition: background 0.15s;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,0.08); }
.topbar-breadcrumb { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.topbar-sep { color: var(--topbar-text-dim); font-size: 12px; margin: 0 2px; }
.topbar-page { font-size: 13px; color: var(--topbar-text-dim); }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-select {
    height: 26px;
    max-width: 150px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.06);
    color: var(--topbar-text);
    font-size: 12px;
    padding: 0 8px;
}
.team-select option {
    color: #222;
}
.user-chip {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--topbar-text-dim);
    padding: 0 4px;
}
.notify-btn {
    position: relative;
}
.notify-badge {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    line-height: 14px;
    font-weight: 700;
}
.notify-badge.show {
    display: block;
}

/* 胶囊标签页 */
.tab-pill {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--topbar-text-dim);
    transition: all 0.15s;
}
.tab-pill:hover { color: var(--topbar-text); background: rgba(255,255,255,0.06); }
.tab-pill.active {
    background: rgba(255,255,255,0.12);
    color: var(--topbar-text);
}

/* 搜索 */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--r-sm);
    padding: 4px 10px;
    margin-left: 8px;
}
.search-wrap input {
    background: none;
    border: none;
    color: var(--topbar-text);
    font-size: 12px;
    width: 120px;
}
.search-wrap input::placeholder { color: var(--topbar-text-dim); }

.icon-btn {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--topbar-text-dim);
    transition: all 0.15s;
}
.icon-btn:hover { color: var(--topbar-text); background: rgba(255,255,255,0.06); }


/* ====== 主体布局 ====== */
.app-body {
    display: flex;
    height: calc(100vh - 40px);
    overflow: hidden;
}


/* ====== 左侧极窄工具栏（Milanote 风格 ~64px）===== */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.07);
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* 导航组 */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    gap: 2px;
    width: 100%;
}

/* 单个工具项：图标居中 + 小字标签 */
.sb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: auto;
    min-height: 52px;
    padding: 6px 4px 8px;
    border-radius: var(--r-md);
    color: var(--sb-text);
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.sb-item:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-active);
}
.sb-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-text-active);
}
.sb-item svg {
    flex-shrink: 0;
}
.sb-item.small {
    min-height: 42px;
    opacity: 0.6;
    font-size: 9px;
    padding: 4px 2px 6px;
}
.sb-item.small:hover { opacity: 1; }
.sb-item.reset { color: var(--text-tertiary); }
.sb-item.reset:hover { color: var(--danger); }

/* 分隔线 */
.sb-sep {
    height: 1px;
    width: 32px;
    background: rgba(0,0,0,0.09);
    margin: 4px auto;
}

/* 标签 */
.sb-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 8px 0 2px;
}

/* 底部弹性空间 */
.sb-spacer { flex: 1; }
.sb-bottom { padding-bottom: 12px; }


/* ====== 日期导航（侧栏内）===== */
.date-nav {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0,0,0,0.04);
    border-radius: var(--r-sm);
    padding: 2px;
    margin-bottom: 2px;
}
.date-arrow {
    width: 22px; height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    font-size: 16px;
    color: var(--text-secondary);
    transition: background 0.12s;
}
.date-arrow:hover { background: rgba(0,0,0,0.06); }
.date-text {
    font-size: 11px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ====== 筛选下拉面板 ====== */
.filter-dropdown {
    display: none;
    flex-direction: column;
    gap: 2px;
    width: 56px;
    padding: 6px 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-md);
    box-shadow: var(--card-shadow-hover);
    position: relative;
    z-index: 10;
}
.filter-dropdown.open { display: flex; animation: fadeDown 0.15s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.f-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 0;
    white-space: nowrap;
}
.f-section-title {
    width: 100%;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-tertiary);
    padding: 4px 0 2px;
    text-align: left;
}
.f-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 11px; height: 11px;
    flex-shrink: 0;
}
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot.hi { background: #ef4444; }
.dot.md { background: #f59e0b; }
.dot.lo { background: #94a3b8; }


/* ====== 文件上传（侧栏）===== */
.upload-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    align-items: center;
    padding: 2px 0;
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: none;
}
.upload-preview::-webkit-scrollbar { display: none; }

.file-thumb {
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.12s, border-color 0.12s;
}
.file-thumb:hover {
    transform: scale(1.08);
    border-color: var(--accent);
}
.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.file-thumb .file-icon-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.file-thumb .file-delete {
    position: absolute;
    top: 1px; right: 1px;
    width: 14px; height: 14px;
    background: rgba(220,38,38,0.85);
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 2;
}
.file-thumb:hover .file-delete { opacity: 1; }

.file-count {
    font-size: 9px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 2px 0 4px;
}

/* 上传弹窗 */
.upload-modal-body {
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.upload-drop-zone {
    width: 100%;
    min-height: 160px;
    border: 2px dashed var(--card-border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-tertiary);
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(0,0,0,0.01);
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over-upload {
    border-color: var(--accent);
    background: rgba(37,99,235,0.03);
    color: var(--accent);
}
.upload-drop-zone svg {
    opacity: 0.4;
}
.upload-drop-zone:hover svg,
.upload-drop-zone.drag-over-upload svg { opacity: 0.8; }
.upload-hint {
    font-size: 12px;
    text-align: center;
    line-height: 1.6;
}
.upload-hint strong {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* 文件列表（上传弹窗内） */
.upload-file-list {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.upload-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--r-sm);
    font-size: 12px;
}
.upload-file-item .ufi-icon {
    width: 28px; height: 28px;
    border-radius: var(--r-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.upload-file-item .ufi-info {
    flex: 1;
    min-width: 0;
}
.upload-file-item .ufi-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.upload-file-item .ufi-size {
    font-size: 10px;
    color: var(--text-tertiary);
}
.upload-file-item .ufi-del {
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--text-tertiary);
    font-size: 12px;
    transition: all 0.12s;
}
.upload-file-item .ufi-del:hover {
    background: rgba(220,38,38,0.08);
    color: #dc2626;
}

/* 图片预览弹窗 */
.img-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
.img-preview-overlay img {
    max-width: 85vw;
    max-height: 85vh;
    border-radius: var(--r-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ====== 文件卡片（列内紧凑版）====== */
.file-card-in-col {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    cursor: grab;
}
.file-card-in-col:active,
#fileCardsInCol:active {
    cursor: grabbing;
}
.file-card-in-col:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}

/* 图片预览 */
.fc-preview {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: rgba(0,0,0,0.02);
}
.fc-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}
.file-card-in-col:hover .fc-preview img { transform: scale(1.03); }

/* 文件图标 */
.fc-icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    background: rgba(0,0,0,0.015);
}
.fci-box {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.fci-ext {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* 文件信息 */
.fc-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
body.dark .fc-info { border-top-color: rgba(255,255,255,0.05); }
.fc-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.fc-size {
    font-size: 10px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-left: 6px;
}

/* 删除 */
.fc-del {
    position: absolute;
    top: 5px; right: 5px;
    width: 20px; height: 20px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 5;
}
.file-card-in-col:hover .fc-del { opacity: 1; }
.fc-del:hover { background: rgba(220,38,38,0.85); }

/* 下载 */
.fc-dl {
    position: absolute;
    top: 5px; left: 5px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 5;
    backdrop-filter: blur(4px);
}
.file-card-in-col:hover .fc-dl { opacity: 1; }
.fc-dl:hover { background: rgba(37,99,235,0.9); }

/* 空状态 */
.fc-empty {
    padding: 24px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.015);
    border-radius: var(--r-md);
    border: 1px dashed rgba(0,0,0,0.08);
}


/* ====== 成员列表 ====== */
.member-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    align-items: center;
}
.mem-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    border-radius: var(--r-sm);
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
    width: 54px;
    justify-content: center;
}
.mem-chip:hover { background: var(--sb-hover-bg); }
.mem-chip.active { background: var(--sb-active-bg); color: var(--text-primary); font-weight: 500; }
.mem-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.mem-count { margin-left: auto; font-size: 9px; color: var(--text-tertiary); }


/* ====== 统计行 ====== */
.stats-row { gap: 4px; }
.stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--r-sm);
}
.stat-cell b { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.stat-cell small { font-size: 9px; color: var(--text-tertiary); }
.stat-cell.done b { color: var(--success); }
.stat-cell.pend b { color: var(--accent); }


/* ====== 画布区域 ====== */
.canvas {
    flex: 1;
    overflow: auto;
    position: relative;
    background: var(--canvas-bg);
}
.canvas.hidden { display: none; }
.canvas-inner {
    position: relative;
    z-index: 1;
    padding: 32px 36px;
    min-width: 1400px;
}


/* ====== 页面标题 ====== */
.page-header { margin-bottom: 24px; }
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}


/* ====== 看板列布局（自由定位画布）====== */
.board-columns {
    display: block;
    position: relative;
    min-height: 900px;
    min-width: 1200px;
    width: 100%;
}

/* 单列 — 绝对定位，支持自由拖动 */
.column {
    position: absolute !important;
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.column.dragging-col {
    box-shadow: 0 16px 48px rgba(0,0,0,0.22) !important;
    z-index: 9999 !important;
    opacity: 0.95;
    transform: scale(1.02);
}
.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    margin-bottom: 4px;
    cursor: grab;
    user-select: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.column-header:active { cursor: grabbing; }
.column-header:hover {
    background: rgba(0,0,0,0.02);
}
body.dark .column-header:hover {
    background: rgba(255,255,255,0.03);
}
.column-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* 新建分组占位卡 */
.column.add-column-card {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.col-drag-grip {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    opacity: 0.5;
    flex-shrink: 0;
    cursor: grab;
    transition: opacity 0.12s, color 0.12s;
}
.col-drag-grip:hover {
    opacity: 1;
    color: var(--accent);
}
.column-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.column-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}
.column-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.04);
    padding: 1px 7px;
    border-radius: 100px;
}
.column-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.column:hover .column-actions { opacity: 1; }

.column-action-btn {
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--text-tertiary);
    transition: all 0.12s;
}
.column-action-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

/* 列体：任务卡片容器 */
.column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
    min-height: 40px;
    transition: background 0.15s;
    border-radius: var(--r-md);
}
.column-body.drag-over {
    background: rgba(37,99,235,0.04);
    box-shadow: inset 0 0 0 2px rgba(37,99,235,0.15);
}

/* 添加按钮（列底部） */
.column-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 4px;
    border-radius: var(--r-md);
    font-size: 12px;
    color: var(--text-tertiary);
    transition: all 0.15s;
    border: 1px dashed rgba(0,0,0,0.10);
    background: transparent;
}
.column-add:hover {
    color: var(--text-secondary);
    border-color: rgba(0,0,0,0.18);
    background: rgba(0,0,0,0.02);
}

/* 新增列占位卡 */
#addColumnCard {
    min-height: 160px;
    border-style: dashed;
    border-color: rgba(0,0,0,0.12);
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: border-color 0.15s;
}
#addColumnCard:hover {
    border-color: rgba(0,0,0,0.25);
    background: rgba(0,0,0,0.015) !important;
}


/* ====== 任务卡片（Milanote 白卡片风）===== */
.task-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}
.task-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}
.task-card:active { cursor: pointer; }
.task-card.completed { opacity: 0.55; }
.task-card.dragging { opacity: 0.35; transform: rotate(1.5deg) scale(0.97); z-index: 999; box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
.task-card.drag-ghost { pointer-events: none; }

/* 拖拽排序占位符 */
.drag-placeholder {
    height: 58px;
    border: 2px dashed var(--accent);
    border-radius: var(--r-md);
    background: rgba(37,99,235,0.04);
    margin: 0;
    animation: phIn 0.12s ease-out;
}
@keyframes phIn {
    from { opacity: 0; transform: scaleY(0.6); }
    to   { opacity: 1; transform: scaleY(1); }
}

/* 左色条 */
.task-color-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: var(--r-md) 0 0 var(--r-md);
}

/* 卡片头部 */
.task-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.task-drag-handle {
    width: 16px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--text-tertiary);
    cursor: grab;
    border-radius: 4px;
}
.task-drag-handle:hover {
    color: var(--accent);
    background: rgba(0,0,0,0.04);
}
.task-drag-handle:active {
    cursor: grabbing;
}

/* 复选框 */
.task-checkbox {
    width: 17px; height: 17px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    animation: popIn 0.3s ease;
}
.task-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
@keyframes popIn {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* 标题 */
.task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.45;
    word-break: break-word;
}
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-tertiary); }

/* 描述 */
.task-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 标签 */
.task-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.task-tag {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 100px;
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
    font-weight: 500;
}
body.dark .task-tag { background: rgba(255,255,255,0.06); }

/* 底部信息 */
.task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
body.dark .task-footer { border-top-color: rgba(255,255,255,0.06); }

.task-meta { display: flex; align-items: center; gap: 8px; }
.task-priority {
    font-size: 11px;
    font-weight: 500;
}
.task-priority.high { color: #ef4444; }
.task-priority.medium { color: #f59e0b; }
.task-priority.low { color: #94a3b8; }

.task-time {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}
.task-avatar {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* 顺延徽章 */
.task-rollover-badge {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 100px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 500;
}
body.dark .task-rollover-badge {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

/* 操作按钮 */
.task-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.task-card:hover .task-actions { opacity: 1; }
.task-action {
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--text-tertiary);
}
.task-action:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }


/* ====== 归档日历 ====== */
.archive-calendar-wrap {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    box-shadow: var(--card-shadow);
    padding: 20px 24px;
    max-width: 780px;
}
.cal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    user-select: none;
}
.cal-nav {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    transition: all 0.15s;
    background: transparent;
}
.cal-nav:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}
body.dark .cal-nav:hover {
    background: rgba(255,255,255,0.06);
}
.cal-month-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}
.cal-today-btn {
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.04);
    transition: all 0.15s;
}
.cal-today-btn:hover {
    background: var(--accent);
    color: #fff;
}
body.dark .cal-today-btn {
    background: rgba(255,255,255,0.06);
}
body.dark .cal-today-btn:hover {
    background: var(--accent);
    color: #fff;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}
.cal-weekdays span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 6px 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.12s;
    min-height: 72px;
}
.cal-cell:hover {
    background: rgba(0,0,0,0.04);
}
body.dark .cal-cell:hover {
    background: rgba(255,255,255,0.04);
}
.cal-cell.cal-empty {
    cursor: default;
}
.cal-cell.cal-today {
    background: var(--accent) !important;
}
.cal-cell.cal-today .cal-day-num {
    color: #fff !important;
    font-weight: 700;
}
.cal-cell.cal-today .cal-day-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.cal-cell.cal-selected {
    background: rgba(37,99,235,0.12) !important;
    box-shadow: inset 0 0 0 2px var(--accent);
}
body.dark .cal-cell.cal-selected {
    background: rgba(37,99,235,0.2) !important;
}
.cal-cell.cal-future {
    opacity: 0.3;
    cursor: default;
}
.cal-cell.cal-future:hover {
    background: transparent;
}
.cal-day-num {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}
.cal-day-badge {
    margin-top: 4px;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 100px;
    background: var(--success);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 日历详情面板 */
.cal-detail {
    margin-top: 16px;
    max-width: 780px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: fadeDown 0.2s ease;
}
.cal-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
body.dark .cal-detail-head {
    border-bottom-color: rgba(255,255,255,0.06);
}
.cal-detail-head h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.cal-detail-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.cal-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--r-md);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    transition: background 0.12s;
}
body.dark .cal-task-item {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
}
.cal-task-item:hover {
    background: rgba(0,0,0,0.04);
}
body.dark .cal-task-item:hover {
    background: rgba(255,255,255,0.04);
}
.cal-task-info {
    flex: 1;
    min-width: 0;
}
.cal-task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}
.cal-task-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.task-assignee-avatar {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ====== 归档视图（旧样式保留） ====== */
.archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    box-shadow: var(--card-shadow);
}
.af-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.af-group label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}
.af-group input, .af-group select {
    padding: 6px 10px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-sm);
    background: var(--card-bg);
    font-size: 12px;
    min-width: 120px;
}
.af-group input:focus, .af-group select:focus { border-color: var(--accent); }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range span { font-size: 12px; color: var(--text-tertiary); }

.archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.archive-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.archive-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.archive-card h4 { font-size: 14px; margin-bottom: 4px; }
.archive-card p { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; }
.archive-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-tertiary); }


/* ====== 团队视图 ====== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.team-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.15s, transform 0.15s;
}
.team-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }

/* 添加成员卡 */
.team-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    cursor: pointer;
    background: transparent !important;
    border: 2px dashed var(--card-border) !important;
    box-shadow: none !important;
    color: var(--text-tertiary);
    transition: border-color 0.15s, color 0.15s;
}
.team-card-add:hover { border-color: var(--accent) !important; color: var(--accent); }
.team-card-add-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; }

/* 卡片右上角操作按钮 */
.team-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.team-card:hover .team-card-actions { opacity: 1; }
.team-action-btn {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: var(--text-tertiary);
    transition: background 0.12s, color 0.12s;
}
.team-action-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }
.team-action-btn.danger:hover { background: rgba(239,68,68,0.08); color: #ef4444; }

/* 成员颜色选择器 */
.member-color-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}
.m-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    position: relative;
}
.m-dot:hover { transform: scale(1.15); }
.m-dot.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
    outline: none;
}
.m-dot.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.team-header, .team-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.team-avatar, .team-card-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}
.team-name, .team-card-name { font-size: 15px; font-weight: 600; }
.team-role, .team-card-role { font-size: 12px; color: var(--text-tertiary); }
.team-stats, .team-card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.team-stat, .team-card-stat {
    text-align: center;
    padding: 8px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--r-sm);
}
body.dark .team-stat, body.dark .team-card-stat { background: rgba(255,255,255,0.03); }
.team-stat-num, .team-card-stat-value { font-size: 20px; font-weight: 600; }
.team-stat-label, .team-card-stat-label { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.team-card-progress {
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.team-card-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.4s ease;
}
.team-card-footer { font-size: 11px; color: var(--text-tertiary); text-align: right; }


/* ====== 按钮 ====== */
.btn-primary {
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s;
    align-self: flex-end;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
    padding: 6px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    align-self: flex-end;
}
.btn-ghost:hover { border-color: var(--text-tertiary); color: var(--text-primary); background: rgba(0,0,0,0.02); }


/* ====== 抽屉（详情面板）===== */
.drawer {
    position: fixed;
    top: 40px; right: 0; bottom: 0;
    width: 460px;
    max-width: 90vw;
    background: var(--card-bg);
    border-left: 1px solid var(--card-border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.10);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
    background: var(--card-bg);
}
.drawer-head h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--canvas-bg);
}
.drawer-field { margin-bottom: 14px; }
.drawer-field label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; display: block; }
.drawer-field p, .drawer-field div { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

.drawer-hero {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 4px solid var(--accent);
    border-radius: var(--r-lg);
    padding: 16px 18px 18px;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
}
.drawer-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.drawer-status-pill,
.drawer-priority-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}
.drawer-status-pill.done {
    color: #166534;
    background: rgba(22,163,74,0.12);
}
.drawer-status-pill.active {
    color: #92400e;
    background: rgba(245,158,11,0.14);
}
.drawer-priority-pill.high {
    color: #991b1b;
    background: rgba(239,68,68,0.12);
}
.drawer-priority-pill.medium {
    color: #92400e;
    background: rgba(245,158,11,0.14);
}
.drawer-priority-pill.low,
.drawer-priority-pill.none {
    color: #475569;
    background: rgba(148,163,184,0.18);
}
.drawer-title-big {
    font-size: 19px;
    font-weight: 750;
    line-height: 1.35;
    color: var(--text-primary);
    word-break: break-word;
}
.drawer-desc {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.drawer-desc.muted,
.drawer-empty-line {
    color: var(--text-tertiary);
    font-size: 12px;
}
.drawer-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 14px;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
}
.drawer-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}
.drawer-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.drawer-meta-item {
    min-width: 0;
    padding: 10px;
    border-radius: var(--r-md);
    background: rgba(0,0,0,0.025);
    border: 1px solid rgba(0,0,0,0.035);
}
body.dark .drawer-meta-item {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.045);
}
.drawer-meta-item.wide {
    grid-column: 1 / -1;
}
.drawer-info-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 800;
}
.drawer-info-value {
    display: block;
    min-width: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}
.assignee-value {
    display: flex;
    align-items: center;
    gap: 8px;
}
.assignee-value small {
    display: block;
    margin-top: 1px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
}
.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.drawer-tags {
    margin-top: 0;
}
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.activity-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 8px;
    position: relative;
}
.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: -10px;
    width: 1px;
    background: var(--card-border);
}
.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    z-index: 1;
}
.activity-copy {
    min-width: 0;
}
.activity-text {
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}
.activity-time {
    margin-top: 2px;
    color: var(--text-tertiary);
    font-size: 10px;
}
.drawer-actions {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 8px;
    padding: 12px 14px;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
}
.drawer-action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    align-self: stretch;
}
.drawer-action-btn.danger {
    color: var(--danger);
}
.drawer-action-btn.danger:hover {
    border-color: rgba(220,38,38,0.35);
    background: rgba(220,38,38,0.06);
}

.icon-close {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    font-size: 16px;
    color: var(--text-tertiary);
    transition: all 0.15s;
}
.icon-close:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }


/* ====== 模态框 ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--card-bg);
    border-radius: var(--r-lg);
    width: 520px;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    flex-shrink: 0;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 18px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

/* 精简版模态框 */
.modal-compact {
    width: 400px;
    animation: modalInCompact 0.2s ease-out;
}
@keyframes modalInCompact {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-compact .modal-body {
    padding: 12px 22px 8px;
    gap: 10px;
}
.modal-compact .field label {
    font-size: 12px;
    color: #888;
}
.modal-compact .fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field input, .field textarea, .field select {
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-sm);
    font-size: 13px;
    background: var(--card-bg);
    transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 登录注册 */
.auth-box {
    width: 360px;
}
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 18px 22px 4px;
}
.auth-tab {
    height: 32px;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    background: rgba(0,0,0,0.03);
    font-size: 13px;
    font-weight: 600;
}
.auth-tab.active {
    color: #fff;
    background: var(--accent);
}
.invite-preview {
    margin: 12px 22px 0;
    padding: 12px 14px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: var(--r-sm);
    background: rgba(37, 99, 235, 0.08);
}
.invite-preview-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}
.invite-preview-desc {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}
.auth-body {
    padding-top: 12px !important;
}
.auth-error {
    min-height: 18px;
    color: var(--danger);
    font-size: 12px;
}

.empty-team-state {
    width: 420px;
    max-width: calc(100vw - 120px);
    padding: 28px;
    background: var(--card-bg);
    border: 1px dashed var(--card-border);
    border-radius: var(--r-lg);
    color: var(--text-secondary);
    box-shadow: var(--card-shadow);
}
.empty-team-state h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.empty-team-state p {
    font-size: 13px;
    margin-bottom: 16px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message-item {
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-md);
    background: rgba(0,0,0,0.02);
}
.message-item.unread {
    border-color: rgba(37,99,235,0.35);
    background: rgba(37,99,235,0.05);
}
.message-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.message-body {
    font-size: 12px;
    color: var(--text-secondary);
}
.message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.invite-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}
.invite-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 3px;
    border-radius: var(--r-sm);
    background: rgba(0,0,0,0.04);
}
.invite-tab {
    height: 32px;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.invite-tab.active {
    color: #fff;
    background: var(--accent);
}
.invite-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
}
.invite-panel.active {
    display: flex;
}
.invite-help {
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
}
.invite-status {
    min-height: 18px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 标签输入 */
.tag-box {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-sm);
    background: var(--card-bg);
    align-items: center;
    min-height: 38px;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(37,99,235,0.08);
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tag-chip .rm { cursor: pointer; opacity: 0.6; }
.tag-chip .rm:hover { opacity: 1; }
.tag-box input {
    border: none;
    background: none;
    padding: 0;
    min-width: 80px;
    font-size: 12px;
    flex: 1;
}

/* 颜色选择 */
.color-strip { display: flex; gap: 6px; }
.c-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
}
.c-dot:hover { transform: scale(1.15); }
.c-dot.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--card-bg); }


/* ====== Toast 提示 ====== */
.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 10px 18px;
    border-radius: var(--r-md);
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.success { background: #166534; }
.toast.error { background: #dc2626; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ====== 响应式 ====== */
@media (max-width: 900px) {
    .column { max-width: 100% !important; width: calc(100vw - 80px) !important; left: 10px !important; }
    .drawer { width: 85vw; }
    .modal-box { width: 95vw; }
}
