:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #151310;
  --muted: #706a60;
  --line: rgba(21, 19, 16, 0.13);
  --paper: rgba(255, 252, 245, 0.78);
  --paper-strong: #fffaf0;
  --accent: #8d5f35;
  --shadow: 0 28px 80px rgba(53, 43, 31, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(21, 19, 16, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 19, 16, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 16% 0%, rgba(141, 95, 53, 0.14), transparent 28rem),
    linear-gradient(135deg, #fbf7ee 0%, var(--bg) 55%, #e9dfd0 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #181614;
  cursor: pointer;
  padding: 0.75rem 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(53, 43, 31, 0.18);
}

textarea,
input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.92);
  outline: none;
}

textarea:focus,
input[type="date"]:focus {
  border-color: rgba(141, 95, 53, 0.45);
  box-shadow: 0 0 0 4px rgba(141, 95, 53, 0.12);
}

textarea {
  min-height: 5.6rem;
  resize: vertical;
  padding: 0.85rem;
  line-height: 1.6;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
}

.hero {
  min-height: 24rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(120deg, rgba(255, 252, 245, 0.96), rgba(255, 252, 245, 0.62)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=85")
      right center/cover;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 21rem;
  max-width: 48rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 48rem;
  margin-bottom: 0.9rem;
  font-size: 5.4rem;
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.hero__copy {
  max-width: 35rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.72;
}

.hub-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 52px rgba(53, 43, 31, 0.12);
  backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.icon-link {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.25rem;
  min-height: 13rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 250, 240, 0.16)),
    var(--paper-strong);
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.icon-link:hover {
  border-color: rgba(141, 95, 53, 0.42);
  box-shadow: 0 18px 44px rgba(53, 43, 31, 0.14);
  transform: translateY(-2px);
}

.icon-link--ball {
  background:
    linear-gradient(135deg, rgba(141, 95, 53, 0.16), rgba(255, 250, 240, 0.58)),
    var(--paper-strong);
}

.icon-link--journal {
  background:
    linear-gradient(135deg, rgba(141, 95, 53, 0.16), rgba(255, 250, 240, 0.58)),
    var(--paper-strong);
}

.icon-link--ballad {
  background:
    linear-gradient(135deg, rgba(63, 113, 88, 0.15), rgba(255, 250, 240, 0.58)),
    var(--paper-strong);
}

.icon-link--ghost {
  border-style: dashed;
  opacity: 0.72;
  pointer-events: none;
}

.icon-mark {
  display: inline-grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border: 1px solid rgba(21, 19, 16, 0.16);
  border-radius: 50%;
  color: #fffaf0;
  background: #171410;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.icon-link--ballad .icon-mark {
  background: #314837;
}

.icon-link--journal .icon-mark {
  background: #5d422b;
}

.icon-link--ghost .icon-mark {
  color: var(--muted);
  background: transparent;
}

.icon-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
}

.icon-meta strong {
  font-size: 1.28rem;
}

.icon-meta em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

.dashboard {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.sidebar,
.workspace {
  min-width: 0;
}

.date-panel,
.history-panel,
.workspace {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 52px rgba(53, 43, 31, 0.12);
  backdrop-filter: blur(18px);
}

.date-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.date-panel label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.date-panel input {
  padding: 0.75rem;
}

.date-panel__meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.history-panel {
  padding: 1rem;
}

.history-list {
  display: grid;
  gap: 0.55rem;
  max-height: 34rem;
  margin-top: 0.9rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.history-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.7);
  text-align: left;
}

.history-item strong {
  font-size: 0.92rem;
}

.history-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.workspace {
  padding: 1.25rem;
}

.ghost-button {
  color: var(--ink);
  background: rgba(22, 22, 22, 0.07);
}

.timeline {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.time-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: stretch;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.72);
}

.time-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(141, 95, 53, 0.1);
  font-weight: 800;
}

.time-row label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.time-row textarea {
  min-height: 4.4rem;
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border-radius: 8px;
  color: #fff;
  background: rgba(24, 22, 20, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.6rem);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 840px) {
  .app-shell {
    padding: 1rem;
  }

  .hero {
    min-height: 20rem;
  }

  .hero__content {
    min-height: 17rem;
  }

  h1 {
    font-size: 3.6rem;
  }

  .icon-grid,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .icon-link {
    min-height: 9rem;
  }

  .time-row {
    grid-template-columns: 1fr;
  }

  .time-chip {
    min-height: 2.5rem;
    justify-content: flex-start;
    padding-left: 0.8rem;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.75rem;
  }

  .section-heading {
    flex-direction: column;
  }
}
