:root {
  --blue-950: #09233f;
  --blue-900: #0f3761;
  --blue-800: #14558e;
  --blue-700: #1b6eac;
  --blue-100: #eaf5ff;
  --red: #e5232d;
  --red-dark: #b81218;
  --gold: #c9933c;
  --ink: #17212b;
  --muted: #687482;
  --line: #d9e6f2;
  --panel: #ffffff;
  --bg: #f4f8fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(229, 35, 45, 0.18), transparent 28%),
    linear-gradient(160deg, var(--blue-950) 0%, var(--blue-900) 38%, #f4f8fc 38.2%, #f4f8fc 100%);
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 45px rgba(4, 23, 42, 0.18);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border: 4px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.eyebrow {
  margin: 0 0 5px;
  color: #ffe2a5;
  font-size: 14px;
  font-weight: 900;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: #fff;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.15;
}

h2 {
  font-size: 30px;
}

.tabs {
  display: flex;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.tab {
  min-width: 108px;
  min-height: 44px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: transparent;
  font-weight: 900;
}

.tab.active {
  color: var(--blue-950);
  background: #fff;
}

.view {
  display: none;
  margin-top: 18px;
}

.view.active {
  display: block;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(15, 55, 97, 0.13);
}

.form-panel,
.guide-panel,
.login-panel,
.table-panel {
  padding: 22px;
}

.form-panel {
  position: relative;
  overflow: hidden;
}

.form-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--blue-700), var(--red));
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title span {
  color: var(--blue-950);
  font-size: 22px;
  font-weight: 950;
}

.section-title strong {
  padding: 6px 10px;
  color: var(--red-dark);
  border-radius: 999px;
  background: #fff0f1;
  font-size: 13px;
}

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

label {
  display: grid;
  gap: 8px;
  color: #344356;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c7d8e8;
  border-radius: 15px;
  background: #fafdff;
  color: var(--ink);
  outline: none;
  padding: 14px;
}

textarea {
  min-height: 168px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px rgba(27, 110, 172, 0.14);
}

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

.form-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.message {
  min-height: 24px;
  margin: 0;
  color: var(--red-dark);
  font-weight: 900;
}

.message.success {
  color: #087747;
}

.form-actions button,
.login-grid button,
.admin-actions button {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  font-weight: 950;
  box-shadow: 0 12px 22px rgba(229, 35, 45, 0.2);
}

.guide-panel {
  background: #fff;
}

.note {
  margin-top: 0;
  padding: 16px;
  border-left: 5px solid var(--red);
  border-radius: 14px;
  background: #fff7f7;
}

.note + .note {
  margin-top: 14px;
}

.note.plain {
  border-left-color: var(--blue-700);
  background: var(--blue-100);
}

.note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-panel {
  max-width: 820px;
  margin: 0 auto;
}

.login-grid {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.login-grid .message {
  grid-column: 1 / -1;
}

.demo-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

code {
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--blue-100);
  color: var(--blue-900);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #cfe0ee;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 55, 97, 0.1);
}

.dashboard-kicker {
  margin: 0 0 6px;
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 950;
}

.dashboard-head h2 {
  color: var(--blue-950);
  font-size: 32px;
  line-height: 1.15;
}

.last-updated {
  margin: 8px 0 0;
  color: #526477;
  font-size: 13px;
  font-weight: 850;
}

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

#currentAdmin {
  color: var(--muted);
  font-weight: 900;
}

.admin-actions .secondary {
  color: var(--blue-900);
  border: 1px solid #bed7ec;
  background: #eef7ff;
  box-shadow: none;
}

.admin-actions .ghost {
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
}

.detail-head h2 {
  color: var(--blue-950);
  font-size: 30px;
  line-height: 1.18;
}

.detail-head .ghost {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-900);
  background: #fff;
  font-weight: 950;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.detail-main,
.detail-side {
  padding: 20px;
}

.detail-section + .detail-section {
  margin-top: 20px;
}

.detail-section h3,
.detail-side h3 {
  margin: 0 0 12px;
  color: var(--blue-950);
  font-size: 18px;
}

#detailSuggestion {
  min-height: 150px;
  margin: 0;
  padding: 16px;
  border: 1px solid #d8e7f3;
  border-radius: 14px;
  background: #f8fbff;
  color: #273849;
  line-height: 1.75;
  font-weight: 750;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.detail-actions button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  font-weight: 950;
}

