* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f5f4;
    min-height: 100vh;
    color: #2b3330;
}
[hidden] { display: none !important; }

/* 顶部导航栏 */
.header { background: #fff; border-bottom: 1px solid #e2e7e5; position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: stretch; gap: 28px; }
.brand { display: flex; align-items: center; font-size: 18px; font-weight: 800; color: #2d4a3d; white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { display: flex; align-items: center; padding: 0 14px; color: #6b7c74; text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: #2d4a3d; }
.nav a.active { color: #2d4a3d; border-bottom-color: #3f7d62; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: #2d4a3d; font-weight: 600; white-space: nowrap; }
.role { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #e6ebe9; color: #2d4a3d; }
.role.admin { background: #2d4a3d; color: #fff; }
.link-btn { background: none; border: none; color: #6b7c74; font-size: 13px; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 720px) {
    .header-inner { height: auto; flex-wrap: wrap; padding: 10px 16px 0; gap: 4px 12px; }
    .brand { font-size: 16px; }
    .nav { order: 3; width: 100%; overflow-x: auto; height: 42px; }
    .nav a { padding: 0 10px; font-size: 14px; }
}

/* 页面主体 */
.page { max-width: 1280px; margin: 0 auto; padding: 24px; }
@media (max-width: 720px) { .page { padding: 16px; } }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; color: #2d4a3d; margin-right: auto; }

/* 分类筛选 */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1.5px solid #b7c4be; background: #fff; color: #4d5c55; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: #3f7d62; }
.chip.active { background: #2d4a3d; border-color: #2d4a3d; color: #fff; }

/* 卡片 */
.card { background: #fff; border-radius: 16px; border: 1px solid #e2e7e5; box-shadow: 0 4px 16px rgba(45, 74, 61, 0.06); padding: 22px; min-width: 0; }
.card h2 { font-size: 16px; color: #2d4a3d; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-bottom: 12px; border-bottom: 1px solid #eef1f0; }
.count { display: inline-block; min-width: 22px; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eef3f0; color: #3f7d62; font-size: 12px; font-weight: 700; text-align: center; }

/* 发布任务 */
.publish { max-width: 720px; margin: 0 auto; padding: 28px; }
.field { margin-bottom: 22px; }
.field-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; color: #2d4a3d; font-weight: 700; font-size: 14px; }
.field-label .hint { font-weight: 400; }
.publish textarea, .publish input[type="date"] {
    width: 100%; padding: 12px 14px; border: 1.5px solid #dfe5e2; border-radius: 12px;
    font-size: 15px; font-family: inherit; background: #fff; color: #2b3330;
}
.publish input[type="date"] { width: auto; min-width: 200px; }
.publish textarea:focus, .publish input:focus { outline: none; border-color: #3f7d62; box-shadow: 0 0 0 3px rgba(63, 125, 98, .12); }
.publish textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.hint { font-size: 12px; color: #9aa5a0; }
/* 分类：四个按钮单选 */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
@media (max-width: 560px) { .seg { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg-btn { padding: 12px 8px; border-radius: 12px; border: 1.5px solid #dfe5e2; background: #fff; font-size: 15px; font-weight: 600; color: #4d5c55; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg-btn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.seg-btn:hover { border-color: var(--c); }
.seg-btn.active { border-color: var(--c); background: var(--bg); color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.seg-btn[data-cat="consult"] { --c: #2f6b51; --bg: #e3efe8; }
.seg-btn[data-cat="event"] { --c: #3b6ea8; --bg: #e4ecf6; }
.seg-btn[data-cat="other"] { --c: #5f6e67; --bg: #eef1f0; }
.seg-btn[data-cat="finance"] { --c: #9a6411; --bg: #fbf0dc; }
/* 负责人：按钮多选 */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 8px 16px; border-radius: 999px; border: 1.5px solid #dfe5e2; background: #fff; font-size: 14px; font-weight: 600; color: #4d5c55; cursor: pointer; font-family: inherit; }
.pill:hover:not(:disabled) { border-color: #3f7d62; }
.pill.active { background: #2d4a3d; border-color: #2d4a3d; color: #fff; }
.pill.active::before { content: '✓ '; }
.pill:disabled { opacity: .35; cursor: not-allowed; }
.submit-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #3f7d62 0%, #2d4a3d 100%); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.message { margin-top: 14px; padding: 10px; border-radius: 10px; text-align: center; font-size: 14px; }
.message.success { background: #e3efe8; color: #2f6b51; }
.message.error { background: #f8d7da; color: #721c24; }

/* 我的任务：未完成 / 已完成 两张卡片并排 */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* 我的任务：待办 / 已完成 切换 */
.view-tabs { display: flex; gap: 4px; }
.view-tab { display: flex; align-items: center; padding: 6px 4px; margin-right: 18px; border: none; border-bottom: 2px solid transparent; background: none; font-size: 16px; font-weight: 700; color: #9aa5a0; cursor: pointer; font-family: inherit; }
.view-tab:hover { color: #2d4a3d; }
.view-tab.active { color: #2d4a3d; border-bottom-color: #3f7d62; }
.view-tab .hint { font-weight: 400; }

/* 团队任务：一屏一个人，左右滑动切换 */
.people { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.person { padding: 6px 12px; border-radius: 10px; border: 1.5px solid #dfe5e2; background: #fff; color: #4d5c55; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.person:hover { border-color: #3f7d62; }
.person.active { background: #2d4a3d; border-color: #2d4a3d; color: #fff; }
.team { display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; align-items: flex-start; }
.team::-webkit-scrollbar { display: none; }
.team.dragging { cursor: grabbing; scroll-snap-type: none; }
.team > .slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.col h3 { display: flex; align-items: center; font-size: 14px; color: #2d4a3d; padding-bottom: 8px; border-bottom: 1px solid #eef1f0; min-height: 38px; }
/* 已完成列的发布人筛选 */
.pub-filter { margin-left: auto; position: relative; font-weight: 400; }
.pub-toggle { padding: 4px 12px; border-radius: 999px; border: 1.5px solid #b7c4be; background: #fff; color: #4d5c55; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-toggle:hover { border-color: #3f7d62; }
.pub-toggle.on { background: #2d4a3d; border-color: #2d4a3d; color: #fff; }
.pub-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid #dfe5e2; border-radius: 12px; box-shadow: 0 8px 24px rgba(45, 74, 61, .15); padding: 6px; }
.pub-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: #2b3330; cursor: pointer; }
.pub-menu label:hover { background: #f3f5f4; }
.pub-menu input { accent-color: #2d4a3d; }
.pub-clear { width: 100%; margin-top: 4px; padding: 7px 10px; border: none; border-top: 1px solid #eef1f0; background: none; color: #6b7c74; font-size: 12px; cursor: pointer; font-family: inherit; text-align: left; }
.pub-clear:hover { color: #2d4a3d; }
.slide-arrow { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid #dfe5e2; background: rgba(255, 255, 255, .95); color: #2d4a3d; font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(45, 74, 61, .15); z-index: 5; display: flex; align-items: center; justify-content: center; padding-bottom: 4px; }
.slide-arrow:hover:not(:disabled) { background: #2d4a3d; color: #fff; }
.slide-arrow:disabled { opacity: .25; cursor: default; }
.slide-arrow.prev { left: max(4px, calc((100vw - 1280px) / 2 - 30px)); }
.slide-arrow.next { right: max(4px, calc((100vw - 1280px) / 2 - 30px)); }
@media (max-width: 720px) { .slide-arrow { width: 36px; height: 36px; font-size: 22px; } }

/* 任务条目 */
ul { list-style: none; }
li.task { padding: 10px 0; border-bottom: 1px solid #f3f3f3; display: flex; gap: 10px; align-items: flex-start; }
li.task:last-child { border: none; }
li.task.pinned { background: #fbf3e6; border-left: 3px solid #e6a23c; padding-left: 8px; border-radius: 6px; }
.t-date { font-size: 12px; color: #aaa; white-space: nowrap; min-width: 38px; padding-top: 2px; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.t-content { line-height: 1.5; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.t-content a { color: #3f7d62; word-break: break-all; }
/* 内容默认最多三行，超出的在第三行最右侧放「展开」 */
li.task { --row-bg: #fff; }
li.task.pinned { --row-bg: #fbf3e6; }
.t-content.clamp { max-height: 4.5em; overflow: hidden; position: relative; }
.more-btn { background: none; border: none; padding: 0 0 0 6px; color: #e6a23c; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; line-height: inherit; }
.t-content.clamp .more-btn { position: absolute; right: 0; bottom: 0; padding-left: 2.5em; background: linear-gradient(to right, transparent, var(--row-bg) 2em); }
.more-btn:hover { text-decoration: underline; }
li.is-done .t-content { color: #aaa; }
li.is-done .t-content a { color: #aaa; }
.fwd-divider { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: #9aa5a0; font-size: 11px; text-decoration: none; }
.fwd-divider::before, .fwd-divider::after { content: ''; flex: 1; border-top: 1px dashed #c9d2ce; }
.fwd-orig { color: #777; background: #f5f7f6; padding: 6px 8px; border-radius: 8px; }
.t-meta { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.t-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cat-btn { border: none; cursor: pointer; font-family: inherit; }
.cat-btn:hover { box-shadow: 0 0 0 1px currentColor inset; }
.t-fwd { display: flex; }
.cat-consult { background: #e3efe8; color: #2f6b51; }
.cat-event { background: #e4ecf6; color: #3b6ea8; }
.cat-other { background: #eef1f0; color: #6b7c74; }
.cat-finance { background: #fbf0dc; color: #9a6411; }
.t-from { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #9aa5a0; white-space: nowrap; }
.t-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #eaf1ed; color: #3f7d62; font-size: 10px; font-weight: 700; }
.t-badge.t-to { background: #2d4a3d; color: #fff; font-size: 11px; }
.t-ddl { color: #d23b3b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.act { background: none; border: none; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 2px; white-space: nowrap; }
.act:hover { text-decoration: underline; }
.act:disabled { opacity: .6; cursor: not-allowed; text-decoration: none; }
.act-complete { color: #3f7d62; }
.act-edit { color: #6b8f7e; }
.act-ddl { color: #8a948f; }
.act-ddl.set { color: #d23b3b; }
.inline-edit { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.small-input { padding: 3px 6px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 12px; font-family: inherit; background: #fff; color: #333; }
.small-input:focus { outline: none; border-color: #3f7d62; }
.fwd-input { width: 110px; }
.fwd-btn { padding: 4px 10px; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; font-family: inherit; color: #fff; background: #3f7d62; cursor: pointer; }
.fwd-btn:disabled { opacity: .6; cursor: not-allowed; }
.edit-area { width: 100%; padding: 8px 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; font-family: inherit; min-height: 70px; resize: vertical; }
.edit-area:focus { outline: none; border-color: #3f7d62; }
.edit-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.save-btn { padding: 6px 14px; background: #3f7d62; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.save-btn:disabled { opacity: .6; cursor: not-allowed; }
.cancel-btn { padding: 6px 14px; background: #e0e0e0; color: #333; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.empty-line { color: #bbb; font-size: 13px; padding: 8px 0; }
.state { margin: 60px auto; text-align: center; color: #888; font-size: 15px; }
