:root {
  --paper: #f4f0e7;
  --paper-deep: #e9e3d6;
  --ink: #253128;
  --muted: #74786f;
  --green: #3f6852;
  --green-soft: #dce7dd;
  --coral: #e5785c;
  --white: #fffdf8;
  --line: rgba(37, 49, 40, 0.14);
  --shadow: 0 24px 70px rgba(57, 56, 43, 0.1);
  --radius-lg: 30px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(24px, 5vw, 72px);
  background: rgba(244, 240, 231, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { font-family: Georgia, serif; font-size: 1.45rem; font-weight: 700; text-decoration: none; }
.brand-dot { color: var(--coral); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--muted); font-size: 0.88rem; text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

.home-view {
  min-height: calc(100vh - 73px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
  padding: 72px clamp(24px, 8vw, 128px);
  overflow: hidden;
}
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 28px; font-family: Georgia, "Songti SC", serif; font-size: clamp(3.5rem, 7vw, 7.8rem); font-weight: 400; line-height: 0.94; letter-spacing: -0.055em; }
h1 em { color: var(--green); font-weight: 400; }
.hero-intro { max-width: 480px; color: var(--muted); font-size: 1.05rem; }
.primary-link { display: inline-flex; gap: 20px; align-items: center; margin-top: 16px; padding-bottom: 7px; border-bottom: 1px solid var(--ink); text-decoration: none; }

.profile-card { position: relative; padding: clamp(28px, 4vw, 52px); background: var(--white); border: 1px solid rgba(255,255,255,.7); border-radius: 42% 42% 32px 32px; box-shadow: var(--shadow); }
.profile-mark { display: grid; place-items: center; width: 120px; height: 120px; margin: -90px auto 24px; color: var(--white); background: var(--green); border: 8px solid var(--paper); border-radius: 50%; font: italic 3rem Georgia, serif; }
.profile-note { margin-bottom: 24px; text-align: center; font-family: Georgia, "Songti SC", serif; font-size: 1.3rem; }
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.profile-link { display: flex; gap: 12px; align-items: center; min-height: 76px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; transition: transform .2s, background .2s; }
.profile-link:hover { background: var(--green-soft); transform: translateY(-2px); }
.profile-link.is-disabled { cursor: default; opacity: .58; }
.profile-link-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; background: var(--paper); border-radius: 50%; }
.profile-link strong, .profile-link small { display: block; }
.profile-link small { color: var(--muted); font-size: .72rem; }

.life-view { min-height: 100vh; padding: 80px clamp(18px, 5vw, 72px); background: #e9eee7; }
.section-heading { display: flex; justify-content: space-between; align-items: end; max-width: 1380px; margin: 0 auto 30px; }
.section-heading h2 { margin-bottom: 0; font: 400 clamp(2.5rem, 5vw, 4.8rem)/1 Georgia, "Songti SC", serif; }
.section-heading > p { max-width: 390px; margin-bottom: 5px; color: var(--muted); }
.daylog-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 22px; max-width: 1380px; margin: auto; }
.journal-panel, .assistant-panel { background: var(--white); border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.journal-panel { padding: clamp(20px, 3vw, 40px); }
.calendar-toolbar, .records-heading, .assistant-heading, .assistant-form-footer, .dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: center; }
.calendar-year { margin-bottom: 0; color: var(--muted); font-size: .76rem; letter-spacing: .16em; }
.calendar-toolbar h3 { margin: 0; font: 400 2.2rem Georgia, serif; }
.calendar-actions { display: flex; gap: 8px; }
.icon-button, .text-button, .primary-button, .send-button, .prompt-chips button { border: 0; cursor: pointer; }
.icon-button { width: 40px; height: 40px; background: var(--paper); border-radius: 50%; }
.text-button { padding: 9px 14px; background: transparent; }
.primary-button { padding: 11px 18px; color: white; background: var(--green); border-radius: 999px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-weekdays { margin: 28px 0 8px; color: var(--muted); font-size: .72rem; text-align: center; }
.calendar-day { position: relative; min-height: 64px; padding: 8px; background: transparent; border: 1px solid transparent; border-radius: 16px; cursor: pointer; text-align: left; }
.calendar-day:hover { background: var(--paper); }
.calendar-day.is-outside { color: #aaa99f; }
.calendar-day.is-today { border-color: var(--coral); }
.calendar-day.is-selected { color: white; background: var(--green); }
.record-dots { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 3px; }
.record-dots i { width: 5px; height: 5px; background: var(--coral); border-radius: 50%; }
.is-selected .record-dots i { background: #f7c4b5; }
.records-heading { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.records-heading h3 { margin: 0; font: 400 1.7rem Georgia, "Songti SC", serif; }
.record-list { display: grid; gap: 12px; margin-top: 20px; }
.record-card { padding: 18px 20px; background: var(--paper); border-left: 3px solid var(--green); border-radius: 4px var(--radius-md) var(--radius-md) 4px; }
.record-card-header { display: flex; justify-content: space-between; gap: 12px; }
.record-time { color: var(--green); font-size: .76rem; font-weight: 800; }
.record-card p { margin: 9px 0 13px; white-space: pre-wrap; }
.record-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.record-tags span { padding: 3px 8px; color: var(--muted); background: var(--white); border-radius: 999px; font-size: .7rem; }
.record-card-actions { display: flex; gap: 4px; }
.record-card-actions button { padding: 5px 7px; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }
.empty-state span { color: var(--green); font-size: 2rem; }
.empty-state p { margin: 8px 0 0; color: var(--ink); }

.assistant-panel { display: flex; flex-direction: column; min-height: 720px; padding: clamp(20px, 2.5vw, 32px); background: var(--ink); color: var(--white); }
.assistant-heading { justify-content: flex-start; gap: 14px; }
.assistant-orb { display: grid; place-items: center; width: 48px; height: 48px; color: var(--ink); background: #d7e6d6; border-radius: 50%; }
.status-line { margin: 0; color: #adc4b1; font-size: .64rem; font-weight: 800; letter-spacing: .16em; }
.status-line span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #8eda9d; border-radius: 50%; }
.assistant-heading h3 { margin: 2px 0 0; font: 400 1.45rem Georgia, "Songti SC", serif; }
.assistant-messages { display: flex; flex: 1; flex-direction: column; gap: 12px; margin: 26px -4px 18px; overflow-y: auto; }
.message { max-width: 88%; padding: 13px 15px; border-radius: 16px; font-size: .88rem; white-space: pre-wrap; }
.message.is-assistant { align-self: flex-start; color: #eaf0ea; background: #344139; border-bottom-left-radius: 4px; }
.message.is-user { align-self: flex-end; color: var(--ink); background: #dce7dd; border-bottom-right-radius: 4px; }
.message-meta { display: block; margin-top: 7px; opacity: .6; font-size: .65rem; }
.draft-card { margin-top: 10px; padding: 12px; color: var(--ink); background: var(--white); border-radius: 12px; }
.draft-card button { margin-top: 10px; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.prompt-chips button { padding: 7px 10px; color: #cad5cc; background: transparent; border: 1px solid #536158; border-radius: 999px; font-size: .7rem; }
.assistant-form { padding: 14px; background: #344139; border: 1px solid #536158; border-radius: 20px; }
.assistant-form textarea { width: 100%; resize: none; color: white; background: transparent; border: 0; outline: 0; }
.assistant-form textarea::placeholder { color: #9da79f; }
.assistant-form-footer { color: #9da79f; font-size: .68rem; }
.send-button { width: 36px; height: 36px; color: var(--ink); background: #dce7dd; border-radius: 50%; font-weight: 900; }

.record-dialog { width: min(620px, calc(100% - 28px)); padding: 0; background: var(--white); border: 0; border-radius: 26px; box-shadow: var(--shadow); }
.record-dialog::backdrop { background: rgba(26, 35, 29, .48); backdrop-filter: blur(5px); }
.record-dialog form { padding: clamp(22px, 4vw, 38px); }
.record-dialog h2 { margin: 0; font: 400 2rem Georgia, "Songti SC", serif; }
.record-dialog label { display: grid; gap: 7px; margin-top: 18px; color: var(--muted); font-size: .8rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.record-dialog input, .record-dialog textarea, .record-dialog select { width: 100%; padding: 12px 13px; color: var(--ink); background: var(--paper); border: 1px solid transparent; border-radius: 12px; outline: 0; }
.record-dialog input:focus, .record-dialog textarea:focus, .record-dialog select:focus { border-color: var(--green); }
.form-error { min-height: 24px; margin: 8px 0 0; color: #a84132; font-size: .78rem; }
.dialog-actions { justify-content: flex-end; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .home-view, .daylog-layout { grid-template-columns: 1fr; }
  .home-view { padding-top: 110px; }
  .profile-card { margin-top: 52px; }
  .assistant-panel { min-height: 620px; }
}
@media (max-width: 620px) {
  .site-header { padding: 15px 18px; }
  .site-nav { gap: 16px; }
  .home-view { min-height: auto; padding: 80px 20px 70px; }
  h1 { font-size: 3.7rem; }
  .link-grid, .form-row { grid-template-columns: 1fr; }
  .life-view { padding: 60px 10px; }
  .section-heading { display: block; padding: 0 10px; }
  .section-heading > p { margin-top: 16px; }
  .journal-panel, .assistant-panel { border-radius: 23px; }
  .calendar-day { min-height: 48px; padding: 5px; border-radius: 12px; }
  .calendar-weekdays, .calendar-grid { gap: 2px; }
  .records-heading { align-items: flex-end; }
  .record-card { padding: 15px; }
}
