:root {
  color-scheme: light;
  --paper: #fff7fb;
  --surface: #fffdfb;
  --surface-strong: #fff5f8;
  --ink: #3b1725;
  --muted: #8b5b6d;
  --line: #f3bfd3;
  --teal: #d9467f;
  --teal-dark: #b83268;
  --coral: #e8799b;
  --sage: #d98aa7;
  --sky: #f6b6cf;
  --shadow: 0 18px 46px rgba(180, 55, 105, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fffefa;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.auth-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #edf3ef;
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.icon-button,
.ghost-button,
.primary-button,
.segment,
.filter-pill,
.entry-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 40px;
  color: var(--ink);
  background: transparent;
}

.icon-button {
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.icon-button:hover,
.ghost-button:hover,
.filter-pill:hover,
.entry-action:hover {
  border-color: var(--teal);
}

.icon-button svg,
.ghost-button svg,
.primary-button svg,
.segment svg,
.search-box svg,
.entry-action svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  gap: 24px;
  align-items: end;
  width: min(1180px, calc(100% - 32px));
  min-height: 360px;
  margin: 0 auto;
  padding: 32px 0 36px;
  background-image: url("assets/cover.png");
  background-position: center;
  background-size: cover;
  isolation: isolate;
  position: relative;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 32px 0 36px;
  z-index: -1;
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.58);
  box-shadow: var(--shadow);
}

.cover-copy {
  max-width: 690px;
  padding: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cover h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.3rem);
  line-height: 1.05;
}

.cover-copy p:last-child {
  max-width: 520px;
  margin: 18px 0 0;
  color: #405055;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-self: end;
  padding: 0 22px 26px 0;
}

.stats-grid article {
  min-width: 0;
  border: 1px solid rgba(36, 49, 54, 0.12);
  border-radius: var(--radius);
  padding: 14px 12px;
  background: rgba(255, 254, 250, 0.88);
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  font-size: 1.8rem;
  line-height: 1.1;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
  align-items: start;
}

.login-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 0;
}

.login-card {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(220px, 1fr);
  gap: 24px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 28px rgba(35, 49, 54, 0.06);
  padding: 22px;
}

.login-card > div {
  grid-column: 2;
}

.login-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.login-form {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  gap: 14px;
}

.login-message {
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-message.is-error {
  color: #9c362c;
}

.composer-panel,
.timeline-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 28px rgba(35, 49, 54, 0.06);
}

.composer-panel {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.timeline-panel {
  min-width: 0;
  padding: 22px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.timeline-heading {
  align-items: center;
}

.entry-form {
  display: grid;
  gap: 15px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf3ef;
}

.segment {
  min-width: 0;
  padding: 8px 10px;
}

.segment.is-active {
  background: var(--surface-strong);
  color: var(--teal-dark);
  box-shadow: 0 6px 18px rgba(42, 111, 117, 0.12);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: #4b5a5e;
  font-size: 0.86rem;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 126px;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 111, 117, 0.14);
}

.photo-preview {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.photo-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e6eeea;
  object-fit: cover;
}

.photo-preview.is-empty img {
  display: none;
}

.photo-preview figcaption {
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-button {
  min-height: 46px;
  padding: 0 16px;
  background: var(--teal);
  color: #fffefa;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button {
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 300px);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.search-box input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-pill {
  min-height: 36px;
  padding: 0 13px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.filter-pill.is-active {
  border-color: var(--teal);
  background: #e3f0ec;
  color: var(--teal-dark);
  font-weight: 800;
}

.filters select {
  width: auto;
  min-width: 112px;
  height: 36px;
}

.entries {
  display: grid;
  gap: 14px;
}

.entry-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.entry-media {
  min-height: 156px;
  background: #e5eeea;
  position: relative;
}

.entry-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 156px;
  object-fit: cover;
}

.entry-media-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 156px;
  place-items: center;
  color: #fffefa;
  font-weight: 800;
}

.entry-card[data-type="text"] .entry-media-placeholder {
  background: var(--sage);
}

.entry-card[data-type="link"] .entry-media-placeholder {
  background: var(--sky);
}

.entry-card[data-type="photo"] .entry-media-placeholder {
  background: var(--coral);
}

.entry-body {
  min-width: 0;
  padding: 16px 16px 16px 0;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.type-badge {
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf3ef;
  color: var(--teal-dark);
  font-weight: 800;
}

.entry-body h3 {
  margin: 0 0 8px;
  font-size: 1.16rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.entry-body p {
  margin: 0;
  color: #435257;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.entry-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-top: 12px;
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.entry-link:hover {
  text-decoration: underline;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.entry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.entry-action {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface);
  font-size: 0.86rem;
}

.entry-action.danger:hover {
  border-color: var(--coral);
  color: #9c362c;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 1px dashed #b9c5c1;
  border-radius: var(--radius);
  padding: 44px 18px;
  color: var(--muted);
  background: #f8faf8;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.1rem;
}

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

@media (max-width: 920px) {
  .cover {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .cover-copy {
    padding: 30px 26px 0;
  }

  .stats-grid {
    padding: 0 26px 26px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-card > div,
  .login-form {
    grid-column: auto;
    grid-row: auto;
  }

  .composer-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .icon-button {
    flex: 1 1 0;
  }

  .cover::before {
    inset: 16px 0 24px;
  }

  .cover {
    width: min(100% - 20px, 1180px);
    padding: 16px 0 24px;
  }

  .cover-copy {
    padding: 28px 18px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .workspace {
    width: min(100% - 20px, 1180px);
    margin-top: 20px;
  }

  .login-panel {
    width: min(100% - 20px, 1180px);
    margin-top: 20px;
  }

  .composer-panel,
  .timeline-panel {
    padding: 16px;
  }

  .section-heading,
  .timeline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .field-row,
  .entry-card {
    grid-template-columns: 1fr;
  }

  .entry-body {
    padding: 0 14px 14px;
  }

  .entry-media,
  .entry-media img,
  .entry-media-placeholder {
    min-height: 210px;
  }
}
