:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  --bg: #fdfdfc;
  --sidebar: #f5f5f6;
  --card: #f5f5f6;
  --reflection: #f5f5f6;
  --text-title: #17171a;
  --text-body: #3a3a41;
  --text-note: #6d6d76;
  --text-dim: #93939b;
  --border: #ebebee;
  --accent: #c8281e;
  --button-bg: #fdfdfc;
  --button-text: #c8281e;
  --selected: #ebebee;
  --hover: #ebebee;
  color: var(--text-body);
  background: var(--bg);
}
:root[data-theme="green"] {
  --bg: #f6f5f0;
  --sidebar: #edefe7;
  --card: #ffffff;
  --reflection: #fafbf7;
  --text-title: #333c36;
  --text-body: #3d453e;
  --text-note: #7d827a;
  --text-dim: #8a9183;
  --border: #e3e6dc;
  --accent: #49654f;
  --button-bg: #49654f;
  --button-text: #ffffff;
  --selected: #dfe5d8;
  --hover: #e7ebe1;
}
:root[data-theme="black"] {
  --bg: #fcfcfc;
  --sidebar: #f4f4f4;
  --card: #ffffff;
  --reflection: #f8f8f8;
  --text-title: #191919;
  --text-body: #3d3d3d;
  --text-note: #707070;
  --text-dim: #8e8e8e;
  --border: #e7e7e7;
  --accent: #252525;
  --button-bg: #252525;
  --button-text: #ffffff;
  --selected: #e9e9e9;
  --hover: #eeeeee;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); background: var(--card); color: inherit; border-radius: 8px; }
button:hover { background: var(--hover); }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sidebar { width: 262px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--border); padding: 36px 24px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 13px; font-size: 20px; font-weight: 600; letter-spacing: 1px; color: var(--text-title); }
.brand small { display: block; font-size: 11px; letter-spacing: 0; font-weight: 400; color: var(--text-note); margin-top: 7px; }
.brand-mark { color: var(--accent); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; width: 42px; height: 46px; display: grid; place-items: center; font-family: serif; font-size: 24px; }
.today-button { background: var(--button-bg); color: var(--button-text); padding: 13px 16px; margin: 34px 0; display: flex; justify-content: space-between; font-size: 13px; }
.today-button:hover { background: var(--button-bg); opacity: .85; }
.list-heading { font-size: 11px; color: var(--text-note); display: flex; justify-content: space-between; padding: 0 4px; margin-bottom: 13px; }
.list-heading span { border-radius: 9px; background: var(--selected); padding: 0 6px; }
#entries { overflow: auto; flex: 1; }
#entries button { width: 100%; display: flex; justify-content: space-between; text-align: left; border: 0; background: transparent; padding: 13px 12px; margin: 3px 0; font-size: 13px; }
#entries button:hover, #entries button.active { background: var(--selected); color: var(--accent); }
#entries small { font-size: 10px; color: var(--text-note); }
.empty { font-size: 12px; line-height: 1.9; color: var(--text-note); padding: 8px 4px; }
.sidebar-bottom { padding-top: 24px; line-height: 1.9; font-size: 12px; color: var(--text-note); }
.sidebar-tagline { margin-top: 18px; }
.sidebar-tagline span { font-size: 10px; color: var(--text-dim); }
.theme-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.theme-control select { min-width: 0; width: 134px; color: var(--text-body); background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 12px; }
main { width: 100%; max-width: 1200px; margin: auto; padding: 0 54px 30px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 87px; border-bottom: 1px solid var(--border); gap: 12px; }
.eyebrow { font-size: 12px; color: var(--text-note); letter-spacing: 2px; }
.save-controls { display: flex; align-items: center; gap: 15px; }
#status { font-size: 11px; color: var(--text-note); }
#status.error { color: var(--accent); }
.save-controls button { font-size: 12px; padding: 8px 17px; color: var(--accent); }
.day-header { padding: 36px 0 27px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.date-kind { font-size: 11px; color: var(--text-note); letter-spacing: 2px; }
h1 { font-size: 32px; letter-spacing: 1px; font-weight: 500; margin: 10px 0; color: var(--text-title); }
#subtitle { font-size: 12px; color: var(--text-note); line-height: 1.9; margin: 8px 0 0; }
.date-controls { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.date-controls label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.date-controls button { width: 30px; height: 35px; font-size: 21px; }
.date-controls input { font-size: 12px; border: 1px solid var(--border); background: var(--card); padding: 8px; border-radius: 8px; color: var(--text-body); min-width: 0; max-width: 160px; }
.section { margin-bottom: 27px; }
.section-heading { display: flex; gap: 16px; align-items: baseline; margin-bottom: 12px; }
h2 { font-family: Georgia, serif; font-size: 23px; font-weight: 400; margin: 0; color: var(--text-title); }
.section-heading > span { font-size: 11px; color: var(--text-note); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 20px 12px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.field-heading b { font-size: 14px; font-weight: 500; color: var(--text-title); }
.field-heading > span { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }
.card textarea { display: block; width: 100%; border: 0; background: transparent; min-height: 92px; max-height: 600px; resize: vertical; font-size: 13px; line-height: 1.95; color: var(--text-body); padding: 0 1px 8px; }
.card textarea::placeholder { color: var(--text-dim); font-size: 12px; }
.reflection { grid-template-columns: repeat(3, minmax(0,1fr)); }
.reflection .card { background: var(--reflection); padding: 18px 16px 10px; }
.reflection textarea { min-height: 108px; }
footer { border-top: 1px solid var(--border); padding-top: 17px; font-size: 10px; color: var(--text-note); line-height: 1.9; }
details { margin-top: 6px; }
summary { cursor: pointer; display: list-item; width: fit-content; }
details p { overflow-wrap: anywhere; max-width: 780px; }
#notice, #draft-notice { border: 1px solid var(--border); border-left: 2px solid var(--accent); background: var(--card); border-radius: 8px; padding: 12px 16px; color: var(--text-body); font-size: 12px; line-height: 1.8; margin-bottom: 18px; }
#draft-notice button { padding: 5px 9px; margin: 4px 0 4px 8px; font-size: 11px; }
[hidden] { display: none !important; }
@media (max-width: 1150px) {
  main { padding: 0 30px 25px; }
  .sidebar { width: 220px; padding: 28px 18px; }
  .day-header { align-items: flex-start; flex-direction: column; gap: 15px; }
  .reflection { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reflection .card:last-child { grid-column: 1/-1; }
  .reflection .card:last-child textarea { min-height: 75px; }
}
@media (max-width: 680px) {
  body { display: block; }
  .sidebar { width: 100%; height: auto; position: static; padding: 19px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { font-size: 18px; }
  .brand-mark { width: 35px; height: 39px; }
  .brand small { font-size: 10px; }
  .today-button { margin: 18px 0 15px; padding: 11px 13px; }
  .list-heading { margin-bottom: 7px; }
  #entries { display: flex; gap: 5px; max-height: 65px; overflow: auto; }
  #entries button { width: auto; flex-shrink: 0; gap: 12px; padding: 10px; font-size: 12px; }
  .empty { padding: 0; }
  .sidebar-bottom { padding-top: 14px; }
  .theme-control { justify-content: flex-start; }
  .theme-control select { padding: 6px 8px; }
  .sidebar-tagline { display: none; }
  main { padding: 0 20px 25px; }
  .topbar { min-height: 65px; }
  .save-controls { gap: 9px; }
  .eyebrow { font-size: 11px; }
  .day-header { padding: 25px 0 22px; gap: 15px; }
  h1 { font-size: 27px; }
  .cards, .reflection { grid-template-columns: 1fr; }
  .reflection .card:last-child { grid-column: auto; }
  .card, .reflection .card { padding: 17px 17px 10px; }
  .card textarea, .reflection textarea, .reflection .card:last-child textarea { min-height: 95px; }
  .section-heading > span { font-size: 10px; }
  .section { margin-bottom: 25px; }
}
