/**
 * [INPUT]: 依赖 site-02a-diary 的 HTML 结构命名与第二章A视觉规范
 * [OUTPUT]: 对外提供日记首页、正文页与解密界面的完整样式
 * [POS]: site-02a-diary 的共享样式层，统一私人笔记站的温暖但不安的气质
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */

:root {
  --notes-bg: #f8f4ee;
  --notes-surface: rgba(255, 251, 246, 0.92);
  --notes-panel: #fffdf9;
  --notes-line: #dfd3c4;
  --notes-text: #2f2925;
  --notes-muted: #7a6f67;
  --notes-accent: #8c5434;
  --notes-shadow: 0 20px 40px rgba(70, 49, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  color: var(--notes-text);
  background:
    radial-gradient(circle at top, rgba(140, 84, 52, 0.08), transparent 28%),
    linear-gradient(180deg, #f4efe7, var(--notes-bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.2), transparent),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 35px,
      rgba(140, 84, 52, 0.025) 36px
    );
  opacity: 0.6;
}

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

p,
h1,
h2,
h3,
ul {
  margin: 0;
}

.notes-shell,
.entry-shell {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.notes-header,
.notes-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.75fr);
  gap: 22px;
}

.notes-header {
  align-items: end;
}

.notes-eyebrow,
.entry-date {
  color: var(--notes-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notes-header h1 {
  margin-top: 10px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
}

.notes-lead {
  max-width: 60ch;
  margin-top: 14px;
  color: var(--notes-muted);
  line-height: 1.85;
}

.notes-aside,
.notes-panel,
.notes-side-panel,
.entry-card {
  border: 1px solid var(--notes-line);
  background: var(--notes-surface);
  box-shadow: var(--notes-shadow);
}

.notes-aside {
  padding: 20px;
  color: var(--notes-muted);
  line-height: 1.8;
}

.notes-main {
  margin-top: 24px;
  align-items: start;
}

.notes-panel,
.notes-side-panel,
.entry-card {
  padding: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2,
.notes-side-panel h2,
.entry-card h1,
.cipher-result h2 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.2;
}

.notes-muted,
.notes-side-panel p,
.post-card small,
.cipher-hint {
  color: var(--notes-muted);
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #e5dbcf;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 244, 237, 0.92));
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-1px);
  border-color: #d5b79f;
  background: #fffdfa;
}

.post-card span {
  color: var(--notes-accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-card strong {
  font-size: 22px;
  line-height: 1.25;
}

.post-card--cipher {
  border-style: dashed;
}

.notes-side-panel {
  display: grid;
  gap: 12px;
  line-height: 1.85;
}

.entry-shell {
  max-width: 840px;
}

.entry-back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--notes-accent);
}

.entry-card {
  display: grid;
  gap: 16px;
  line-height: 1.9;
}

.cipher-copy {
  padding: 18px;
  border: 1px dashed #d9c7b5;
  background: rgba(247, 241, 232, 0.88);
  font-size: 17px;
}

.cipher-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e7d9cb;
  background: rgba(255, 253, 250, 0.95);
}

.cipher-form label {
  display: grid;
  gap: 8px;
}

.cipher-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfbcaa;
  background: #fffdfa;
  font: inherit;
}

.cipher-form button {
  width: fit-content;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  background: var(--notes-accent);
  color: #fffaf7;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cipher-result {
  padding: 18px;
  border-left: 4px solid var(--notes-accent);
  background: rgba(252, 248, 242, 0.96);
}

.cipher-result strong {
  color: var(--notes-accent);
}

.cipher-next {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #d9c7b5;
}

.cipher-next__label {
  color: var(--notes-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cipher-next__link {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid transparent;
  background: var(--notes-accent);
  color: #fffaf7;
  font-weight: 700;
}

@media (max-width: 860px) {
  .notes-header,
  .notes-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .notes-shell,
  .entry-shell {
    width: min(100% - 20px, 1100px);
  }

  .notes-panel,
  .notes-side-panel,
  .notes-aside,
  .entry-card {
    padding: 20px;
  }

  .section-head {
    display: grid;
  }
}
