:root {
  --ink: #18352f;
  --muted: #687b76;
  --paper: #fbfaf5;
  --surface: #ffffff;
  --mint: #77d6b3;
  --mint-pale: #dff6ed;
  --mint-dark: #246d59;
  --coral: #ff806b;
  --coral-pale: #ffe4dc;
  --lemon: #f6db67;
  --line: #cbdcd5;
  --shadow: 0 18px 50px rgba(29, 83, 69, 0.12);
  --radius: 18px;
  --font: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.7px;
  text-decoration: none;
}

.brand > span:last-child > span {
  color: var(--coral);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  transform: rotate(-8deg);
}

.brand-mark span {
  position: absolute;
  width: 18px;
  height: 23px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}

.brand-mark span:first-child {
  left: 1px;
  background: var(--lemon);
}

.brand-mark span:last-child {
  right: 1px;
  background: var(--mint);
  transform: translateY(3px);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.2px;
}

.login-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 32px;
  overflow: hidden;
  place-items: center;
  background: var(--mint-pale);
}

.login-view::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 109, 89, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 109, 89, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.login-shape {
  position: absolute;
  border: 2px solid var(--ink);
}

.login-shape-one {
  top: -80px;
  right: -45px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--coral);
}

.login-shape-two {
  bottom: -70px;
  left: -40px;
  width: 210px;
  height: 170px;
  border-radius: 48% 52% 45% 55%;
  background: var(--lemon);
  transform: rotate(20deg);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  padding: 50px;
  border: 2px solid var(--ink);
  border-radius: 28px 8px 28px 8px;
  background: var(--surface);
  box-shadow: 12px 12px 0 var(--ink);
}

.login-card .eyebrow {
  margin-top: 58px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 58px);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1.08;
}

.login-note {
  max-width: 390px;
  margin: 22px 0 34px;
  color: var(--muted);
  line-height: 1.75;
}

.login-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 750;
}

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

.key-row input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  outline: 0;
  background: var(--paper);
}

.key-row input:focus {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 4px var(--mint-pale);
}

.square-button {
  display: grid;
  flex: 0 0 52px;
  height: 52px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--lemon);
  place-items: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.square-button:hover {
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.form-error {
  min-height: 22px;
  margin: 8px 0 0;
  color: #b13b2b;
  font-size: 13px;
}

.app-view {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  min-height: 88px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}

.sync-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.sync-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px var(--mint-pale);
}

.sync-status.is-error i {
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-pale);
}

.text-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--mint-dark);
}

.text-button svg {
  width: 17px;
  height: 17px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  padding: 85px 0 65px;
  align-items: end;
}

.hero .eyebrow {
  grid-column: 1 / -1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(45px, 6.2vw, 82px);
  font-weight: 820;
  letter-spacing: -4.5px;
  line-height: 1.02;
}

.hero h1 span {
  position: relative;
  z-index: 0;
}

.hero h1 span::after {
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: 4px;
  left: -6px;
  height: 18px;
  background: var(--lemon);
  content: "";
  transform: rotate(-1.5deg);
}

.hero > p:last-child {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.8;
}

.composer-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.composer-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(29, 83, 69, 0.06);
}

.panel-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: -0.7px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.step-number {
  display: grid;
  flex: 0 0 42px;
  height: 32px;
  border-radius: 50%;
  background: var(--mint-pale);
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 850;
  place-items: center;
  transform: rotate(-5deg);
}

.step-number.coral {
  background: var(--coral-pale);
  color: #a23d2e;
  transform: rotate(5deg);
}

.text-composer textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--paper);
  line-height: 1.7;
}

.text-composer textarea:focus {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 4px var(--mint-pale);
}

.panel-footer {
  display: flex;
  min-height: 58px;
  justify-content: space-between;
  align-items: end;
}

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

.primary-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 12px 17px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--mint);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.primary-button svg {
  width: 16px;
  height: 16px;
}

.drop-zone {
  display: flex;
  width: 100%;
  min-height: 226px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px dashed #98b8ad;
  border-radius: 14px;
  background: var(--paper);
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--mint-dark);
  background: var(--mint-pale);
  transform: translateY(-2px);
}

.upload-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 15px;
  border: 2px solid var(--ink);
  border-radius: 50% 45% 52% 44%;
  background: var(--coral);
  place-items: center;
  transform: rotate(5deg);
}

.drop-zone strong {
  margin-bottom: 6px;
  font-size: 15px;
}

.drop-zone small {
  color: var(--muted);
}

.upload-queue {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--mint-pale);
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 700;
}

.timeline-section {
  padding: 85px 0 45px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -1.4px;
}

.item-count {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  border-top: 2px solid var(--ink);
}

.timeline-item {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) auto;
  gap: 25px;
  padding: 23px 4px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.item-meta {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.type-label {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--mint-pale);
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 850;
}

.type-label.file {
  background: var(--coral-pale);
  color: #a23d2e;
}

.item-meta time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.text-content {
  max-height: 185px;
  margin: 0;
  overflow: auto;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.file-content {
  display: flex;
  gap: 13px;
  min-width: 0;
  align-items: center;
}

.file-icon {
  display: grid;
  flex: 0 0 42px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  place-items: center;
}

.file-details {
  min-width: 0;
}

.file-details strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.item-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  place-items: center;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--mint-dark);
  border-color: var(--mint-dark);
  background: var(--mint-pale);
}

.icon-button.danger:hover {
  color: #a23d2e;
  border-color: var(--coral);
  background: var(--coral-pale);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  padding: 65px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.empty-illustration {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border: 2px solid var(--ink);
  border-radius: 45% 55% 48% 52%;
  background: var(--lemon);
  place-items: center;
  transform: rotate(-7deg);
}

.empty-state h3 {
  margin: 0 0 7px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.load-more-button {
  display: flex;
  gap: 9px;
  margin: 28px auto 0;
  padding: 11px 17px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
}

.load-more-button:hover:not(:disabled) {
  color: var(--mint-dark);
  border-color: var(--mint-dark);
  background: var(--mint-pale);
}

.load-more-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.load-more-button svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}

footer {
  display: flex;
  padding: 24px 0 38px;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

footer span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 13px 17px;
  color: white;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.toast.is-error {
  background: #a23d2e;
}
