* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6f8; color: #1f2933; }
.hidden { display: none !important; }
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { background: #fff; padding: 32px 28px; border-radius: 12px; width: 320px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.login-card h1 { margin: 0; color: #0b6e4f; }
/* 登录页标题/副标题居中 */
.login-card h1, .login-card .sub { text-align: center; }
.login-logo { width: 84px; height: 84px; display: block; margin: 0 auto 10px; border-radius: 50%; box-shadow: 0 4px 14px rgba(11,110,79,.18); }
.login-card .sub { color: #6b7280; margin: 4px 0 20px; }
.login-card input, .login-card button { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #d9dee3; border-radius: 8px; font-size: 14px; }
.login-card button { background: #0b6e4f; color: #fff; border: none; cursor: pointer; }
.login-card button:hover { background: #095c41; }
.err { color: #c0392b; font-size: 13px; min-height: 18px; }
.pwd-wrap { position: relative; margin: 8px 0; }
.pwd-wrap input { width: 100%; margin: 0; padding-right: 42px; }
.login-card .pwd-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: 4px; background: none; border: none; cursor: pointer; font-size: 15px; color: #6b7280; line-height: 1; }
.login-card .pwd-eye:hover { background: none; color: #0b6e4f; }
#app { display: flex; min-height: 100vh; }
.side { width: 200px; flex-shrink: 0; background: #0f3d2e; color: #e6f4ee; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 12px 16px; font-weight: 700; font-size: 16px; border-bottom: 1px solid #1c5340; display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); flex-shrink: 0; }
.side #nav { flex: 1; padding: 10px 0; }
.side .nav-item { padding: 11px 18px; cursor: pointer; font-size: 14px; }
.side .nav-item:hover, .side .nav-item.active { background: #1c5340; }
.side .me { padding: 12px 18px; border-top: 1px solid #1c5340; font-size: 13px; position: relative; }
/* 用户名可点击，带下拉箭头 */
.me-name { cursor: pointer; color: #e6f4ee; user-select: none; display: inline-block; overflow-wrap: break-word; }
.me-name::after { content: ' ▾'; font-size: 10px; opacity: .8; }
.me-name:hover { color: #9fe3c4; }
/* 用户名二级菜单：从用户名上方弹出 */
.me-menu { position: absolute; bottom: calc(100% + 6px); left: 12px; right: 12px; background: #fff; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); overflow: hidden; z-index: 30; }
.me-menu-item { padding: 10px 14px; font-size: 13px; color: #1f2933; cursor: pointer; }
.me-menu-item:hover { background: #eef2f5; }
.me-menu-item.danger { color: #c0392b; }
.me-menu-item.danger:hover { background: #fdecea; }
.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid #e4e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-weight: 600; position: sticky; top: 0; z-index: 15; }
.top-right { display: flex; align-items: center; gap: 12px; }
.bell { cursor: pointer; font-size: 14px; }
#view { padding: 22px; }
.card { background: #fff; border: 1px solid #e4e7eb; border-radius: 10px; padding: 16px; margin-bottom: 16px; overflow-x: auto; }
/* 任务表：窄屏下允许横向滚动，避免末列(状态/操作)被挤压遮挡 */
#taskTable { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid #e4e7eb; padding: 8px 10px; text-align: left; overflow-wrap: break-word; }
th { background: #e6f4ee; color: #0f3d2e; white-space: nowrap; }
td.tdc { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 日历视图 */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-tbl { table-layout: fixed; }
.cal-tbl th, .cal-tbl td { text-align: center; padding: 0; height: 62px; vertical-align: top; }
.cal-tbl thead th { height: 30px; font-weight: 600; }
.cal-cell { position: relative; cursor: pointer; }
.cal-cell.out .cal-num { color: #b8c0c8; }
.cal-cell.today { outline: 2px solid #0b6e4f; outline-offset: -2px; }
.cal-cell:hover { background: #f4f8f6; }
.cal-num { position: absolute; top: 6px; right: 8px; font-weight: 600; font-size: 13px; }
.cal-badges { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; }
.cal-badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; color: #fff; white-space: nowrap; }
.cal-badge.b1 { background: #c0392b; }
.cal-badge.b3 { background: #e0a800; }
/* 已超期徽标：深红底白字（仅今天格显示） */
.cal-badge.b9 { background: #8b0000; }
/* 日历日列表：分组标题行（单表结构，各段共用列宽对齐） */
.cal-grp td { background: #f0f5f3; font-weight: 600; color: #0f3d2e; }
.cal-grp.over td { color: #8b0000; }
tbody tr:hover { background: #f4f8f6; }
/* 截止临近高亮：不足3天黄底、不足1天红底（td 背景优先于行 hover 背景） */
tbody td.dl-warn { background: #fff3cd; }
tbody td.dl-danger { background: #ff8a8a; color: #5c0000; font-weight: 600; }
/* 已超期（进行中且截止日期已过）：深红底白字 */
tbody td.dl-overdue { background: #8b0000; color: #fff; font-weight: 600; }
button { cursor: pointer; }
.btn { background: #0b6e4f; color: #fff; border: none; padding: 7px 12px; border-radius: 7px; font-size: 13px; }
.btn:hover { background: #095c41; }
.btn.sec { background: #eef2f5; color: #1f2933; }
.btn.danger { background: #c0392b; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row label { font-size: 13px; color: #374151; }
/* 任务查询工具栏：始终单行，超出时由卡片内部横向滚动（避免导出CSV换行） */
.toolbar-row { flex-wrap: nowrap; }
input, select, textarea { padding: 7px 9px; border: 1px solid #d9dee3; border-radius: 7px; font-size: 13px; font-family: inherit; }
input[type=datetime-local] { width: 190px; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e6f4ee; color: #0b6e4f; }
.tag.warn { background: #fdece5; color: #9a3412; }
.tag.mut { background: #eef2f5; color: #52606d; }
/* 已超期标签：深红底白字 */
.tag.overdue { background: #8b0000; color: #fff; font-weight: 600; }
.drawer { position: fixed; top: 0; right: 0; width: 460px; height: 100vh; background: #fff; box-shadow: -4px 0 18px rgba(0,0,0,.12); padding: 22px; overflow: auto; z-index: 20; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal .box { background: #fff; border-radius: 12px; padding: 22px; width: 520px; max-width: 92vw; max-height: 90vh; overflow: auto; }
.modal .box h3 { margin-top: 0; }
/* ---- 统一弹窗表单栅格：标签在上，控件通栏等宽 ---- */
.frow { display: flex; gap: 12px; }
.fitem { flex: 1; min-width: 0; margin-bottom: 14px; }
.fitem label.fl { display: block; font-size: 13px; color: #374151; margin-bottom: 5px; }
.fitem input, .fitem select, .fitem textarea { width: 100%; }
.fitem input[type=datetime-local] { width: 100%; }
.fitem .ctl { position: relative; }
.fitem .ctl input { padding-right: 40px; }
.fitem .ctl .pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: 2px 6px; background: none; border: none; cursor: pointer; font-size: 15px; color: #6b7280; line-height: 1; }
.fitem .ctl .pwd-eye:hover { background: none; color: #0b6e4f; }
.fitem .chks { display: flex; gap: 20px; flex-wrap: wrap; padding: 9px 0 2px; }
.fitem .chks label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }
.factions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
/* 权限勾选区（新建用户 / 设置权限 共用） */
.perm-box { border: 1px solid #e4e7eb; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: #fafbfc; }
.perm-box-t { font-size: 13px; color: #0f3d2e; font-weight: 600; margin-bottom: 8px; }
.perm-opt { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; font-size: 13px; color: #374151; cursor: pointer; }
.perm-opt input { margin-top: 2px; }
.perm-opt b { font-weight: 600; }
.perm-opt i { display: block; font-style: normal; font-size: 12px; color: #6b7280; margin-top: 1px; }
.muted-tip { color: #6b7280; font-size: 12px; margin: 0 0 12px; }
.as-list { border: 1px solid #e4e7eb; border-radius: 8px; padding: 4px 12px; margin-bottom: 12px; max-height: 260px; overflow: auto; }
.as-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; color: #374151; border-bottom: 1px solid #f0f2f4; cursor: pointer; }
.as-item:last-child { border-bottom: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #0f3d2e; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 40; }
.close { float: right; background: none; border: none; font-size: 18px; cursor: pointer; }
.cr { border: 1px solid #e4e7eb; border-radius: 8px; padding: 10px; margin: 8px 0; font-size: 13px; }
/* 通知行：勾选框 + 内容同行，整行可点 */
.notif-row { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.notif-row input[type="checkbox"] { margin-top: 2px; cursor: pointer; }
.muted { color: #6b7280; font-size: 12px; }