.detail-actions .secondary {
  color: var(--blue-900);
  border: 1px solid #bed7ec;
  background: #eef7ff;
}

.detail-side dl {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.detail-side dl div {
  padding: 12px;
  border: 1px solid #e0ebf4;
  border-radius: 13px;
  background: #f8fbff;
}

.detail-side dt,
.detail-side dd {
  margin: 0;
}

.detail-side dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-side dd {
  margin-top: 4px;
  color: #273849;
  font-weight: 950;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 12px 12px 12px 36px;
  border: 1px solid #e0ebf4;
  border-radius: 13px;
  background: #fafcff;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 16px;
  width: 10px;
  height: 10px;
  border: 2px solid #b8c9d9;
  border-radius: 50%;
  background: #fff;
}

.timeline li.done::before,
.timeline li.active::before {
  border-color: var(--blue-700);
  background: var(--blue-700);
}

.timeline li.active {
  border-color: #8fbfe5;
  background: #eef7ff;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline strong {
  color: var(--blue-950);
  font-size: 14px;
}

.timeline span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stats article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.stats article:hover,
.stats article:focus-visible,
.stats article.active {
  border-color: #7fb4df;
  box-shadow: 0 12px 28px rgba(20, 85, 142, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.stats article.active {
  background: linear-gradient(180deg, #ffffff, #eff8ff);
}

.stats span {
  color: var(--blue-800);
  font-size: 34px;
  font-weight: 950;
}

.stats p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.table-panel {
  overflow-x: auto;
}

.mobile-records {
  display: none;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #dfeaf4;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue-950);
  background: var(--blue-100);
  font-size: 14px;
}

td {
  color: #303943;
  font-weight: 650;
}

.content-cell {
  max-width: 340px;
  line-height: 1.55;
}

.remark-cell {
  max-width: 210px;
  color: #526477;
  line-height: 1.55;
}

.status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}

.status.pending {
  color: #a75b00;
  background: #fff0cf;
}

.status.doing {
  color: #125ea8;
  background: #e6f2ff;
}

.status.done {
  color: #137447;
  background: #ddf6e8;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--blue-900);
  background: #eaf5ff;
  font-size: 13px;
  font-weight: 950;
}

.record-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.record-card + .record-card {
  margin-top: 12px;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.record-head strong {
  display: block;
  font-size: 17px;
}

.record-head span:not(.status) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.record-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.record-card dl div {
  padding: 10px;
  border-radius: 12px;
  background: #f5f9fd;
}

.record-card dt,
.record-card dd {
  margin: 0;
}

.record-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-card dd {
  margin-top: 3px;
  font-weight: 900;
}

.record-card p {
  margin: 0 0 12px;
  color: #344356;
  line-height: 1.55;
}

.card-remark {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e7f3;
  border-radius: 12px;
  background: #f7fbff;
}

.card-remark span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.card-remark strong {
  color: #273849;
  font-size: 13px;
  line-height: 1.5;
}

.empty {
  margin: 24px 0 4px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(229, 35, 45, 0.18), transparent 34%),
      linear-gradient(180deg, var(--blue-950) 0%, var(--blue-900) 300px, var(--bg) 300px);
  }

  .app-shell {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand img {
    width: 58px;
    height: 58px;
  }

  h1 {
    font-size: 24px;
    white-space: nowrap;
  }

  .eyebrow {
    font-size: 13px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    min-width: 0;
  }

  .layout.two-col,
  form,
  .login-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .guide-panel {
    display: none;
  }

  .form-panel,
  .login-panel,
  .table-panel {
    padding: 18px;
  }

  .view {
    margin-top: 14px;
  }

  .section-title {
    align-items: flex-start;
  }

  input,
  select,
  textarea {
    min-height: 54px;
    font-size: 16px;
  }

  textarea {
    min-height: 190px;
  }

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

  .form-actions button,
  .login-grid button {
    width: 100%;
  }

  .dashboard-head,
  .admin-actions,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .dashboard-head h2 {
    font-size: 24px;
    white-space: nowrap;
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-main,
  .detail-side {
    padding: 16px;
  }

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

  .stats article {
    padding: 14px;
  }

  .stats span {
    font-size: 28px;
  }

  .table-panel {
    padding: 14px;
    overflow: visible;
  }

  .table-panel table {
    display: none;
  }

  .mobile-records {
    display: block;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row-actions button {
    min-height: 40px;
  }
}
