:root {
  --bg: #f5efe3;
  --bg-accent: radial-gradient(circle at top left, rgba(40, 84, 94, 0.18), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(190, 113, 61, 0.18), transparent 24rem),
    linear-gradient(160deg, #f8f3ea 0%, #efe5d6 100%);
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffaf2;
  --line: rgba(61, 50, 37, 0.14);
  --text: #2e2a24;
  --muted: #766a5d;
  --brand: #234f58;
  --brand-2: #c26d3e;
  --success: #2f7a4b;
  --warn: #9d4f2f;
  --shadow: 0 24px 60px rgba(72, 59, 43, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-accent);
}

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

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  background: rgba(33, 50, 55, 0.86);
  color: #f7f0e6;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #d17f52, #f2c98b);
  color: #1d2830;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  color: rgba(247, 240, 230, 0.72);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item,
.ghost-btn,
.outline-btn,
.primary-btn,
.warn-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-item {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(241, 194, 130, 0.18);
  transform: translateX(2px);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-badge {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.main {
  padding: 28px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(35, 79, 88, 0.1);
  color: var(--brand);
  font-weight: 600;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(35, 79, 88, 0.1);
  color: var(--brand);
  border: 1px solid rgba(35, 79, 88, 0.14);
}

.alert.error {
  background: rgba(157, 79, 47, 0.11);
  color: var(--warn);
  border-color: rgba(157, 79, 47, 0.18);
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.login-layout,
.two-col,
.split,
.three-col {
  display: grid;
  gap: 20px;
}

.login-layout {
  grid-template-columns: 1.2fr 0.9fr;
  align-items: stretch;
}

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

.split {
  grid-template-columns: 1.2fr 0.9fr;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.admin-panel {
  margin-top: 20px;
}

.project-edit-panel {
  margin-bottom: 20px;
}

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

.project-edit-note {
  grid-column: 1 / -1;
}

.project-edit-submit {
  width: fit-content;
}

.hero-card,
.login-card,
.panel,
.detail-hero {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-card {
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(241, 197, 138, 0.32), transparent 16rem),
    linear-gradient(135deg, rgba(35, 79, 88, 0.96), rgba(29, 53, 59, 0.94));
  color: #f8efe3;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  opacity: 0.74;
}

.hero-card h2 {
  margin: 8px 0 14px;
  font-size: 38px;
  line-height: 1.08;
}

.hero-text {
  margin: 0;
  max-width: 48ch;
  line-height: 1.8;
  color: rgba(248, 239, 227, 0.82);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.metric {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.metric span {
  display: block;
  font-size: 32px;
  font-weight: 800;
}

.metric label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.76;
}

.login-card,
.panel,
.detail-hero {
  padding: 22px;
}

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

.panel-head h3,
.login-card h3 {
  margin: 0;
  font-size: 21px;
}

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

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form.compact {
  margin-bottom: 16px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(35, 79, 88, 0.46);
  box-shadow: 0 0 0 3px rgba(35, 79, 88, 0.1);
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), #2b6874);
  color: #fff;
}

.outline-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.warn-btn {
  background: rgba(157, 79, 47, 0.12);
  color: var(--warn);
}

.primary-btn:hover,
.outline-btn:hover,
.ghost-btn:hover,
.warn-btn:hover {
  transform: translateY(-1px);
}

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

.stat-card {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
}

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

.stat-card .value {
  margin-top: 8px;
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
}

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

.list.mini {
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
}

.list-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  gap: 10px;
}

.list-card.clickable {
  cursor: pointer;
}

.list-card.clickable:hover {
  border-color: rgba(35, 79, 88, 0.36);
  transform: translateY(-1px);
}

.list-card.unread {
  border-color: rgba(35, 79, 88, 0.22);
  background: rgba(35, 79, 88, 0.06);
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.card-title strong {
  font-size: 17px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(35, 79, 88, 0.1);
  color: var(--brand);
  font-size: 12px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.detail-hero {
  margin-bottom: 20px;
  background:
    radial-gradient(circle at top right, rgba(194, 109, 62, 0.18), transparent 16rem),
    linear-gradient(145deg, rgba(255, 250, 242, 0.98), rgba(244, 235, 220, 0.98));
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title h2 {
  margin: 0;
  font-size: 30px;
}

.detail-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid .meta-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.meta-item strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

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

.timeline-card {
  position: relative;
  padding: 16px 16px 16px 18px;
  border-left: 4px solid rgba(35, 79, 88, 0.18);
  background: rgba(255, 255, 255, 0.64);
  border-radius: 0 16px 16px 0;
  cursor: pointer;
}

.timeline-card.current {
  border-left-color: var(--brand);
  background: rgba(35, 79, 88, 0.08);
}

.timeline-card.done {
  border-left-color: var(--success);
}

.timeline-card.returned {
  border-left-color: var(--warn);
}

.timeline-card.selected {
  outline: 2px solid rgba(35, 79, 88, 0.22);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-row > * {
  flex: 1 1 180px;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--muted);
}

.filter-toggle input {
  width: auto;
  margin: 0;
}

.empty-state {
  padding: 36px;
  border-radius: 22px;
  border: 1px dashed rgba(35, 79, 88, 0.24);
  color: var(--muted);
  text-align: center;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.pager-summary {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .shell,
  .login-layout,
  .two-col,
  .split,
  .three-col,
  .stats,
  .detail-grid,
  .project-edit-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 14px;
  }

  .nav {
    flex-direction: row;
    overflow: auto;
  }

  .nav-item {
    white-space: nowrap;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }
}
