/* Wayne OS 协作服务 - 全站样式
 * 设计语言沿用 Wayne OS「纸面工作台」：纸白画布 + 白卡片 + 夜空紫结构色 + 暖金点缀。
 * 单文件覆盖登录页 / 看板 / 邀请码管理三页，无构建步骤。
 */

:root {
  --bg: #f4faf6;
  --card: #ffffff;
  --ink: #1f3a31;
  --ink-soft: #3d5a4f;
  --mute: #7b928a;
  --line: #d8e8e0;
  --line-soft: #e9f4ee;
  --brand: #9dddb2;
  --brand-deep: #2f7a5f;
  --gold: #b8912f;
  --red: #a64032;
  --green: #2f7a5f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 58, 49, 0.04), 0 8px 24px rgba(31, 58, 49, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(244, 250, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--brand), #c9efd8);
  color: #143d2c;
  font-size: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand small {
  color: var(--mute);
  font-weight: 400;
  font-size: 12px;
}

.topbar .spacer { flex: 1; }

.topbar .who {
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
}

/* ---------- 通用控件 ---------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #143d2c;
  font-weight: 600;
}

.btn.primary:hover { background: #8ed3a4; }

.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { color: var(--red); border-color: #e6c9c4; }

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.icon-btn:hover { border-color: var(--ink); }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus {
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 3px rgba(157, 221, 178, 0.35);
}

textarea { resize: vertical; min-height: 72px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ---------- 布局 ---------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

.day-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.day-head h1 {
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.day-nav { display: flex; gap: 6px; margin-left: auto; }

.summary {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 8px 0 22px;
  max-width: 760px;
}

.stats {
  display: flex;
  gap: 18px;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--mute);
  flex-wrap: wrap;
}

.stats b {
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.stack { display: grid; gap: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.card-head h2 {
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-head .count {
  font-size: 12px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.card-body { padding: 8px 10px 12px; }

.empty {
  padding: 20px 12px;
  color: var(--mute);
  font-size: 13px;
  text-align: center;
}

/* ---------- 任务行 ---------- */

.task {
  display: flex;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 10px;
  transition: background 0.12s;
}

.task:hover { background: #f4fbf7; }
.task + .task { border-top: 1px solid var(--line-soft); border-radius: 0; }

.tick {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  border: 1.5px solid #bfd6ca;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
}

.task.done .tick { background: var(--green); border-color: var(--green); }
.task.done .title { color: var(--mute); text-decoration: line-through; }

.task-main { min-width: 0; flex: 1; }

.task .title {
  font-size: 14.5px;
  word-break: break-word;
}

.task .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef7f2;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag.gold { background: #fbf3dd; color: var(--gold); }
.tag.green { background: #e4f5ec; color: var(--green); }
.tag.purple { background: #e6f6ec; color: var(--brand-deep); }
/* 已完成：夜空紫（与「已进入工作台」的绿拉开对比，2026-10-29 用户要求） */
.tag.indigo { background: #ecebfa; color: #4a3fa0; }

.task .acts { display: flex; gap: 6px; align-items: flex-start; }

.linkish {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--mute);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.linkish:hover { color: var(--ink); }

/* ---------- 评论 ---------- */

.thread {
  margin: 0 10px 10px 40px;
  padding: 10px 12px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 10px;
}

.comment { font-size: 13px; }
.comment .ch {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--mute);
  font-size: 11.5px;
  margin-bottom: 2px;
}
.comment .ch b { color: var(--ink-soft); font-weight: 600; }
.comment p { margin: 0; white-space: pre-wrap; word-break: break-word; }

.comment-form { display: flex; gap: 8px; margin-top: 4px; }
.comment-form input { flex: 1; }

/* ---------- 指派 ---------- */

.assign-item {
  padding: 9px 10px;
  border-top: 1px solid var(--line-soft);
}

.assign-item:first-child { border-top: 0; }

.assign-item .title {
  font-size: 14px;
  word-break: break-word;
}

.assign-item .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--mute);
}

.assign-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  flex-wrap: wrap;
}

.assign-row input { flex: 1; min-width: 160px; }

/* ---------- 弹窗 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 45, 35, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-mask.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(20, 17, 45, 0.25);
}

.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ---------- 登录页 ---------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 28px 26px;
}

.auth-card .brand { margin-bottom: 6px; }
.auth-card .lead { color: var(--mute); font-size: 13px; margin: 0 0 22px; }

.tabs {
  display: flex;
  gap: 4px;
  background: #eef7f2;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.tabs button {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--mute);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 0;
  border-radius: 8px;
  cursor: pointer;
}

.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(38, 33, 92, 0.08); }

.msg {
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 9px;
  margin-bottom: 14px;
  display: none;
}

.msg.show { display: block; }
.msg.err { background: #fbebe8; color: var(--red); }
.msg.ok { background: #e9f4ef; color: var(--green); }

.hint { font-size: 12px; color: var(--mute); margin-top: 14px; line-height: 1.7; }
.hint code {
  background: #eef7f2;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
}

/* ---------- 管理页表格 ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.table th { color: var(--mute); font-weight: 500; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  background: #eef7f2;
  padding: 2px 7px;
  border-radius: 6px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .wrap { padding: 20px 16px 70px; }
  .topbar { padding: 12px 16px; }
  .day-head h1 { font-size: 22px; }
  .thread { margin-left: 10px; }
}

@media (max-width: 520px) {
  .topbar .who { display: none; }
  .day-nav { margin-left: 0; width: 100%; }
}
