/* ================= 嫣红小主工作台 · 仪表盘风格 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f2f4f7; --card: #ffffff; --ink: #14181b; --muted: #8a939c;
  --line: #e8ebef; --green: #22c55e; --green-soft: #dcfce7; --dark: #14181b;
  --red: #ef4444; --amber: #f59e0b;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--dark); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

.btn { border: none; border-radius: 10px; padding: 9px 18px; font-size: 13px; font-weight: 600; }
.btn.dark { background: var(--dark); color: #fff; }
.btn.line { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:hover { filter: brightness(1.05); }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- 左侧边栏 ---------- */
.sidebar { width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.logo-name { font-size: 15px; font-weight: 800; }
.logo-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.side-nav .nav-label { font-size: 11px; color: var(--muted); padding: 10px 10px 6px; letter-spacing: 1px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; color: #4b5563; margin-bottom: 2px; }
.side-nav a .dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.side-nav a .cnt { margin-left: auto; font-size: 11px; color: var(--muted); background: #f2f4f7; padding: 1px 8px; border-radius: 10px; }
.side-nav a:hover { background: #f6f8fa; }
.side-nav a.on { background: var(--dark); color: #fff; font-weight: 700; }
.side-nav a.on .cnt { background: rgba(255,255,255,.18); color: #fff; }
.side-foot { padding: 12px; }
.dark-card { background: var(--dark); color: #fff; border-radius: 14px; padding: 16px; }
.dc-num { font-size: 30px; font-weight: 800; }
.dc-label { font-size: 11px; opacity: .75; margin: 2px 0 10px; }
.dc-bar { height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; }
.dc-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .4s; }
.dc-stat { font-size: 11px; opacity: .8; margin-top: 6px; }
.me-box { display: flex; align-items: center; gap: 8px; padding: 12px 6px 4px; font-size: 12.5px; color: #4b5563; flex-wrap: wrap; }
.me-box b { font-size: 13px; }
.me-box a { color: var(--green); font-weight: 700; }

/* ---------- 移动端分类条 ---------- */
.mobile-nav { display: none; }

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; padding: 22px 26px 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 10px 16px; font-size: 12.5px; color: #92600a; }

/* ---------- 板块概要卡 ---------- */
.board-summary { margin-top: 16px; }
.bs-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bs-card .chip { width: 14px; height: 14px; border-radius: 4px; }
.bs-card h2 { font-size: 17px; }
.bs-card .owner { font-size: 12px; color: var(--muted); background: #f2f4f7; padding: 3px 10px; border-radius: 20px; }
.bs-card .stat { font-size: 12px; color: var(--muted); }
.bs-card .bs-prog { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bs-card .bs-prog .bar { width: 160px; height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.bs-card .bs-prog .bar i { display: block; height: 100%; }
.bs-card .bs-prog b { font-size: 16px; }

/* ---------- 三主模块 ---------- */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.module { background: #eaeef2; border-radius: 16px; padding: 12px; }
.mod-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.mod-head h2 { font-size: 14px; font-weight: 800; }
.mod-head b { margin-left: auto; font-size: 12px; background: #fff; border-radius: 12px; padding: 2px 10px; color: #4b5563; }
.mod-dot { width: 9px; height: 9px; border-radius: 50%; }
.mod-body { display: flex; flex-direction: column; gap: 10px; }
.mod-empty { background: rgba(255,255,255,.6); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 任务卡 ---------- */
.tcard { background: var(--card); border-radius: 12px; padding: 12px 14px; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.tcard:hover { border-color: #d4dae0; box-shadow: 0 4px 14px rgba(20,24,27,.06); transform: translateY(-1px); }
.tcard.done { opacity: .6; }
.tcard.done .tt { text-decoration: line-through; }
.tcard.od { border-left: 3px solid var(--red); }
.tcard .tt { font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.tcard .meta { display: flex; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.tcard .dates { background: #f2f4f7; padding: 2px 8px; border-radius: 10px; }
.tcard .fb { color: var(--dark); font-weight: 700; }
.tcard .boardtag { padding: 1px 8px; border-radius: 10px; color: #fff; font-size: 10.5px; }
.tcard .pbar { height: 5px; background: #eef1f4; border-radius: 3px; margin-top: 9px; overflow: hidden; }
.tcard .pbar i { display: block; height: 100%; background: var(--green); }
.tcard .pnum { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; }
.badge { font-size: 10.5px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.badge.pending { background: #eef1f4; color: #6b7280; }
.badge.doing { background: #fef3c7; color: #b45309; }
.badge.done { background: var(--green-soft); color: #15803d; }
.badge.overdue { background: #fee2e2; color: #b91c1c; }
.milestone { color: var(--amber); margin-right: 3px; }

/* ---------- 板块详情列表 ---------- */
.board-detail { margin-top: 16px; }
.detail-group { margin-bottom: 18px; }
.detail-group h3 { font-size: 13px; color: var(--muted); padding: 6px 4px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(20,24,27,.45); display: none; z-index: 50; }
.mask.show { display: block; }
.drawer { position: fixed; top: 0; right: -560px; width: 540px; max-width: 94vw; height: 100vh; background: #fff; z-index: 60; transition: right .25s; overflow-y: auto; box-shadow: -6px 0 24px rgba(0,0,0,.15); }
.drawer.show { right: 0; }
.drawer .dhead { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.drawer .dhead h3 { font-size: 16px; flex: 1; line-height: 1.5; }
.drawer .dbody { padding: 18px 22px; }
.kv { display: flex; font-size: 13px; margin-bottom: 10px; }
.kv b { width: 76px; color: var(--muted); font-weight: 400; flex-shrink: 0; }
.close-x { background: none; border: none; font-size: 22px; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 800; margin: 18px 0 10px; padding-left: 8px; border-left: 3px solid var(--dark); }

.fb-item { border-bottom: 1px dashed var(--line); padding: 10px 0; font-size: 13px; }
.fb-item .who { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.fb-item .who b { color: var(--dark); }
.fb-item .who time { font-size: 11px; color: var(--muted); }
.fb-item .at { font-size: 11px; color: #15803d; background: var(--green-soft); padding: 1px 7px; border-radius: 10px; }
.fb-item .remark { color: var(--muted); font-size: 12px; margin-top: 3px; }
.fb-item .del { float: right; font-size: 11px; color: #c0a0a0; background: none; border: none; }

textarea, input[type=text], input[type=password], input[type=date], input[type=number], select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-family: inherit; background: #fbfcfd; }
textarea { resize: vertical; min-height: 70px; }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.mention-box { display: flex; flex-wrap: wrap; gap: 6px; }
.mention-box label { font-size: 12px; background: #f2f4f7; border-radius: 14px; padding: 4px 12px; cursor: pointer; }
.mention-box input { width: auto; margin-right: 4px; }
.mention-box label.on { background: var(--dark); color: #fff; }
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; }

.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.96); width: 480px; max-width: 92vw; background: #fff; border-radius: 16px; z-index: 70; display: none; overflow: hidden; }
.modal.show { display: block; transform: translate(-50%,-50%) scale(1); }
.modal .mhead { padding: 14px 20px; background: var(--dark); color: #fff; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.modal .mhead .close-x { color: #fff; opacity: .8; }
.modal .mbody { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal .mfoot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.result-box { background: #f0fdf4; border: 1px solid var(--green-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 12px; display: none; }
.result-box b { color: #15803d; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #14181b 0%, #2b333a 60%, #22c55e 160%); }
.login-card { background: #fff; border-radius: 18px; padding: 38px 36px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 14px; margin-top: 18px; }
.login-err { color: #b91c1c; font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ---------- 后台 ---------- */
.admin-nav { background: #fff; border-bottom: 1px solid var(--line); padding: 0 28px; display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a { padding: 13px 18px; font-size: 14px; color: var(--ink); border-bottom: 3px solid transparent; }
.admin-nav a.on { color: var(--dark); border-bottom-color: var(--dark); font-weight: 700; }
.admin-body { padding: 22px 28px; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 13px; }
table.grid th { background: var(--dark); color: #fff; padding: 10px 12px; text-align: left; font-weight: 500; white-space: nowrap; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid #f0f2f4; vertical-align: top; }
table.grid tr:hover td { background: #f9fafb; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 0; }
.topbar { background: var(--dark); color: #fff; padding: 16px 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar h1 { font-size: 18px; letter-spacing: 1px; }
.topbar .sub { font-size: 12px; opacity: .75; margin-top: 3px; }
.topbar .spacer { flex: 1; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.btn.ghost { background: rgba(255,255,255,.15); color: #fff; }

/* ================= 三端自适应 ================= */
/* 平板：721-1100px —— 保持三列，收窄边栏 */
@media (min-width: 721px) and (max-width: 1100px) {
  .sidebar { width: 200px; }
  .main { padding: 18px 16px 26px; }
  .modules { gap: 10px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 19px; }
}

/* 手机：≤720px —— 边栏变顶部横滑条，模块单列瀑布流 */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; -webkit-overflow-scrolling: touch; }
  .mobile-nav a { flex-shrink: 0; font-size: 12.5px; padding: 7px 14px; border-radius: 18px; background: #f2f4f7; color: #4b5563; display: flex; align-items: center; gap: 6px; }
  .mobile-nav a .dot { width: 8px; height: 8px; border-radius: 3px; }
  .mobile-nav a.on { background: var(--dark); color: #fff; font-weight: 700; }
  .main { padding: 14px 12px 24px; }
  .page-head h1 { font-size: 17px; }
  .head-actions .btn { padding: 7px 12px; font-size: 12px; }
  .modules { grid-template-columns: 1fr; gap: 14px; }
  .detail-grid { grid-template-columns: 1fr; }
  .bs-card .bs-prog { margin-left: 0; width: 100%; }
  .bs-card .bs-prog .bar { flex: 1; }
  .drawer { width: 100vw; max-width: 100vw; }
  .modal { width: 94vw; }
  .modal .mbody { max-height: 60vh; }
  .form-row { flex-direction: column; gap: 0; }
  .form-row > div { max-width: none !important; }
  .admin-body { padding: 14px; }
  .admin-nav { padding: 0 10px; }
  .admin-nav a { padding: 11px 12px; font-size: 13px; }
  table.grid { font-size: 12px; }
  table.grid th, table.grid td { padding: 7px 8px; }
  .topbar { padding: 12px 14px; }
}

/* 小屏手机：≤380px */
@media (max-width: 380px) {
  .page-head h1 { font-size: 16px; }
  .dc-num { font-size: 24px; }
}
