/* home.css — 工作台 HOME / LOG 新版（src/HomeViews.jsx）
   方向：Nothing 式的點與細線，文字分級；選中白字、沒選灰字，不加多餘框線。 */

:root { --hv-hot: #E8501A; }
[data-appearance="dark"] { --hv-hot: #FF6A33; }

.hv-mono { font: 500 11px/1.3 var(--font-mono); letter-spacing: .04em; color: var(--label-tertiary);
           font-variant-numeric: tabular-nums; }
.hv-eyebrow { font: 600 11px/1.3 var(--font-mono); letter-spacing: .14em; color: var(--label-secondary); text-transform: uppercase; }
.hv-empty { font-size: 12px; color: var(--label-tertiary); padding: 8px 0; }
.hv-big { font: 700 15px/1 var(--font-mono); color: var(--label-primary); margin-right: 2px; }

/* ── 版面：左上車體、右上月曆、左下清單、右下象限 ── */
.hv-home { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: var(--gap-card, 16px);
           grid-template-areas: "car cal" "list matrix"; }
.hv-area-car    { grid-area: car; }
.hv-area-cal    { grid-area: cal; }
.hv-area-list   { grid-area: list; }
.hv-area-matrix { grid-area: matrix; }
.hv-card { padding: 20px 22px 22px; min-width: 0; display: flex; flex-direction: column; }
/* 下排兩塊不放卡片底，直接畫在頁面背景上 */
.hv-card.hv-bare { background: none; border: 0; box-shadow: none; padding: 20px 6px 8px; }
.hv-area-list.hv-bare   { padding-right: 40px; }   /* 和右邊的象限拉開，不要字貼著十字線 */
.hv-area-matrix.hv-bare { padding-left: 28px; }
.hv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 24px; }

/* ── 車體 ── */
.hv-area-car { padding: 20px 0 0; overflow: hidden; }
.hv-area-car .hv-head { padding: 0 22px; margin-bottom: 0; }
.hv-car { position: relative; flex: 1; min-height: 340px; }
.hv-car iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.hv-car-open { position: absolute; right: 18px; bottom: 16px; display: inline-flex; align-items: center; gap: 6px;
               border: 0; background: none; cursor: pointer; padding: 4px 0;
               font: 600 11px var(--font-mono); letter-spacing: .1em; color: var(--label-secondary); }
.hv-car-open:hover { color: var(--label-primary); }

/* ── 點陣月曆 ── */
.hv-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hv-cal-navbtns { display: inline-flex; align-items: center; gap: 2px; }
.hv-icon-btn, .hv-text-btn { border: 0; background: none; cursor: pointer; color: var(--label-tertiary);
                             display: inline-flex; align-items: center; padding: 4px 6px; border-radius: 6px; }
.hv-icon-btn:hover, .hv-text-btn:hover { color: var(--label-primary); }
.hv-text-btn { font: 600 11px var(--font-mono); letter-spacing: .06em; }
.hv-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hv-cal-wd { font: 500 10px var(--font-mono); color: var(--label-tertiary); text-align: center; padding-bottom: 6px; }
.hv-day { cursor: pointer; outline: none; }
.hv-day:focus-visible { box-shadow: inset 0 0 0 1.5px var(--blue); border-radius: 8px; }

.hv-cal--dot .hv-day { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.hv-dot { display: block; border-radius: 50%; background: var(--label-primary); flex: none; transition: transform .15s; }
.hv-dot--empty { width: 4px; height: 4px; background: var(--label-quaternary); margin: 2px 0; }
.hv-day-num { font: 500 10px/1 var(--font-mono); color: var(--label-tertiary); font-variant-numeric: tabular-nums; }
.hv-day.is-wk .hv-day-num { color: var(--label-secondary); }
.hv-day.is-past { opacity: .4; }
.hv-day.has-done .hv-dot { background: none; box-shadow: inset 0 0 0 1.5px var(--label-tertiary); }
.hv-day.has-late .hv-dot { background: var(--hv-hot); }
.hv-day.is-today .hv-day-num { color: var(--hv-hot); font-weight: 700; }
.hv-day.is-today .hv-dot--empty { width: 8px; height: 8px; background: var(--hv-hot); margin: 0; }
.hv-day.is-today.has-open .hv-dot { background: var(--hv-hot); }
.hv-day.is-sel .hv-dot { box-shadow: 0 0 0 3px var(--bg-secondary), 0 0 0 4.5px var(--label-primary); }
.hv-day:hover .hv-dot { transform: scale(1.2); }

/* 月曆底下的清單 */
.hv-agenda { margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--separator); }
.hv-agenda .hv-eyebrow { margin-bottom: 6px; display: block; }
.hv-agenda-row { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; gap: 8px;
                 border: 0; background: none; padding: 6px 0; cursor: pointer; text-align: left; color: var(--label-primary); }
.hv-agenda-row:hover .hv-agenda-title { color: var(--label-primary); }
.hv-agenda-title { font-size: 13px; color: var(--label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-agenda-owner { font-size: 11px; color: var(--label-tertiary); }
.hv-agenda-row.is-done .hv-agenda-title { text-decoration: line-through; color: var(--label-tertiary); }

/* LOG 大月曆：格子裡直接寫事項 */
.hv-cal--full .hv-cal-nav { margin-bottom: 12px; }
.hv-cal--full .hv-cal-wd { text-align: left; padding: 0 8px 8px; }
.hv-cal--full .hv-day { min-height: 104px; padding: 8px 8px 6px; border-top: 0.5px solid var(--separator);
                        display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hv-cal--full .hv-day:hover { background: var(--fill-quaternary); }
.hv-cal--full .hv-day.is-past { opacity: .5; }
.hv-cal--full .hv-day.is-sel { background: var(--fill-tertiary); }
.hv-cal--full .hv-day-num { font-size: 11px; }
.hv-cal--full .hv-day.is-today .hv-day-num { display: inline-flex; align-items: center; justify-content: center;
     width: 22px; height: 22px; margin: -4px 0 0 -5px; border-radius: 50%; background: var(--hv-hot); color: #fff; }
.hv-day-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hv-day-item { display: flex; align-items: center; gap: 6px; min-width: 0; border: 0; background: none; padding: 1px 0; cursor: pointer;
               font-size: 12px; line-height: 1.3; color: var(--label-primary); text-align: left; }
.hv-day-item i { width: 6px; height: 6px; border-radius: 50%; background: var(--label-primary); flex: none; }
.hv-day.has-late .hv-day-item:not(.is-done) i { background: var(--hv-hot); }
.hv-day-item.is-done { color: var(--label-tertiary); text-decoration: line-through; }
.hv-day-item.is-done i { background: none; box-shadow: inset 0 0 0 1.2px var(--label-tertiary); }
.hv-day-item:hover { color: var(--blue); }
.hv-day-item { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hv-day-more { font: 500 10px var(--font-mono); color: var(--label-tertiary); }
.hv-cal-foot { margin-top: 10px; }

/* ── 本週重點清單 ── */
.hv-list { display: flex; flex-direction: column; }
.hv-list-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 0.5px solid var(--separator); }
.hv-list-row:last-child { border-bottom: 0; }
.hv-check { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--label-tertiary); background: none;
            padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--bg-secondary); }
.hv-check:hover { border-color: var(--label-primary); }
.hv-check.is-on { background: var(--label-tertiary); border-color: transparent; }
.hv-list-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; border: 0; background: none; padding: 0;
                cursor: pointer; text-align: left; }
.hv-list-title { font-size: 14px; color: var(--label-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-list-owner { font-size: 11px; color: var(--label-tertiary); flex: none; }
.hv-list-due { flex: none; }
.hv-list-due.is-late { color: var(--hv-hot); }
.hv-list-due.is-today { color: var(--label-primary); }
.hv-list-row.is-done .hv-list-title { color: var(--label-tertiary); text-decoration: line-through; }

/* ── 四象限 ── */
.hv-add { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
          background: var(--fill-tertiary); color: var(--label-primary); transition: background .15s; }
.hv-add:hover { background: var(--fill-primary); }
.hv-matrix-wrap { flex: 1; display: flex; }
.hv-matrix { position: relative; flex: 1; min-height: 300px; cursor: copy; }
.hv-axis { position: absolute; background: var(--label-quaternary); pointer-events: none; }
.hv-axis--x { left: 0; right: 0; top: 50%; height: 1px; }
.hv-axis--y { top: 0; bottom: 0; left: 50%; width: 1px; }
.hv-axis--x::after, .hv-axis--y::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--label-tertiary); }
.hv-axis--x::after { right: -2px; top: -2px; }
.hv-axis--y::after { top: -2px; left: -2px; }
.hv-q { position: absolute; font: 500 10px var(--font-mono); letter-spacing: .08em; color: var(--label-tertiary); padding: 4px 6px; }
.hv-q--tl { left: 0; top: 0; } .hv-q--tr { right: 0; top: 0; }
.hv-q--bl { left: 0; bottom: 0; } .hv-q--br { right: 0; bottom: 0; }
.hv-q--tr { color: var(--label-secondary); }
.hv-pin { position: absolute; transform: translate(-5px, -50%); display: inline-flex; align-items: center; gap: 7px;
          border: 0; background: none; padding: 3px 0; cursor: grab; max-width: 46%; touch-action: none; z-index: 1; }
.hv-pin i { width: 10px; height: 10px; border-radius: 50%; background: var(--label-primary); flex: none; transition: transform .15s; }
.hv-pin span { font-size: 12px; color: var(--label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-pin.is-left { flex-direction: row-reverse; transform: translate(calc(-100% + 5px), -50%); }
.hv-pin:hover { z-index: 2; }
.hv-pin:hover span { color: var(--label-primary); }
.hv-pin:hover i { transform: scale(1.25); }
.hv-pin.is-late i { background: var(--hv-hot); }
.hv-pin.is-drag { cursor: grabbing; z-index: 3; }
.hv-pin.is-drag i { transform: scale(1.4); }
.hv-pin.is-drag span { color: var(--label-primary); }
.hv-matrix-empty { position: absolute; left: 0; right: 0; top: 56%; text-align: center; pointer-events: none; }

/* ── LOG：往上拉才出現的統計 ── */
.hv-stats { display: flex; gap: 28px; flex-wrap: wrap; overflow: hidden; max-height: 0; opacity: 0;
            transition: max-height .35s var(--ease-out, ease), opacity .25s, margin .35s; margin: 0; }
.hv-stats.is-shown { max-height: 60px; opacity: 1; margin: 0 0 4px; }
.hv-stats span { display: inline-flex; align-items: baseline; gap: 6px; font: 500 10px var(--font-mono); letter-spacing: .1em; color: var(--label-tertiary); }
.hv-stats b { font: 700 18px/1 var(--font-mono); color: var(--label-primary); letter-spacing: 0; }
.hv-stats span.is-late b { color: var(--hv-hot); }
.hv-pull-hint { text-align: center; font: 500 10px var(--font-mono); letter-spacing: .1em; color: var(--label-quaternary);
                margin: -6px 0 0; height: 0; overflow: visible; pointer-events: none; }

/* ── 手機 ── */
@media (max-width: 768px) {
  .hv-home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "car" "cal" "matrix" "list"; gap: 12px; }
  .hv-card { padding: 16px 16px 18px; }
  .hv-area-car { padding: 16px 0 0; }
  .hv-card.hv-bare, .hv-area-list.hv-bare, .hv-area-matrix.hv-bare { padding: 16px 4px 8px; }
  .hv-area-car .hv-head { padding: 0 16px; }
  .hv-car { min-height: 220px; }
  .hv-car iframe { pointer-events: none; }   /* 手機只看不轉，免得擋住捲動 */
  .hv-matrix { min-height: 280px; }
  .hv-pin { max-width: 48%; }
  .hv-cal--full .hv-day { min-height: 56px; padding: 6px 2px; align-items: center; }
  .hv-cal--full .hv-cal-wd { text-align: center; padding: 0 0 6px; }
  .hv-cal--full .hv-day-item { font-size: 0; gap: 0; justify-content: center; pointer-events: none; }   /* 手機點格子選日子，事項在下面清單開 */
  .hv-cal--full .hv-day-items { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .hv-cal--full .hv-day.is-today .hv-day-num { margin: -4px 0 0; }
  .hv-stats { gap: 18px; }
}
