:root {
  --ink: #27302f;
  --muted: #6d7774;
  --paper: #fffaf0;
  --panel: #ffffff;
  --chalk: #24443d;
  --mint: #b8eadb;
  --blue: #9bd8f3;
  --pink: #ffd1dc;
  --tomato: #ff7868;
  --yellow: #ffe39c;
  --shadow: 0 14px 34px rgba(39, 48, 47, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  caret-color: transparent;
  background:
    radial-gradient(circle at 12% 8%, rgba(155,216,243,.35), transparent 25%),
    radial-gradient(circle at 92% 12%, rgba(255,209,220,.45), transparent 24%),
    linear-gradient(180deg, #fff7e8, #eef9f1);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
a { color: #176b87; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid #d9ded8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  caret-color: auto;
}
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-weight: 700; color: #40504c; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(39,48,47,.08);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 20px; font-weight: 900; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: #fff; border-radius: 50%; box-shadow: var(--shadow); }
.nav { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.nav a, .button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(39,48,47,.08);
  cursor: pointer;
}
.nav a:hover, .button:hover { transform: translateY(-1px); text-decoration: none; }
.button.primary { background: var(--chalk); color: #fff9df; }
.button.ghost { background: transparent; box-shadow: none; border: 1px solid rgba(39,48,47,.18); }
.button.danger { background: #ffe1df; color: #9d2b23; }
.button.small { padding: 7px 10px; font-size: 13px; }
.logout { display: flex; align-items: center; gap: 8px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 24px auto 64px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}
.login-card h1 { margin: 8px 0 4px; font-size: 34px; }
.login-mascots { font-size: 42px; letter-spacing: 8px; }

.hero-board {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 5vw, 46px);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent),
    var(--chalk);
  color: #fffbe4;
  box-shadow: var(--shadow);
  border: 8px solid #dfb975;
}
.hero-board h1 { margin: 0; font-size: clamp(34px, 7vw, 64px); letter-spacing: 0; }
.hero-icons { align-self: center; font-size: clamp(36px, 8vw, 72px); white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 0; color: #b8eadb; font-weight: 900; }

.page-title { margin: 28px 0 18px; }
.page-title h1 { margin: 0 0 8px; font-size: 36px; }
.grid { display: grid; gap: 18px; }
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cards { display: grid; gap: 16px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(39,48,47,.08);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(39,48,47,.07);
}
.panel.wide { grid-column: span 2; }
.panel h2, .card h2, .card h3 { margin-top: 0; }
.task-card { display: grid; gap: 10px; }
.task-card h3 { margin: 0; }
.project-mini { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 800; }
.project-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--project-color); box-shadow: 0 0 0 3px rgba(39,48,47,.06); }
.project-task-group { margin-bottom: 18px; border-top: 5px solid var(--project-color); }
.task-with-badge { display: grid; gap: 8px; }
.project-card { position: relative; overflow: hidden; }
.project-ribbon, .project-line::before {
  background: var(--project-color);
  border-radius: 99px;
}
.project-ribbon { position: absolute; top: 0; left: 0; right: 0; height: 8px; }
.project-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #d8ddd8; }
.project-line::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; }
.project-hero { display: flex; justify-content: space-between; border-top: 8px solid var(--project-color); }
.task-hero { display: flex; justify-content: space-between; gap: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4f1;
  color: #40504c;
  font-size: 12px;
  font-weight: 900;
}
.tag-ok { background: #dcf8e8; color: #1f6a3d; }
.tag-warn { background: #fff0b8; color: #806000; }
.tag-danger, .status-卡住, .priority-高 { background: #ffe1df; color: #9d2b23; }
.status-进行中 { background: #dff2ff; color: #145c78; }
.status-已完成 { background: #dcf8e8; color: #1f6a3d; }
.priority-中 { background: #fff0b8; color: #806000; }
.priority-低 { background: #eef4f1; color: #40504c; }

.progress { height: 9px; border-radius: 99px; overflow: hidden; background: #edf1ed; }
.progress.large { height: 14px; margin-top: 12px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--mint)); border-radius: inherit; }
.tiny, .muted { color: var(--muted); }
.tiny { font-size: 13px; }
.empty { color: var(--muted); padding: 16px; background: #fffaf0; border-radius: 8px; }
.scroll-panel {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(36,68,61,.28) rgba(255,250,240,.6);
}
.scroll-panel::-webkit-scrollbar { width: 8px; }
.scroll-panel::-webkit-scrollbar-track { background: rgba(255,250,240,.65); border-radius: 99px; }
.scroll-panel::-webkit-scrollbar-thumb { background: rgba(36,68,61,.25); border-radius: 99px; }
.scroll-panel::-webkit-scrollbar-thumb:hover { background: rgba(36,68,61,.36); }
.nudge-scroll { max-height: 260px; }
.task-list-scroll, .updates-scroll { display: grid; gap: 12px; }
.member-scroll {
  overflow-x: hidden;
}
.member-scroll .member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}
.member-scroll .member-card > div {
  min-width: 0;
}
.member-scroll .member-card h3,
.member-scroll .member-card p {
  overflow-wrap: anywhere;
}
.member-scroll .nudge-form {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}
.member-scroll .nudge-form input,
.member-scroll .nudge-form .button {
  width: 100%;
}

.member-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(39,48,47,.07);
}
.member-section-title { margin-bottom: 10px; }
.inactive-member { opacity: .82; }
.member-card.tall { flex-wrap: wrap; }
.status-card { align-items: stretch; }
.status-text {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffaf0;
  color: #40504c;
}
.status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 32px;
  box-shadow: inset 0 -4px 0 rgba(39,48,47,.08);
}
.avatar-mermaid { background: #dff7ff; }
.avatar-rabbit { background: #fff1c6; }
.avatar-pig { background: #ffd8e3; }
.avatar-tomato { background: #ffd6cf; }
.avatar-lightbulb { background: #fff5c9; }
.avatar-img { object-fit: cover; background: #fff; }
.avatar-fallback { display: none; }
.avatar-tools { display: grid; gap: 8px; margin-top: 12px; }
.avatar-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.nudge-form { display: grid; gap: 8px; min-width: 150px; }
.notice-strip {
  margin: 18px 0;
  padding: 16px;
  background: #fff3bd;
  border: 2px dashed #d5a928;
  border-radius: 8px;
}
.nudge { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed rgba(39,48,47,.2); }
.mini-note { padding: 12px; margin: 10px 0; background: #fffaf0; border-radius: 8px; }
.mini-note.pinned { border-left: 5px solid var(--yellow); }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #d8ddd8; }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; font-weight: 800; }
.flash.success { background: #dcf8e8; color: #1f6a3d; }
.flash.error { background: #ffe1df; color: #9d2b23; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { margin-left: 0; }
  .hero-board, .project-hero, .task-hero, .nudge { flex-direction: column; }
  .dashboard-grid, .two-col, .cards.two, .cards.three, .member-grid, .form-grid { grid-template-columns: 1fr; }
  .panel.wide, .span-2 { grid-column: auto; }
  .hero-icons { align-self: flex-start; }
  .status-form { grid-template-columns: 1fr; }
  .avatar-upload { grid-template-columns: 1fr; }
  .scroll-panel { max-height: 360px; }
  .nudge-scroll { max-height: 240px; }
}
