/* 项目讨论清单管理系统 - 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --main: #4f6ef7;
  --main2: #7a5af8;
  --grad: linear-gradient(135deg, #4f6ef7 0%, #7a5af8 100%);
  --bg: #f5f6fa;
  --line: #e8eaf0;
  --txt: #2b2f3a;
  --muted: #8a90a2;
  --ok: #17a673;
  --warn: #e6a23c;
  --danger: #e5484d;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px;
}
a { color: var(--main); text-decoration: none; }
.hide { display: none !important; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: var(--grad);
}
.login-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 34px 32px 28px;
  box-shadow: 0 18px 50px rgba(38, 45, 90, .28);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.login-btn {
  width: 100%; margin-top: 22px; padding: 11px; border: 0; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 15px; cursor: pointer;
}
.login-btn:hover { opacity: .92; }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 10px; text-align: center; }

/* ---------- 输入 ---------- */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="file"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13px; color: var(--txt); font-family: inherit; outline: none;
  transition: box-shadow .15s, border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--main); box-shadow: 0 0 0 3px rgba(79, 110, 247, .13); }
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
input[readonly] { background: #f7f8fc; color: var(--muted); }

/* ---------- 工作台布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .18s, flex-basis .18s;
}
.sidebar.collapsed { width: 62px; flex-basis: 62px; }
.sidebar .logo {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; overflow: hidden;
}
.sidebar .logo .dot {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.menu { padding: 10px 8px; overflow-y: auto; flex: 1; }
.menu .mi {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #545a6e; cursor: pointer; margin-bottom: 3px; white-space: nowrap; overflow: hidden;
  font-size: 13.5px; border: 0; background: none; width: 100%; text-align: left;
}
.menu .mi:hover { background: #f4f6fd; color: var(--main); }
.menu .mi.on { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(79, 110, 247, .28); }
.menu .mi .ic { font-size: 15px; flex: 0 0 18px; text-align: center; }
.sidebar.collapsed .menu .mi .tx, .sidebar.collapsed .logo .tx { display: none; }
.sidebar .fold {
  border-top: 1px solid var(--line); padding: 9px; text-align: center; color: var(--muted);
  cursor: pointer; font-size: 12px;
}
.sidebar .fold:hover { color: var(--main); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--grad); color: #fff; display: flex; align-items: center;
  gap: 16px; padding: 0 20px; position: sticky; top: 0; z-index: 60;
  box-shadow: 0 2px 12px rgba(70, 80, 160, .18);
}
.topbar .title { font-size: 16px; font-weight: 600; white-space: nowrap; }
.topbar .gsearch { flex: 1; max-width: 440px; position: relative; }
.topbar .gsearch input {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  color: #fff; padding-left: 34px;
}
.topbar .gsearch input::placeholder { color: rgba(255, 255, 255, .75); }
.topbar .gsearch input:focus { background: rgba(255, 255, 255, .28); box-shadow: none; border-color: #fff; }
.topbar .gsearch .si { position: absolute; left: 11px; top: 8px; opacity: .85; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; cursor: pointer; font-size: 18px; line-height: 1; }
.bell .dot-red {
  position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #ff4d4f; color: #fff; font-size: 11px; line-height: 17px;
  text-align: center; font-weight: 600;
}
.who { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.who .av {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.who .meta b { font-weight: 600; }
.who .meta div { opacity: .85; font-size: 11px; }
.tbtn {
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .14); color: #fff;
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 12.5px;
}
.tbtn:hover { background: rgba(255, 255, 255, .28); }
.content { padding: 18px 20px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(30, 40, 90, .04); }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-h .sp { margin-left: auto; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h2 { font-size: 18px; }
.page-h .sp { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.btn {
  border: 1px solid var(--line); background: #fff; color: #4a5069; border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #c9d2f5; color: var(--main); background: #f7f9ff; }
.btn.primary { background: var(--grad); border: 0; color: #fff; }
.btn.primary:hover { opacity: .93; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fdeeee; border-color: #f3c9ca; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #eef1ff; color: #3b5de7; }
.badge.gray { background: #f1f2f6; color: #7a8095; }
.badge.green { background: #e9f9ef; color: #17a673; }
.badge.orange { background: #fdf6e7; color: #b8832a; }
.badge.purple { background: #f3efff; color: #7a5af8; }
.badge.red { background: #fdeeee; color: #d34a4d; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.stat .ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: #eef1ff; }
.stat .n { font-size: 22px; font-weight: 700; line-height: 1.15; }
.stat .l { font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
th { background: #fafbff; color: #606a86; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #f7f8ff; }
.table-wrap { overflow-x: auto; }
td .row-btn { margin-right: 4px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .f-wide { grid-column: 1 / -1; }
.fld label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.fld .hint { font-size: 11.5px; color: #a4a9bb; margin-top: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .fld { min-width: 132px; }

.proj-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.proj-card:hover { box-shadow: 0 8px 22px rgba(50, 60, 130, .09); transform: translateY(-1px); }
.proj-card .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.proj-card .pn { font-weight: 600; color: var(--main); }
.proj-card .q { color: #4c5165; font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.proj-card .pf { display: flex; gap: 12px; margin-top: 9px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 14px; font-size: 13px; }

/* 讨论区 */
.disc { border-left: 3px solid #e8eaf0; padding: 0 0 12px 14px; margin-bottom: 12px; }
.disc.pinned { border-left-color: var(--main); background: #fafbff; border-radius: 0 10px 10px 0; padding: 12px 14px; }
.disc-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 12.5px; }
.disc-h .nm { font-weight: 600; color: #3b4157; }
.disc-b { white-space: pre-wrap; line-height: 1.62; color: #3b4157; font-size: 13.5px; }
.disc-f { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; background: #f3f5fd; border: 1px solid #e4e8f8; border-radius: 8px; padding: 4px 9px; font-size: 12px; color: #4f5a80; cursor: pointer; }
.file-chip:hover { background: #e9edfc; }
.disc-kids { margin: 10px 0 0 6px; padding-left: 14px; border-left: 2px dashed #e8eaf0; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 26px; }
.reply-box { margin-top: 8px; }
.reply-box textarea { min-height: 62px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(28, 33, 56, .45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 96vw; max-height: 88vh; overflow: auto; padding: 20px 22px; box-shadow: 0 20px 50px rgba(20, 25, 60, .28); }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal.wide { width: 760px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: #2b2f45; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); opacity: .96; }
.toast-item.ok { background: #17a673; }
.toast-item.err { background: #e5484d; }

/* 登录/注册切换 */
.auth-tabs { display: flex; gap: 6px; background: #f3f4fa; border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.auth-tabs .atab { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: #606a86; }
.auth-tabs .atab.on { background: #fff; color: var(--main); font-weight: 600; box-shadow: 0 1px 4px rgba(40, 50, 110, .12); }
.auth-tip { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
.login-card label { color: var(--muted); }

/* 可见范围 / 权限勾选列表 */
.acl-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-height: 190px; overflow: auto; background: #fcfcff; }
.acl-item { display: block; padding: 5px 4px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.acl-item:hover { background: #f2f5ff; }
.acl-item input { margin-right: 6px; vertical-align: middle; }

/* 趋势条 */
.trend { display: flex; align-items: flex-end; gap: 7px; height: 130px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.trend .bar { width: 100%; background: var(--grad); border-radius: 5px 5px 0 0; min-height: 3px; }
.trend .lb { font-size: 10px; color: var(--muted); }
.trend .vv { font-size: 11px; color: #4a5069; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.unread-item { border-left: 3px solid var(--main); }
.unread-item.read { border-left-color: #e8eaf0; opacity: .72; }
.msg-line { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #f0f2f7; }
.msg-line:hover { background: #f7f8ff; }
pre.backup { background: #f7f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; overflow: auto; max-height: 200px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.quick .qk { border: 1px dashed #c9d2f5; border-radius: 10px; padding: 12px 16px; cursor: pointer; color: var(--main); background: #fafbff; }
.quick .qk:hover { background: #f1f4ff; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { width: 62px; flex-basis: 62px; }
  .sidebar .menu .mi .tx, .sidebar .logo .tx { display: none; }
}
