:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f7f9;
  color: #1f2933;
  --sticky-tools-height: 0px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f7f9;
}

.hidden {
  display: none !important;
}

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

.login-panel,
.panel,
.modal-panel {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(31, 41, 51, 0.08);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

p {
  color: #52606d;
}

main {
  width: 100%;
  margin: 0;
  padding: var(--sticky-tools-height) 12px 32px;
  background: #f4f7f9;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: #1f7a8c;
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

button.secondary {
  color: #1f2933;
  background: #e6eef3;
}

button:disabled {
  cursor: wait;
  opacity: 0.75;
}

button.loading::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

.icon-action,
.search-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}

.icon-action.loading::before,
.search-button.loading::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.icon-action.loading .button-label,
.search-button.loading .button-label {
  display: none;
}

.button-label {
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
  padding: 9px 10px;
}

input[type="date"] {
  text-align: center;
}

input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field {
  padding: 0;
}

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

label {
  display: grid;
  gap: 6px;
  color: #334e68;
  font-size: 14px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
}

.summary-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  color: #1f2933;
  box-shadow: none;
}

.summary-card.active {
  border-color: #1f7a8c;
  box-shadow: inset 0 0 0 1px #1f7a8c;
}

.summary-card:hover {
  background: #f8fafc;
}

.summary-card.loading-card::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid #1f7a8c;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.summary div {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.summary span {
  display: block;
  color: #52606d;
  font-size: 13px;
}

.summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.panel {
  padding: 16px 14px;
}

.list-panel {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.sticky-tools {
  position: fixed;
  top: 0;
  left: 12px;
  right: 12px;
  z-index: 20;
  padding: 10px 0;
  background: #f4f7f9;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 40px 40px;
  gap: 10px;
  margin-bottom: 0;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
}

.search-box input {
  border-radius: 6px 0 0 6px;
}

.search-button {
  border-radius: 0 6px 6px 0;
}

.table-wrap {
  overflow: visible;
  background: #fff;
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  border-right: 1px solid #d9e2ec;
  border-bottom: 1px solid #e6eef3;
  padding: 12px 10px;
  text-align: center !important;
  vertical-align: middle;
  font-size: 14px;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: var(--sticky-tools-height);
  z-index: 15;
  color: #52606d;
  font-weight: 600;
  background: #f8fafc;
}

th:nth-child(1),
td:nth-child(1) {
  width: 56px;
}

th:nth-child(2),
td:nth-child(2) {
  width: auto;
}

th:nth-child(3),
td:nth-child(3) {
  width: auto;
}

th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5) {
  width: 148px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 172px;
}

.plan-row {
  cursor: pointer;
}

.plan-row:nth-child(odd) {
  background: rgb(245, 250, 255);
}

.plan-row:nth-child(even) {
  background: rgb(255, 250, 245);
}

.plan-row:hover {
  background: #eef6fb;
}

.content-cell,
.remark-cell {
  text-align: left !important;
  line-height: 1.5;
  word-break: break-word;
}

.index-cell {
  color: #52606d;
  font-weight: 400;
}

.date-cell {
  white-space: nowrap;
}

.date-block {
  display: inline-grid;
  gap: 4px;
  text-align: left;
  width: 116px;
}

.date-block span {
  color: #52606d;
}

.empty {
  padding: 28px;
  color: #52606d;
}

.progress {
  position: relative;
  width: 100%;
  height: 24px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef3;
}

.progress-fill {
  display: block;
  height: 100%;
}

.mobile-status {
  display: none;
}

.mobile-progress-text {
  display: none;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.progress-label.is-idle {
  animation: idleBlink 1.6s ease-in-out infinite;
}

@keyframes idleBlink {
  0%,
  100% {
    color: #c92a2a;
    text-shadow: none;
  }

  50% {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

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

.percent-input span {
  color: #52606d;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
}

.modal-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  background: #fff;
  border-bottom: 1px solid #e6eef3;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: #e6eef3;
  color: #1f2933;
  font-size: 22px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 0.72fr) minmax(0, 0.72fr) minmax(0, 0.72fr);
  column-gap: 18px;
  row-gap: 14px;
  justify-content: start;
}

.form-grid label:nth-child(2) {
  margin-right: 4px;
}

.form-grid label:nth-child(3) {
  margin-left: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  min-width: 180px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2933;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s ease;
}

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

@media (max-width: 900px) {
  main {
    width: 100%;
    padding: var(--sticky-tools-height) 6px 28px;
  }

  .sticky-tools {
    left: 6px;
    right: 6px;
  }

  .summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 0 6px;
    overflow: visible;
  }

  .summary-card {
    padding: 7px 4px;
    text-align: center;
  }

  .summary span {
    font-size: 10px;
    line-height: 1.2;
  }

  .summary strong {
    margin-top: 3px;
    font-size: 16px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .filters button {
    width: 100%;
  }

  th,
  td {
    padding: 9px 5px;
    font-size: 12px;
  }

  .progress {
    width: 100%;
    height: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .login-panel,
  .panel,
  .modal-panel {
    border-radius: 8px;
  }

  .panel {
    padding: 10px 6px;
  }

  .modal {
    padding: 10px;
    align-items: start;
    overflow-x: hidden;
  }

  .modal-panel {
    width: min(88vw, 390px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .modal-head {
    top: -14px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .search-box {
    min-width: 0;
  }

  .form-grid {
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 0.76fr);
    column-gap: 6px;
    row-gap: 12px;
    justify-content: start;
  }

  .form-grid input,
  .form-grid select {
    min-width: 0;
    max-width: 118px;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 11px;
  }

  .percent-input {
    max-width: 118px;
    gap: 4px;
  }

  .form-grid label:nth-child(2),
  .form-grid label:nth-child(3) {
    margin: 0;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .wide {
    grid-column: 1 / -1;
  }

  table {
    table-layout: fixed;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 36px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: auto;
  }

  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  th:nth-child(4),
  td:nth-child(4) {
    display: table-cell;
    width: 68px;
  }

  th:nth-child(6),
  td:nth-child(6) {
    width: 48px;
  }

  .date-block {
    gap: 2px;
    font-size: 10px;
    line-height: 1.2;
    width: 58px;
  }

  .date-block span {
    display: inline;
  }

  .content-cell {
    font-size: 13px;
  }

  .progress {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background:
      radial-gradient(circle at center, #fff 0 54%, transparent 55%),
      conic-gradient(var(--progress-color) calc(var(--rate) * 1%), #e6eef3 0);
  }

  .progress-fill {
    display: none;
  }

  .progress-label {
    color: #1f2933;
    font-size: 9px;
    text-shadow: none;
  }

  .desktop-progress-text {
    display: none;
  }

  .mobile-progress-text {
    display: block;
  }

  .mobile-status {
    display: none;
  }
}
