:root {
  --bg: #f4efe6;
  --bg-accent: #e6f4ee;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffdfa;
  --surface-hero: rgba(255, 255, 255, 0.14);
  --ink: #1f2a25;
  --muted: #61706a;
  --line: rgba(52, 87, 72, 0.14);
  --line-strong: rgba(52, 87, 72, 0.26);
  --accent: #06c755;
  --accent-strong: #069647;
  --accent-soft: #daf7e6;
  --forest: #10392d;
  --forest-soft: #1a5a46;
  --warning: #b45309;
  --warning-soft: #fff1db;
  --success: #047857;
  --success-soft: #d9f7ec;
  --error: #b91c1c;
  --error-soft: #fde2e2;
  --shadow: 0 18px 40px rgba(22, 48, 38, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92) 0, transparent 42%),
    linear-gradient(180deg, #eef8f2 0%, #f6f1e9 48%, #efe7db 100%);
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: transparent;
}

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

.shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  gap: 18px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(142, 255, 191, 0.3) 0, transparent 28%),
    linear-gradient(135deg, #0d2e24 0%, #134637 48%, #1b6e51 100%);
  color: #f5fff9;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(8px);
}

.hero-full {
  display: grid;
  gap: 18px;
}

.hero-copy,
.hero-summary {
  position: relative;
  z-index: 1;
}

.hero-summary {
  display: grid;
  gap: 14px;
}

.eyebrow,
.section-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  opacity: 0.84;
}

.hero h1,
.workspace h2,
.workspace h3,
.workspace h4 {
  margin: 0;
}

.hero h1 {
  margin-top: 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}

.intro {
  margin: 14px 0 0;
  max-width: 780px;
  line-height: 1.75;
  color: rgba(244, 255, 249, 0.86);
}

.hero-card {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-hero);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.hero-card-list {
  background: rgba(255, 255, 255, 0.1);
}

.hero-label,
.hero-value,
.hero-note {
  margin: 0;
}

.hero-value {
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
}

.hero-note {
  margin-top: 10px;
  line-height: 1.7;
  color: rgba(227, 251, 239, 0.9);
}

.hero-list {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.85;
  color: rgba(227, 251, 239, 0.9);
}

.workspace {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-top,
.panel-head,
.identity-form,
.split,
.history-columns,
.manager-filter-form,
.tab-bar {
  display: flex;
  gap: 12px;
}

.panel-top,
.panel-head {
  justify-content: space-between;
  align-items: center;
}

.panel-top {
  position: sticky;
  top: 12px;
  z-index: 5;
  background: rgba(255, 253, 249, 0.92);
  border-color: var(--line-strong);
}

.identity-form,
.manager-filter-form {
  flex-wrap: wrap;
}

.identity-form input,
.manager-filter-form input,
.manager-filter-form select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: var(--surface-strong);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(6, 199, 85, 0.18);
  border-color: rgba(6, 199, 85, 0.38);
}

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

button {
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(6, 150, 71, 0.18);
}

.ghost-button {
  background: transparent;
  color: var(--forest-soft);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: var(--accent-soft);
}

.tab-bar {
  flex-wrap: wrap;
}

.tab-button {
  min-width: 132px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border: 1px solid var(--line);
}

.tab-button.active {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.history-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.stat {
  min-height: 156px;
}

.action-panel {
  min-height: 340px;
}

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

.chip {
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.ready {
  background: var(--success-soft);
  color: var(--success);
}

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

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

.record-list li {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--surface-strong);
}

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

.record-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.record-actions button[data-tone="approve"] {
  background: var(--success);
}

.record-actions button[data-tone="reject"] {
  background: var(--error);
}

.feedback {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed var(--line-strong);
  box-shadow: 0 10px 24px rgba(27, 63, 49, 0.08);
}

.feedback.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: #a7e7d6;
}

.feedback.error {
  background: var(--error-soft);
  color: var(--error);
  border-color: #f6b8b8;
}

.tab-panel {
  display: none;
  gap: 18px;
}

.tab-panel.active {
  display: grid;
}

@media (min-width: 900px) {
  .hero-full {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    align-items: end;
  }

  .identity-form input {
    flex: 1 1 320px;
  }

  .identity-form button {
    width: auto;
  }
}

@media (max-width: 1100px) {
  .stats-grid,
  .action-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 10px;
    gap: 12px;
  }

  .hero,
  .panel {
    border-radius: 24px;
    padding: 18px;
  }

  .panel-top,
  .panel-head,
  .identity-form,
  .split,
  .history-columns,
  .manager-filter-form,
  .tab-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tab-button,
  .identity-form button,
  .ghost-button,
  .record-actions button {
    width: 100%;
  }

  .panel-top {
    top: 8px;
  }

  .feedback {
    bottom: 8px;
  }
}
