:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef3ed;
  --text: #17211b;
  --muted: #667267;
  --line: #dce3dc;
  --accent: #0f7b5f;
  --accent-strong: #07523f;
  --accent-soft: #dff0e9;
  --warning: #a55f11;
  --danger: #b42318;
  --blue: #2459a7;
  --shadow: 0 20px 50px rgba(23, 33, 27, 0.09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 123, 95, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(36, 89, 167, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 48px;
  min-height: 100vh;
  padding: 48px;
  align-items: center;
}

.brand-panel {
  max-width: 680px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 28px;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  margin: 24px 0 0;
}

.role-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.role-strip span,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.login-card,
.panel,
.modal-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 227, 220, 0.95);
  box-shadow: var(--shadow);
}

.login-card {
  border-radius: 8px;
  padding: 30px;
}

.login-card h2,
.panel h2,
.modal-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.hint {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: #3c483f;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 123, 95, 0.14);
}

.primary,
.secondary,
.ghost,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 750;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary {
  width: 100%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 26px rgba(15, 123, 95, 0.22);
}

.secondary {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.ghost {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.danger:hover {
  transform: translateY(-1px);
}

.demo-logins {
  margin-top: 20px;
  display: grid;
  gap: 8px;
}

.demo-logins button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #10251d;
  color: #eaf4ee;
}

.sidebar .brand-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  background: #e7f6ef;
  color: #10251d;
}

.sidebar h1 {
  margin: 0;
  font-size: 21px;
}

.sidebar p {
  color: rgba(234, 244, 238, 0.68);
  line-height: 1.6;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav button {
  text-align: left;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(234, 244, 238, 0.76);
  background: transparent;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

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

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
}

.profile strong,
.profile span {
  display: block;
  white-space: nowrap;
}

.profile span {
  color: var(--muted);
  font-size: 12px;
}

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

.stat {
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

.panel {
  border-radius: 8px;
  padding: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar input,
.toolbar select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.table-list {
  display: grid;
  gap: 10px;
}

.demand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.demand-row h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.submitted { background: #eef2ff; color: #363f8f; }
.status.accepted { background: #eaf4ff; color: #2459a7; }
.status.processing { background: #fff5dc; color: var(--warning); }
.status.replied { background: var(--accent-soft); color: var(--accent-strong); }
.status.closed { background: #eef0ee; color: #556057; }
.priority.urgent,
.priority.high { background: #fee4e2; color: var(--danger); }
.priority.normal { background: #eaf4ff; color: var(--blue); }
.priority.low { background: #eef0ee; color: #556057; }

.detail {
  display: grid;
  gap: 14px;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}

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

.admin-table {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 37, 29, 0.48);
}

.modal-card {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  padding: 22px;
}

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

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

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 16px;
  border-radius: 8px;
  background: #10251d;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell,
  .grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    padding: 28px;
    align-items: start;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    margin-top: 18px;
    padding-bottom: 4px;
  }

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

@media (max-width: 640px) {
  .login-shell {
    padding: 18px;
    gap: 24px;
  }

  .brand-panel h1 {
    font-size: 38px;
  }

  .brand-panel p {
    font-size: 15px;
  }

  .login-card,
  .panel,
  .modal-card {
    padding: 16px;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .demand-row,
  .user-row {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .actions button {
    width: 100%;
  }
}
