/* ===== 分頁列 ===== */
.tabbar {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  background: #0a0a0b;
  border-bottom: 1px solid var(--border);
  margin: calc(var(--gap) * -1);
  margin-bottom: 0;
  padding-bottom: 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  transition: color .15s, background .15s;
  user-select: none;
  position: relative;
  bottom: -1px;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}
.tab-icon { font-size: 13px; }

.mochi-logo {
  margin-left: auto;
  padding: 7px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
  cursor: default;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  transition: color .2s;
}
.mochi-logo:hover { color: var(--accent); }

/* 每個字母+詞尾的容器 */
.lw {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  /* 散開由 .lx max-width 靜默撐開，不用 margin */
}

/* 關鍵字母：始終可見 */
.ml { flex-shrink: 0; letter-spacing: .12em; }

/* O → & 交換：進入有 delay，離開無 delay */
.ml-o { transition: opacity .25s; }
.mochi-logo:hover .ml-o { opacity: 0; transition: opacity .3s 1.0s; }

.ml-amp {
  max-width: 0; overflow: hidden; opacity: 0; flex-shrink: 0; letter-spacing: .12em;
  transition: max-width .35s ease, opacity .25s; /* 離開：收回 */
}
.mochi-logo:hover .ml-amp {
  max-width: 2em; opacity: 1;
  transition:
    max-width .5s .5s cubic-bezier(.25,0,.1,1),  /* 與 lx 同步撐開 */
    opacity .55s 1.2s;                            /* & 淡入 */
}

/* 詞尾：Phase 1 無聲撐開間距，Phase 2 淡入                       */
/* t=0.5→1.0s：靜默撐開，字母就位於全稱位置                        */
/* t=1.0→1.2s：M O C H I 停留 0.2s                               */
/* t=1.2→1.9s：詞尾淡入，字母不再移動                              */
.lx {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; letter-spacing: .03em;
  transition: max-width .35s ease, opacity .25s; /* 離開：收回 */
}
.mochi-logo:hover .lx {
  max-width: 100px; opacity: 1;
  transition:
    max-width .5s .5s cubic-bezier(.25,0,.1,1),
    opacity .7s 1.2s;
}

/* 點：淡出 */
.md {
  flex-shrink: 0;
  letter-spacing: .12em;
  transition: opacity .4s;
}
.mochi-logo:hover .md { opacity: 0; }

/* 頁面板 */
.tab-panel { display: none; }
.tab-panel.active { display: contents; }

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f10;
  --surface:   #1a1a1d;
  --border:    #2a2a2e;
  --text:      #e8e8ea;
  --muted:     #6b6b72;
  --accent:    #c8a96e;   /* 暖金 */
  --accent2:   #7eb8a4;   /* 薄荷綠 */
  --done:      #5a8f6a;
  --gap: 14px;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans TC', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: var(--gap);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ===== 上半格 ===== */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* 待辦清單 */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-list li {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: default;
  transition: border-color .2s;
}
.task-list li:hover { border-color: var(--accent); }

/* 勾選框條目 */
.task-list .li-check { padding: 0; cursor: pointer; } /* 提高優先度蓋掉 .task-list li 的 padding */
.li-check label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  width: 100%;
}

.task-check {
  appearance: none;
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.task-check:checked {
  background: var(--done);
  border-color: var(--done);
}
.task-check:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 0px;
  width: 4px; height: 8px;
  border: 1.5px solid #0f0f10;
  border-left: none;
  border-top: none;
  transform: rotate(45deg);
}

.li-check:has(.task-check:checked) span {
  text-decoration: line-through;
  color: var(--muted);
}

