/* ── 重置 & 全局变量 ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg:        #f5efe4;
  --surface:   #fdf8f1;
  --text:      #2d2420;
  --muted:     #8b7d72;
  --border:    #e4ddd6;
  --accent:    #c4793e;
  --accent-bg: #f5ede3;
  --radius:    12px;
  --font:      'Noto Serif SC', 'Songti SC', Georgia, serif;
  --max-w:     560px;
}

html {
  background-color: var(--bg);
  transition: background-color 0.9s ease;
}
body {
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
  transition: color 0.6s ease;
  display: flex;
  flex-direction: column;
}

body > #site-footer {
  margin-top: auto;
}

/* 让所有用变量的元素平滑过渡（夜间模式切换） */
*, *::before, *::after {
  transition:
    background-color 0.9s ease,
    border-color     0.9s ease,
    color            0.6s ease,
    box-shadow       0.9s ease;
}

/* 页面主体层级高于夜间星空层(z-index:1) */
#page-app, #page-auth {
  position: relative;
  z-index: 2;
}

/* ── Tab 切换动画 ──────────────────────────────────────────────── */
@keyframes tab-in  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tab-out { from { opacity: 1; } to { opacity: 0; } }
.tab-enter { animation: tab-in  0.28s cubic-bezier(0.4,0,0.2,1) forwards; }
.tab-exit  { animation: tab-out 0.18s ease forwards; pointer-events: none; }

/* ── 通用布局 ──────────────────────────────────────────────────── */
.tab-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.center-panel {
  text-align: center;
  padding-top: 72px;
  transition: padding-top 0.45s cubic-bezier(0.4,0,0.2,1);
}
.center-panel.compact { padding-top: 20px; }

/* date + prompt 右对齐包装 */
.date-prompt-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}
.date-prompt-wrap .prompt-text { text-align: right; }

/* ── 三层日期 ─────────────────────────────────────────────────── */
.date-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  user-select: none;
}

.date-hero-weekday {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 2px;
  transition: font-size 0.38s cubic-bezier(0.4,0,0.2,1),
              letter-spacing 0.38s cubic-bezier(0.4,0,0.2,1),
              opacity 0.38s,
              margin-bottom 0.38s;
}

.date-hero-day {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(56px, 14vw, 86px);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  letter-spacing: 0;
  transition: font-size 0.42s cubic-bezier(0.4,0,0.2,1),
              font-weight 0.42s;
}

.date-weekday-en {
  font-family: 'Satisfy', cursive;
  font-size: 14px;
  letter-spacing: 0.5px;
  opacity: 0.75;
}

/* 分隔线 */
.date-hero::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--border);
  margin-top: 20px;
  transition: opacity 0.28s, width 0.28s, margin-top 0.28s;
}
/* 日期紧凑态（进入写日记后） */
.date-hero {
  transition: padding 0.4s cubic-bezier(0.4,0,0.2,1),
              border-color 0.4s,
              margin-bottom 0.4s;
}
.date-hero.compact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.date-hero.compact .date-hero-weekday {
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 0;
  opacity: 0.65;
}
.date-hero.compact .date-hero-day {
  font-size: 22px;
  letter-spacing: 0;
  font-weight: 500;
}
.date-hero.compact::after { opacity: 0; width: 0; margin-top: 0; }

/* 预收缩：仅缩小字号，保持列布局（过渡第一阶段） */
.date-hero.pre-compact .date-hero-weekday {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.65;
  margin-bottom: 0;
}
.date-hero.pre-compact .date-hero-day {
  font-size: 22px;
  font-weight: 500;
}
.date-hero.pre-compact::after { opacity: 0; width: 0; margin-top: 0; }

/* compact 时 wrap 改为全宽 */
.center-panel.compact .date-prompt-wrap {
  display: block;
  width: 100%;
  text-align: left;
}

.prompt-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 2;
  margin-bottom: 12px;
}

/* ── 天气小组件 ───────────────────────────────────────────────── */
.weather-widget {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  opacity: 0.82;
}
.wx-icon  { font-size: 14px; }
.wx-temp  { font-weight: 500; color: var(--text); }
.wx-desc  { }
.wx-city  { opacity: 0.6; }
.wx-city::before { content: '·'; margin-right: 4px; }

/* ── 低语短句 ─────────────────────────────────────────────────── */
.prompt-whisper {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 1px;
  height: 28px;
  margin-bottom: 20px;
  opacity: 0.6;
}
.prompt-cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
  font-weight: 300;
  opacity: 0.5;
}
@keyframes blink { 0%,100%{opacity:0.5} 50%{opacity:0} }

/* ── 按钮组纵向堆叠 ───────────────────────────────────────────── */
.btn-entry-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ── 首页入口：手记风主按钮 ───────────────────────────────────── */
.btn-ink {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 19px;
  letter-spacing: 3px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 12px 44px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.22s cubic-bezier(0.4,0,0.2,1);
}
.btn-ink:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-ink:active { transform: translateY(0) scale(0.97); }

/* 稍后再写 */
.btn-skip {
  display: inline-block;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 14px;
  letter-spacing: 0.5px;
  opacity: 0.75;
  position: relative;
  transition: opacity 0.2s, color 0.2s;
}
.btn-skip::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  width: 0;
  background: var(--muted);
  transition: width 0.25s ease;
}
.btn-skip:hover { opacity: 1; color: var(--text); }
.btn-skip:hover::after { width: 100%; }

/* ── 通用按钮 ─────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.btn-primary:hover   { opacity: .88; }
.btn-primary:active  { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: default; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--accent-bg); }

/* ── 入场过渡动画 ─────────────────────────────────────────────── */
/* 划线 */
.whisper-strike-line {
  position: absolute;
  left: 0; top: 50%;
  height: 1.5px;
  width: 0;
  background: var(--muted);
  border-radius: 1px;
  animation: strike-draw 0.35s ease forwards;
}
@keyframes strike-draw { to { width: 100%; } }

/* 渐出 */
.entry-fade-out {
  transition: opacity 0.25s ease, max-height 0.3s ease 0.1s, margin 0.3s ease 0.1s;
  overflow: hidden;
}
.entry-fade-out.out {
  opacity: 0;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ── 备案号页脚 ───────────────────────────────────────────────── */
#site-footer {
  text-align: center;
  padding: 16px 0 20px;
  font-size: 12px;
}
#site-footer a {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity .2s;
}
#site-footer a:hover { opacity: 1; }
.footer-sep {
  margin: 0 10px;
  opacity: 0.3;
  color: var(--muted);
}

/* diary-steps 从下方滑入 */
@keyframes slide-up-in {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
.diary-steps-enter {
  animation: slide-up-in 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}
