:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --line: #dce5e1;
  --text: #17211c;
  --muted: #64746c;
  --brand: #1f7a5a;
  --title-blue: #1d5fd1;
  --brand-strong: #155f45;
  --brand-soft: #e7f4ef;
  --warn: #9a5b00;
  --shadow: 0 10px 28px rgba(21, 95, 69, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
}

.app-title {
  color: var(--brand);
  font-weight: 800;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  color: var(--title-blue);
  font-weight: 800;
}

h3 {
  margin-bottom: 12px;
  font-size: 19px;
  color: var(--title-blue);
  font-weight: 800;
}

.status,
.user-chip {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.layout {
  width: min(1240px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab,
button,
.ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.tab {
  padding: 10px 16px;
  font-weight: 800;
}

.tab-emphasis {
  min-width: 132px;
}

.tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.panel {
  display: none;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.section-head p,
.hint {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-head.compact {
  margin-top: 24px;
  margin-bottom: 12px;
}

.grid-form,
.toolbar,
.history-toolbar,
.settings-grid,
.manager-grid,
.split-grid {
  display: grid;
  gap: 16px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid,
.manager-grid,
.split-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.employee-history-stack {
  grid-template-columns: 1fr;
}

.toolbar {
  grid-template-columns: 1.1fr 1fr 1fr auto auto auto;
  align-items: end;
  margin-bottom: 18px;
}

.manager-actions {
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
}

.manager-editor-block {
  margin-top: 18px;
}

.manager-notifications {
  margin-bottom: 18px;
}

.notice-item {
  border-left: 4px solid var(--title-blue);
  background: #f8fbff;
}

.manager-log-grid {
  grid-template-columns: 1fr;
  margin-top: 22px;
}

.toolbar.tight {
  grid-template-columns: 1fr auto;
}

.history-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.history-block {
  margin-top: 18px;
}

.date-rule {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.section-label-title {
  margin: 24px 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.wide,
.form-title {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 122, 90, 0.18);
  border-color: var(--brand);
}

.primary,
.ghost {
  min-height: 40px;
  padding: 9px 14px;
}

.ghost.small,
.primary.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.ghost.danger {
  border-color: rgba(180, 35, 24, 0.35);
  color: #b42318;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
}

.primary:hover {
  background: var(--brand-strong);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.list {
  display: grid;
  gap: 12px;
}

.item,
.rule-document,
.rule-guidance,
.auth-box,
.upload-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.rule-document {
  margin-top: 24px;
  padding: 0;
  overflow: hidden;
}

.rule-document summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 22px;
  color: var(--title-blue);
}

.rule-document summary .summary-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.rule-guidance {
  margin-top: 0;
  margin-bottom: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fbfcfb;
}

.rule-guidance p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.item-title {
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.muted-inline {
  color: var(--muted);
}

.item p {
  margin-bottom: 6px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.task-collapse {
  display: block;
}

.task-collapse > summary {
  cursor: pointer;
  list-style-position: inside;
  font-weight: 800;
}

.task-collapse > summary::marker {
  color: var(--muted);
}

.task-collapse-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.task-summary-title {
  margin-right: 10px;
}

.task-summary-title .task-today-badge {
  margin-left: 8px;
  vertical-align: middle;
}

.task-summary-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  vertical-align: middle;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.task-owner-badge {
  background: #f5f7f6;
  color: var(--muted);
}

.task-today-badge {
  border-color: rgba(29, 95, 209, 0.28);
  background: #f3f7ff;
  color: var(--title-blue);
}

.task-proposal-badge {
  margin-left: 8px;
  vertical-align: middle;
  border-color: rgba(185, 112, 0, 0.28);
  background: #fff8e6;
  color: #9a5b00;
}

.task-customer-badge {
  margin-left: 8px;
  vertical-align: middle;
  border-color: rgba(185, 112, 0, 0.28);
  background: #fff8e6;
  color: #9a5b00;
}

.task-level-badge.level-A {
  border-color: rgba(180, 35, 24, 0.32);
  background: #fff1f0;
  color: #b42318;
}

.task-level-badge.level-B {
  border-color: rgba(31, 122, 90, 0.28);
  background: #eef8f1;
  color: var(--brand-strong);
}

.task-level-badge.level-C {
  border-color: rgba(83, 98, 92, 0.25);
  background: #f5f7f6;
  color: var(--muted);
}

.countdown-normal {
  background: #eef8f1;
  color: var(--brand-strong);
}

.countdown-warning {
  background: #fff7e6;
  color: #ad6800;
}

.countdown-overdue {
  background: #fff1f0;
  color: #b42318;
}

.countdown-done,
.countdown-neutral {
  background: #f5f7f6;
  color: var(--muted);
}

.item-actions,
.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.priority-task-panel {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-list {
  margin-top: 14px;
}

.host-proposal-queue {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 2px solid rgba(185, 112, 0, 0.38);
  border-radius: 8px;
  background: #fffaf0;
}

.host-proposal-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.host-proposal-queue-title,
.task-list-heading {
  color: var(--brand-strong);
  font-weight: 800;
}

.host-proposal-count {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #9a5b00;
  color: #ffffff;
  font-weight: 800;
}

.host-proposal-queue-list {
  display: grid;
  gap: 10px;
}

.task-list-heading {
  margin: 14px 0 10px;
}

.task-awaiting-approval {
  border-color: rgba(185, 112, 0, 0.45);
}

.task-awaiting-approval > summary {
  background: #fffdf7;
}

.task-draft-list {
  display: grid;
  gap: 12px;
}

.task-draft-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(160px, 0.7fr);
  gap: 12px;
}

.task-draft-manager-fields {
  display: grid;
  gap: 12px;
}

.task-edit-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(160px, 0.7fr) minmax(140px, 0.6fr);
  gap: 12px;
}

.task-detail-textarea {
  min-height: 150px;
}

.task-market-permission,
.market-review-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-single-submit {
  display: flex;
  justify-content: flex-start;
}

.task-plan-box,
.task-plan-readonly {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-plan-box textarea {
  min-height: 120px;
}

.task-plan-box button {
  justify-self: start;
}

.task-plan-readonly p {
  margin: 0;
  white-space: pre-wrap;
}

.task-proposal-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(185, 112, 0, 0.35);
  border-radius: 8px;
  background: #fffdf7;
}

.task-proposal-decision {
  border-style: solid;
  border-width: 2px;
}

.task-proposal-title {
  color: #9a5b00;
  font-weight: 800;
}

.task-proposal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.task-official-version {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-official-version p {
  margin: 0;
  white-space: pre-wrap;
}

.task-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-section > summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--brand-strong);
  font-weight: 800;
}

.task-section-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.task-section-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.task-history {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.task-history summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.task-history-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.task-history-week {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-history-week > summary {
  padding: 10px 12px;
  color: var(--brand-strong);
}

.task-history-week-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.task-history-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-history-row p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.grade-button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grade-btn.active,
.level-btn.active,
.spec-mode-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.input-action-row .ghost {
  white-space: nowrap;
}

.task-progress-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(29, 95, 209, 0.18);
  border-radius: 8px;
  background: #f8fbff;
}

.task-progress-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-summary {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #f8fbff;
}

.task-progress-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.task-progress-attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
}

.task-name {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--title-blue);
  font-weight: 800;
}

.file-link {
  display: inline;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--title-blue);
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
}

.file-link:hover {
  color: var(--brand-strong);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: #fbfcfb;
}

.empty.warning {
  border-color: rgba(154, 91, 0, 0.35);
  color: var(--warn);
  background: #fff8eb;
}

.empty.notice {
  border-color: rgba(29, 95, 209, 0.25);
  color: var(--title-blue);
  background: #f3f7ff;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.score-grid input {
  text-align: center;
}

.total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.rules-box {
  min-height: 280px;
}

.submit-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.prominent-submit {
  margin-top: 20px;
  margin-bottom: 6px;
}

.prominent-submit .primary {
  width: min(360px, 100%);
  min-height: 50px;
  font-size: 18px;
  font-weight: 800;
}

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

.account-grid.single {
  grid-template-columns: minmax(280px, 520px);
}

.account-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.account-card h3 {
  margin-bottom: 2px;
}

.account-card .primary {
  width: fit-content;
  min-width: 140px;
}

.upload-box,
.auth-box,
.employee-info-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.check-list {
  display: grid;
  gap: 8px;
}

.mention-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.reminder {
  border-color: rgba(31, 122, 90, 0.35);
  background: var(--brand-soft);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17211c;
  color: #ffffff;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .topbar,
  .item-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-form,
  .account-grid,
  .settings-grid,
    .manager-grid,
    .split-grid,
    .toolbar,
    .toolbar.tight,
    .history-toolbar,
    .mention-list,
    .task-draft-grid,
    .task-edit-grid,
    .score-grid {
    grid-template-columns: 1fr;
  }

  .input-action-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }
}