/* 接續事項條目：✓ → 刪除線停留 → 淡出移除 */
.li-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: opacity .3s, border-color .2s;
}
.btn-next-done {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-next-done:hover { color: var(--done); border-color: var(--done); }

/* 完成階段：刪除線 + 綠勾，停留一拍給完成感 */
.li-next.completing { border-color: var(--done); }
.li-next.completing span {
  text-decoration: line-through;
  color: var(--muted);
}
.li-next.completing .btn-next-done {
  color: var(--bg);
  background: var(--done);
  border-color: var(--done);
  pointer-events: none;
}
/* 淡出階段 */
.li-next.removing { opacity: 0; }

/* N1 學習條目：flex 佈局讓按鈕靠右 */
.li-reportable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-report-inline {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .06em;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-report-inline:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-report-inline.active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* 日期區塊 */
.date-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}
.year   { font-size: 12px; color: var(--muted); }
.date   { font-size: 36px; font-weight: 700; letter-spacing: .02em; color: var(--text); position: relative; cursor: default; }
.weekday{ font-size: 14px; color: var(--muted); cursor: default; }

/* Tooltip（ひらがな）*/
[data-reading] { position: relative; }
[data-reading]:hover::after {
  content: attr(data-reading);
  position: absolute;
  left: 0; top: 100%;
  margin-top: 4px;
  background: var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
  letter-spacing: .06em;
  pointer-events: none;
  z-index: 10;
}

/* 近期目標 ticker */
.goals-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.ticker-wrap {
  overflow: hidden;
  height: 26px;
  cursor: pointer;
}
.ticker-items {
  display: flex;
  flex-direction: column;
  /* animation 由 JS 控制，CSS 不設 */
}
.ticker-items span {
  height: 26px;
  line-height: 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== 中間格 ===== */
.mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.mid-card {
  position: relative;
  min-height: 140px;
}

/* default / hover view 切換：用 opacity 不用 display，避免高度塌陷 */
.default-view,
.hover-view {
  transition: opacity .2s ease;
}
.default-view {
  opacity: 1;
  pointer-events: auto;
}
.hover-view {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 18px; left: 20px; right: 20px;  /* 對齊 card padding */
}
.mid-card.active .default-view {
  opacity: 0;
  pointer-events: none;
}
.mid-card.active .hover-view {
  opacity: 1;
  pointer-events: auto;
}

.hover-title { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.hover-desc  { font-size: 12px; color: var(--muted); }

/* 步驟欄 */
.hover-view { display: flex; flex-direction: row; gap: 20px; }
.steps-col { flex: 1; }
.steps-col h3 { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.step-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.step-list li { font-size: 12px; padding-left: 14px; position: relative; }
.step-list li::before { content: ''; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; }
.step-list.done li { color: var(--muted); text-decoration: line-through; }
.step-list.done li::before { background: var(--done); }
.step-list.next li { color: var(--text); }
.step-list.next li::before { background: var(--accent); }

/* ===== 時間軸 ===== */
.timeline-wrap {
  padding: 10px 0 6px;
}
.timeline {
  position: relative;
  height: 80px;
  margin: 0 20px;
}
.tl-line {
  position: absolute;
  top: 32px;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.tl-line::after {
  content: '';
  position: absolute;
  right: -6px; top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--border);
}
.tl-now, .tl-event {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.tl-now { left: 2%; }
.tl-date {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .03em;
  white-space: nowrap;
}
.tl-event:hover .tl-date,
.tl-event.active .tl-date { color: var(--accent); }

.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--muted);
  transition: background .2s, border-color .2s, transform .2s;
  margin-top: 26px;
}
.tl-event .tl-dot { margin-top: 8px; }
.now-dot {
  background: var(--accent);
  border-color: var(--accent);
  width: 10px; height: 10px;
}
.tl-event:hover .tl-dot,
.tl-event.active .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.3);
}
.tl-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .05em;
  margin-top: 2px;
}
.tl-event:hover .tl-label,
.tl-event.active .tl-label { color: var(--accent); }

/* ===== 進度條 ===== */
.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-item { display: flex; align-items: center; gap: 10px; }
.progress-label { font-size: 12px; color: var(--text); min-width: 90px; }
.progress-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .4s ease;
}
.progress-bar.accent2 { background: var(--accent2); }
.progress-pct { font-size: 11px; color: var(--muted); min-width: 60px; text-align: right; }

/* ===== 日誌 ===== */
.log-wrap { }
.log-wrap h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.log-scroll {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.log-scroll::-webkit-scrollbar { width: 4px; }
.log-scroll::-webkit-scrollbar-track { background: transparent; }
.log-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.log-entry { display: flex; gap: 14px; align-items: baseline; }
.log-date {
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  min-width: 44px;
}
.log-text { font-size: 13px; color: var(--text); }

/* ===== 卡片 header（帶按鈕）===== */
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.card-header h2 { margin-bottom: 0; flex: 1; }

.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  transition: color .15s, background .15s;
  white-space: nowrap;
  letter-spacing: .04em;
}
.btn-icon:hover { color: var(--text); background: var(--border); }
.btn-icon.active { color: var(--accent); background: var(--border); }

/* ===== 回報表單 ===== */
.report-form { display: none; flex-direction: column; gap: 8px; }
.report-form.visible { display: flex; }

.report-rows { display: flex; flex-direction: column; gap: 6px; }
.report-row {
  display: grid;
  grid-template-columns: 3fr 2fr 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.report-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 8px;
  text-align: center;
  width: 100%;
}
.report-input:focus { border-color: var(--accent); outline: none; }
.report-unit { font-size: 11px; color: var(--muted); }

.report-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }

.btn-back-report {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 4px 2px;
  transition: color .15s;
}
.btn-back-report:hover { color: var(--text); }
.btn-done {
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: var(--bg);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  transition: opacity .15s;
}
.btn-done:hover { opacity: .85; }

/* ===== 企劃總覽頁面 ===== */
.projects-page { display: flex; flex-direction: column; gap: 14px; }

.projects-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 5px 10px;
  transition: color .15s, border-color .15s;
}
.btn-back:hover { color: var(--text); border-color: var(--muted); }

.projects-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card.status-done  { border-left: 3px solid var(--done); }
.project-card.status-wip   { border-left: 3px solid var(--accent); }

.project-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.project-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border);
  color: var(--muted);
  letter-spacing: .04em;
}
.project-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }
.project-meta { display: flex; gap: 8px; font-size: 12px; }
.project-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 1px;
}
.project-mono { font-size: 11px; color: var(--muted); font-family: monospace; }
