:root {
  --bg: #f4ecdf;
  --panel: rgba(255, 249, 241, 0.88);
  --line: rgba(61, 45, 33, 0.12);
  --text: #26180f;
  --muted: #7b6758;
  --accent: #d65a31;
  --sea: #1e6f6a;
  --danger: #b7463c;
  --success: #2d7d58;
  --shadow: 0 24px 60px rgba(92, 63, 40, 0.14);
  --radius-lg: 30px;
  --radius-md: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(214, 90, 49, 0.18), transparent 18%),
    radial-gradient(circle at 12% 18%, rgba(30, 111, 106, 0.14), transparent 22%),
    linear-gradient(180deg, #fcf7f0 0%, #f0e6d7 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  padding: 24px;
}

.app-shell {
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.app-shell.ready {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.launch-screen {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.launch-card {
  width: min(560px, 100%);
  padding: 40px 34px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(214, 90, 49, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.94), rgba(255, 245, 236, 0.9));
}

.launch-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(30, 111, 106, 0.1);
  color: var(--sea);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.launch-card h1 {
  margin: 18px 0 12px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

.launch-card p {
  margin: 0 auto;
  max-width: 28em;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.launch-card .btn {
  margin-top: 24px;
}

.launch-orbit {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid rgba(30, 111, 106, 0.14);
  background: rgba(255, 255, 255, 0.52);
  animation: launchSpin 10s linear infinite;
}

.launch-orbit span {
  position: absolute;
  border-radius: 50%;
  animation: launchPulse 1.8s ease-in-out infinite;
}

.launch-orbit span:nth-child(1) {
  top: 10px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: var(--accent);
}

.launch-orbit span:nth-child(2) {
  right: 14px;
  bottom: 18px;
  width: 14px;
  height: 14px;
  background: var(--sea);
  animation-delay: 0.25s;
}

.launch-orbit span:nth-child(3) {
  left: 16px;
  bottom: 20px;
  width: 12px;
  height: 12px;
  background: rgba(214, 90, 49, 0.7);
  animation-delay: 0.5s;
}

.launch-screen[data-tone="success"] .launch-orbit {
  border-color: rgba(45, 125, 88, 0.2);
}

.launch-screen[data-tone="error"] .launch-card {
  background:
    radial-gradient(circle at top, rgba(183, 70, 60, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(255, 251, 246, 0.94), rgba(255, 243, 240, 0.9));
}

.launch-screen[data-tone="error"] .launch-kicker {
  background: rgba(183, 70, 60, 0.1);
  color: var(--danger);
}

.launch-screen[data-tone="error"] .launch-orbit {
  animation-duration: 14s;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-shell {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d93025;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav a.active,
.nav a:hover {
  background: rgba(38, 24, 15, 0.08);
  color: var(--text);
}

.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 26px;
  padding: 36px;
  background: linear-gradient(145deg, rgba(255, 247, 238, 0.96), rgba(255, 233, 212, 0.92));
}

.eyebrow,
.mini-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(30, 111, 106, 0.1);
  color: var(--sea);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.page-header h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
}

.hero p,
.page-header p,
.section-heading p,
.feature-card p,
.empty-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions,
.action-row,
.success-actions,
.header-tools,
.form-footer,
.inline-tools,
.admin-toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions {
  margin-top: 26px;
}

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

.stat-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.72);
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  font-size: 28px;
}

.stat-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

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

.feature-card {
  padding: 24px;
}

.feature-card span {
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}

.feature-card h2,
.section-heading h2,
.empty-card h2,
.success-card h3,
.record-card h2 {
  margin: 14px 0 10px;
  font-size: 28px;
}

.form-panel,
.page-header,
.empty-card,
.record-card {
  padding: 30px;
}

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

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

.choice-field {
  margin: 0;
  padding: 0;
  border: 0;
}

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

.field span {
  font-size: 15px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

.upload-field small {
  color: var(--muted);
}

.choice-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  font-weight: 700;
}

.choice-pill input {
  width: auto;
  margin: 0;
}

.type-toggle {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.type-pill,
.filter-pill,
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.type-pill,
.filter-pill {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  border: 1px solid var(--line);
}

.type-pill.active,
.filter-pill.active {
  background: linear-gradient(135deg, var(--accent), #ec8b4b);
  color: #fff8f1;
  border-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ef8d4b);
  color: #fff7ee;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--sea), #4f8e89);
  color: #f4fbfa;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #d1675e);
  color: #fff8f6;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.preview-grid,
.records-list {
  display: grid;
  gap: 18px;
}

.preview-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.preview-card,
.image-card {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.preview-card img,
.image-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.preview-card span,
.image-card span {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.identity-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(30, 111, 106, 0.08);
}

.identity-box span,
.meta-line,
.record-description,
.info-grid span {
  color: var(--muted);
}

.identity-box strong,
.info-grid strong {
  word-break: break-all;
}

.info-grid a {
  color: var(--sea);
  text-decoration: underline;
}

.success-card {
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(30, 111, 106, 0.08);
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.record-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.summary-main {
  flex: 1;
  min-width: 0;
}

.summary-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.summary-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.record-title {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  word-break: break-word;
}

.summary-state {
  color: var(--sea);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.summary-toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.soft-delete-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(183, 70, 60, 0.12);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.summary-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(30, 111, 106, 0.08);
  color: var(--sea);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.record-content {
  margin-top: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-pending {
  background: rgba(241, 176, 88, 0.18);
  color: #9b6129;
}

.status-accepted {
  background: rgba(45, 125, 88, 0.14);
  color: var(--success);
}

.status-rejected {
  background: rgba(183, 70, 60, 0.14);
  color: var(--danger);
}

.status-countered {
  background: rgba(30, 111, 106, 0.14);
  color: var(--sea);
}

.record-description {
  margin: 18px 0;
  line-height: 1.8;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-grid div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.info-grid-wide .image-gallery {
  margin-top: 8px;
}

.proof-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.proof-link-item {
  display: inline-flex;
  align-items: center;
}

.proof-link-anchor {
  color: var(--sea);
  font-weight: 700;
  text-decoration: underline;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-controls {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

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

.conversation-card,
.delivery-box,
.delivery-summary,
.reply-box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.conversation-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--sea);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conversation-card p,
.delivery-summary p,
.delivery-tip,
.delivery-meta,
.payment-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reply-box,
.delivery-box,
.delivery-summary {
  margin-top: 18px;
}

.delivery-tip,
.delivery-meta {
  margin-top: 10px;
}

.payment-box,
.payment-spotlight,
.timeline-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
}

.payment-box {
  background: linear-gradient(135deg, rgba(30, 111, 106, 0.08), rgba(255, 255, 255, 0.72));
}

.payment-spotlight {
  background: linear-gradient(135deg, rgba(214, 90, 49, 0.12), rgba(255, 247, 238, 0.88));
  border-color: rgba(214, 90, 49, 0.18);
}

.timeline-box {
  background: rgba(255, 255, 255, 0.58);
}

.payment-box-head,
.timeline-meta,
.payment-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.payment-time,
.timeline-meta span {
  color: var(--muted);
  font-size: 13px;
}

.payment-input-row input {
  flex: 1;
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.payment-code {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  word-break: break-word;
}

.timeline-title {
  font-size: 18px;
  font-weight: 800;
}

.timeline-empty {
  margin-top: 14px;
  color: var(--muted);
}

.timeline-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.timeline-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.timeline-item p {
  margin: 8px 0 0;
  line-height: 1.7;
  color: var(--text);
}

.delivery-summary a {
  color: var(--sea);
  text-decoration: underline;
  word-break: break-all;
}

.compact {
  min-width: 220px;
}

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

.launch-screen.hidden {
  display: none;
}

.hidden {
  display: none;
}

@keyframes launchSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes launchPulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .page {
    gap: 18px;
  }

  .hero,
  .feature-grid,
  .form-grid,
  .info-grid,
  .conversation-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    border-radius: 28px;
  }

  .nav {
    width: 100%;
    gap: 8px;
  }

  .nav a {
    padding: 8px 12px;
    font-size: 14px;
  }

  .form-panel,
  .page-header,
  .empty-card,
  .record-card {
    padding: 22px;
  }

  .brand {
    font-size: 20px;
  }

  .feature-card h2,
  .section-heading h2,
  .empty-card h2,
  .success-card h3,
  .record-card h2,
  .record-title,
  .summary-state {
    font-size: 24px;
  }

  .summary-actions {
    align-self: flex-start;
  }

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

  .status-pill {
    min-width: 0;
    height: 38px;
    padding: 0 14px;
  }

  .payment-code {
    font-size: 20px;
    padding: 16px;
  }

  .header-tools,
  .admin-toolbar,
  .form-footer,
  .inline-tools {
    align-items: stretch;
  }

  .identity-box {
    width: 100%;
  }

  .payment-input-row input,
  .compact {
    min-width: 0;
  }

  .launch-screen {
    min-height: calc(100vh - 32px);
  }

  .launch-card {
    padding: 32px 24px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .topbar {
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
  }

  .brand {
    font-size: 18px;
    letter-spacing: 0.04em;
  }

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

  .nav a {
    justify-content: center;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }

  .page {
    gap: 14px;
  }

  .form-panel,
  .page-header,
  .empty-card,
  .record-card {
    padding: 16px;
    border-radius: 20px;
  }

  .section-heading p,
  .empty-card p,
  .payment-tip,
  .delivery-tip,
  .delivery-meta,
  .timeline-item p,
  .meta-line {
    font-size: 13px;
    line-height: 1.6;
  }

  .field {
    gap: 8px;
  }

  .field span {
    font-size: 14px;
  }

  .field input,
  .field textarea,
  .payment-input-row input {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
  }

  .choice-pill,
  .type-pill,
  .filter-pill,
  .btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .btn-small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .record-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .summary-main {
    width: 100%;
  }

  .summary-heading,
  .summary-meta {
    gap: 8px;
  }

  .summary-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .record-title,
  .summary-state {
    width: 100%;
    font-size: 20px;
    line-height: 1.2;
    word-break: break-word;
  }

  .summary-state {
    white-space: normal;
  }

  .summary-actions {
    width: 100%;
    justify-content: space-between;
    align-self: stretch;
  }

  .summary-toggle-indicator {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .summary-chip,
  .soft-delete-badge,
  .mini-kicker,
  .eyebrow {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .status-pill {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .info-grid {
    gap: 12px;
    padding: 14px 0;
  }

  .conversation-card,
  .delivery-box,
  .delivery-summary,
  .reply-box,
  .payment-box,
  .payment-spotlight,
  .timeline-box,
  .timeline-item {
    padding: 14px;
    border-radius: 16px;
  }

  .payment-code {
    margin-top: 12px;
    padding: 14px;
    font-size: 18px;
    line-height: 1.4;
  }

  .timeline-title {
    font-size: 16px;
  }

  .timeline-meta {
    align-items: flex-start;
  }

  .timeline-meta strong,
  .timeline-meta span,
  .payment-time {
    font-size: 12px;
  }

  .proof-link-list {
    gap: 6px 10px;
  }

  .launch-screen {
    min-height: calc(100vh - 20px);
  }

  .launch-card {
    padding: 26px 18px;
    border-radius: 22px;
  }

  .launch-kicker {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .launch-card h1 {
    font-size: 24px;
  }

  .launch-card p {
    font-size: 14px;
    line-height: 1.7;
  }

  .launch-orbit {
    width: 84px;
    height: 84px;
    margin-bottom: 18px;
  }
}
