/* ===== 管理工作台 - 白底淡蓝简约清新 ===== */
:root {
  --bg: #f4f9fd;
  --card: #ffffff;
  --line: #e3eef8;
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --primary-light: #e3f2fd;
  --text: #263238;
  --text2: #78909c;
  --ok: #43a047;
  --warn: #fb8c00;
  --danger: #e53935;
  --gray: #90a4ae;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(30, 136, 229, .08), 0 4px 16px rgba(30, 136, 229, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ===== 通用组件 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  padding: 8px 16px; font-size: 14px; background: var(--primary); color: #fff;
  transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn.ghost:hover { background: var(--primary-light); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #c62828; }
.btn.warn { background: var(--warn); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn.block { width: 100%; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 136, 229, .12); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }
label.fl { display: block; font-size: 13px; color: var(--text2); margin: 12px 0 5px; }
label.fl b { color: var(--danger); font-weight: normal; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title::before { content: ''; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }
.card-title .more { margin-left: auto; font-size: 13px; font-weight: normal; color: var(--primary); cursor: pointer; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.blue { background: var(--primary-light); color: var(--primary-dark); }
.badge.green { background: #e8f5e9; color: #2e7d32; }
.badge.orange { background: #fff3e0; color: #e65100; }
.badge.red { background: #ffebee; color: #c62828; }
.badge.gray { background: #eceff1; color: #546e7a; }
.badge.purple { background: #f3e5f5; color: #7b1fa2; }

.tag { display: inline-block; padding: 1px 8px; background: #f1f6fa; border-radius: 4px; font-size: 12px; color: var(--text2); margin-right: 6px; }

.progress { height: 7px; background: #eef4fa; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #64b5f6, var(--primary)); border-radius: 4px; }

table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th { text-align: left; color: var(--text2); font-weight: 500; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tb td { padding: 11px 10px; border-bottom: 1px solid #f0f6fb; vertical-align: top; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tr:hover td { background: #f8fbfe; }

.empty { text-align: center; color: var(--text2); padding: 36px 0; font-size: 14px; }
.empty::before { content: '📭'; display: block; font-size: 30px; margin-bottom: 8px; opacity: .6; }

/* 模态框 */
.mask {
  position: fixed; inset: 0; background: rgba(38, 50, 56, .45); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; overflow-y: auto;
  padding: 5vh 16px 5vh;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: pop .18s ease;
  padding: 22px 24px; margin-bottom: 5vh;
  max-height: 86vh; overflow-y: auto;
}
@keyframes pop { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 17px; margin-bottom: 4px; display: flex; align-items: center; }
.modal .sub { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.modal .mfoot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 420px; }
.xclose { margin-left: auto; cursor: pointer; color: var(--text2); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.xclose:hover { background: #f0f4f8; color: var(--text); }

/* toast */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.12); border-radius: 10px; padding: 10px 18px; font-size: 14px; animation: pop .2s ease; max-width: 86vw; }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.err { border-left: 4px solid var(--danger); }
.toast.warn { border-left: 4px solid var(--warn); }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px 12px; font-size: 13.5px; }
.tl-item::before { content: ''; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.tl-item.sys::before { background: var(--gray); box-shadow: 0 0 0 3px #eceff1; }
.tl-item.urge::before { background: var(--warn); box-shadow: 0 0 0 3px #fff3e0; }
.tl-item .tl-meta { color: var(--text2); font-size: 12px; margin-top: 2px; }

/* ===== 布局 ===== */
#login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #e8f4fd 0%, #f4f9fd 45%, #fdfefe 100%); padding: 20px;
}
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 34px 32px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .lg-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 15px; background: linear-gradient(135deg, #64b5f6, #1e88e5); display: flex; align-items: center; justify-content: center; font-size: 27px; box-shadow: 0 6px 18px rgba(30,136,229,.35); }
.login-logo h1 { font-size: 21px; letter-spacing: 1px; }
.login-logo p { font-size: 12.5px; color: var(--text2); margin-top: 5px; }
.login-err { background: #ffebee; color: #c62828; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px; display: none; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text2); text-align: center; line-height: 1.8; }

#app-view { display: none; min-height: 100vh; }

/* 侧栏 */
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 218px; background: #fff;
  border-right: 1px solid var(--line); z-index: 50; display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side-logo .lg { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #64b5f6, #1e88e5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.side-logo b { font-size: 16.5px; letter-spacing: .5px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-group { font-size: 11.5px; color: #a3b5c2; padding: 12px 10px 5px; letter-spacing: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9.5px 12px; border-radius: 9px;
  color: #546e7a; font-size: 14.5px; margin-bottom: 2px; cursor: pointer;
}
.nav a .ic { width: 20px; text-align: center; font-size: 16px; flex: none; }
.nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav a.on { background: var(--primary); color: #fff; font-weight: 500; box-shadow: 0 4px 12px rgba(30,136,229,.3); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: #b0bec5; }

/* 主区 */
.main { margin-left: 218px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(244, 249, 253, .92);
  backdrop-filter: blur(8px); display: flex; align-items: center; gap: 12px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 18px; }
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); padding: 5px 12px 5px 6px; border-radius: 30px; cursor: pointer; }
.userchip:hover { border-color: var(--primary); }
.userchip .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #64b5f6, #1e88e5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.userchip span { font-size: 13.5px; }
.hamburger { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; color: var(--text); }
.content { flex: 1; width: 100%; max-width: 1230px; margin: 0 auto; padding: 22px 26px 40px; }

/* 筛选栏 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input, .filters select.input { width: auto; }
.filters .search { flex: 1; min-width: 160px; max-width: 320px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .num { font-size: 27px; font-weight: 700; line-height: 1.2; margin-top: 6px; }
.stat .lbl { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat .ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 8px; }
.stat.c-blue .ic { background: var(--primary-light); }
.stat.c-green .ic { background: #e8f5e9; }
.stat.c-orange .ic { background: #fff3e0; }
.stat.c-red .ic { background: #ffebee; }
.stat.clickable { cursor: pointer; transition: transform .15s; }
.stat.clickable:hover { transform: translateY(-2px); }

/* 双栏 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* 任务卡片 */
.task-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; cursor: pointer; transition: border .15s; }
.task-item:hover { border-color: #a9d3f5; }
.task-item .t-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.task-item .t-title { font-size: 15px; font-weight: 600; flex: 1; min-width: 180px; line-height: 1.5; }
.task-item .t-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 12.5px; color: var(--text2); align-items: center; }
.task-item .t-meta .m { display: flex; align-items: center; gap: 4px; }
.task-item .t-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.task-item .t-foot .progress { flex: 1; }
.task-item .t-foot .pct { font-size: 12px; color: var(--text2); }
.urge-flag { color: var(--warn); font-size: 12px; }

/* 文件分类 */
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cats .cat { padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 20px; font-size: 13.5px; color: #546e7a; cursor: pointer; }
.cats .cat:hover { border-color: var(--primary); color: var(--primary); }
.cats .cat.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 文件行 */
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid #f0f6fb; }
.file-row:hover { background: #f8fbfe; }
.file-row .ficon { width: 38px; height: 38px; flex: none; border-radius: 9px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.file-row .fmain { flex: 1; min-width: 0; }
.file-row .fname { font-size: 14px; word-break: break-all; cursor: pointer; }
.file-row .fname:hover { color: var(--primary); }
.file-row .fmeta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.file-row .fact { flex: none; display: flex; gap: 6px; }
.upload-bar { height: 10px; background: #eef4fa; border-radius: 5px; overflow: hidden; margin-top: 8px; display: none; }
.upload-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #64b5f6, var(--primary)); transition: width .2s; }

/* 日志 */
.diary-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; }
.diary-item .d-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.diary-item .d-date { font-weight: 700; font-size: 15px; }
.diary-item .d-title { color: var(--text2); font-size: 13.5px; }
.diary-item .d-content { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: #37474f; }
.diary-item .d-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.diary-item .d-imgs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); }

/* 周报 */
.week-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; }
.week-item .w-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.week-item .w-content { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.week-item .w-next { margin-top: 10px; padding: 10px 12px; background: #f6fbff; border-radius: 8px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; color: #455a64; }

/* 图片灯箱 */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 300; display: none; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox.show { display: flex; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }

/* 月历导航 */
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav b { font-size: 15px; min-width: 86px; text-align: center; }

/* 表单网格 */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fgrid .full { grid-column: 1 / -1; }

/* 用户菜单 */
.user-menu { position: absolute; right: 26px; top: 62px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.13); min-width: 170px; padding: 6px; display: none; z-index: 60; }
.user-menu.show { display: block; }
.user-menu a { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 7px; color: var(--text); font-size: 14px; cursor: pointer; }
.user-menu a:hover { background: var(--primary-light); color: var(--primary-dark); }
.user-menu hr { border: none; border-top: 1px solid var(--line); margin: 5px 0; }

/* ===== 移动端适配 ===== */
.mask-m { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 45; }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.08); }
  .side.open { transform: none; }
  .mask-m.show { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 14px; position: sticky; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .topbar h2 { font-size: 16.5px; flex: 1; }
  .content { padding: 14px 12px 90px; }
  .grid2 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .filters select.input { max-width: 46vw; }
  table.tb { display: block; overflow-x: auto; white-space: nowrap; }
  .modal { padding: 18px 16px; }
  .stat .num { font-size: 22px; }
  .stats { gap: 10px; }
  .task-item .t-title { min-width: 100%; }
}

/* 桌面滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfdde8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b0c8da; }
::-webkit-scrollbar-track { background: transparent; }
