/* FISH HUB · planner.css — 計劃本（月曆／星期時間軸）+ 靈感空間 */

/* ── 通用 ─────────────────────────────────────────── */
.fh-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.fh-btn:active {
  transform: scale(0.97);
}
.fh-btn.fh-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.fh-btn.fh-ghost {
  background: transparent;
}
.fh-btn.fh-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  margin-right: auto;
}
.fh-ic {
  flex: none;
}
.fh-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}
.fh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 2px 0;
  font-size: 11px;
  color: var(--text-2);
}
.fh-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.fh-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  display: inline-block;
}
.fh-dot.fh-pl {
  outline: 1px solid rgba(255, 255, 255, 0.25);
}

/* ── 分段切換 ─────────────────────────────────────── */
.fh-seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  align-self: flex-start;
}
.fh-seg a {
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}
.fh-seg a.active {
  background: var(--accent);
  color: var(--accent-ink);
}
.fh-seg-sm a {
  padding: 6px 12px;
  font-size: 12px;
}

/* ── 月曆 ─────────────────────────────────────────── */
.fh-cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fh-cal-title {
  font-size: 14.5px;
  letter-spacing: 0.02em;
  margin: 0 auto;
}
.fh-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.fh-cal-hd {
  text-align: center;
  font: 600 10px var(--mono);
  color: var(--text-3);
  padding: 2px 0 6px;
  letter-spacing: 0.08em;
}
.fh-cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  padding: 5px 4px 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.fh-cal-day:active {
  background: var(--surface-hover);
}
.fh-cal-day.fh-out {
  opacity: 0.35;
}
.fh-cal-day.fh-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.fh-cal-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-align: left;
}
.fh-today .fh-cal-num {
  color: var(--accent);
}
.fh-cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 7px;
}
.fh-cal-day .fh-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
}
.fh-more {
  color: var(--text-3);
  font-size: 8.5px;
}
.fh-cal-n {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font: 8.5px var(--mono);
  font-style: normal;
  color: var(--text-3);
}

/* ── 星期 strip ───────────────────────────────────── */
.fh-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.fh-day-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 7px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.fh-day-chip .fh-dw {
  font-size: 9.5px;
  color: var(--text-3);
}
.fh-day-chip strong {
  font-size: 15px;
  font-weight: 600;
}
.fh-day-chip.now strong {
  color: var(--accent);
}
.fh-day-chip.active {
  background: var(--accent);
  border-color: var(--accent);
}
.fh-day-chip.active .fh-dw {
  color: var(--accent-ink);
  opacity: 0.75;
}
.fh-day-chip.active strong {
  color: var(--accent-ink);
}
.fh-day-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5px;
  min-height: 8px;
  max-width: 100%;
}
.fh-day-dots .fh-dot {
  width: 5px;
  height: 5px;
  min-width: 5px;
}
.fh-day-chip em {
  position: absolute;
  top: 2px;
  right: 5px;
  font: 8px var(--mono);
  font-style: normal;
  color: var(--text-3);
}
.fh-day-chip.active em {
  color: var(--accent-ink);
  opacity: 0.8;
}

/* ── 日頭 + 全日 band ─────────────────────────────── */
.fh-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.fh-day-head h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fh-tag {
  font-size: 9.5px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 700;
}
.fh-band {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.fh-band-lbl {
  font: 600 10px var(--mono);
  color: var(--text-3);
  padding-top: 3px;
  letter-spacing: 0.1em;
}
.fh-band-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.fh-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10.5px;
  line-height: 1.45;
}

/* ── 時間軸 ───────────────────────────────────────── */
.fh-tl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.fh-tl-body {
  position: relative;
}
.fh-tl-row {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--border);
  cursor: copy;
  border-radius: 6px;
}
.fh-tl-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.012);
}
.fh-tl-row:active {
  background: var(--accent-soft);
}
.fh-tl-lbl {
  position: absolute;
  left: 8px;
  top: 2px;
  font: 500 9.5px var(--mono);
  color: var(--text-3);
  letter-spacing: 0.03em;
  background: var(--surface);
  padding: 0 3px;
  border-radius: 4px;
}
.fh-tl-block {
  position: absolute;
  left: 58px;
  right: 8px;
  z-index: 2;
  border-radius: 9px;
  border: 1px solid;
  padding: 4px 8px;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
}
.fh-tl-block b {
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fh-tl-block span {
  font-size: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fh-tl-block i {
  font-style: normal;
  font: 9px var(--mono);
  opacity: 0.75;
}
.fh-tl-ev {
  background-blend-mode: normal;
}
.fh-tl-pl {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.fh-tl-pl .fh-pl-note {
  font-size: 9.5px;
  opacity: 0.75;
}

/* ── 靈感空間 ─────────────────────────────────────── */
.fh-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fh-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 10px;
  flex: 1;
  min-width: 140px;
  color: var(--text-3);
}
.fh-search input {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 6px 0;
  font-size: 13px;
  width: 100%;
  outline: none;
  color: var(--text);
}
.fh-panel {
  margin-bottom: 2px;
}
.fh-topic-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 8px;
}
.fh-idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  padding: 2px 20px 18px;
}
.fh-idea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fh-idea:active {
  background: var(--surface-hover);
}
.fh-idea-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.fh-idea-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.fh-topic {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  padding: 1.5px 8px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.fh-idea-date {
  font: 9px var(--mono);
  color: var(--text-3);
  white-space: nowrap;
}
.fh-idea h3 {
  font-size: 14px;
  line-height: 1.4;
}
.fh-idea p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fh-idea-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.fh-chip.fh-crs {
  border-style: solid;
  background: transparent;
}
.fh-idea-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.fh-course-ideas {
  display: flex;
  flex-direction: column;
  padding: 0 20px 14px;
}
.fh-course-idea {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  min-width: 0;
}
.fh-course-idea:last-child {
  border-bottom: 0;
}
.fh-course-idea span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fh-more-link {
  font-size: 11px;
  color: var(--accent);
  padding: 6px 4px;
}

/* ── 彈窗（計劃／靈感） ──────────────────────────── */
.fh-dlg {
  max-height: 88vh;
  overflow-y: auto;
}
.fh-dlg .dialog-header {
  margin-bottom: 12px;
}
.fh-dlg label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
}
.fh-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fh-form textarea {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  min-width: 0;
  resize: vertical;
  font-family: inherit;
}
.fh-form select {
  min-height: 44px;
}
.fh-date-line {
  font: 600 15px var(--mono);
  color: var(--accent);
  padding: 8px 2px 0;
}
.fh-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fh-sw {
  position: relative;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.fh-sw input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.fh-sw i {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  box-sizing: border-box;
  transition: transform 100ms;
}
.fh-sw input:checked + i {
  border-color: #fff;
  transform: scale(1.12);
}
.fh-ev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--text-2);
  align-items: center;
}
.fh-ev-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.6;
}
.fh-ev-src {
  margin-top: 10px;
  font: 9.5px var(--mono);
  color: var(--text-3);
  overflow-wrap: break-word;
}
.fh-dlg .icon-button {
  color: var(--text-3);
}

/* ── 桌面微調 ─────────────────────────────────────── */
@media (min-width: 700px) {
  .fh-cal-day {
    min-height: 86px;
    padding: 7px 6px 4px;
  }
  .fh-cal-day .fh-dot {
    width: 8px;
    height: 8px;
  }
  .fh-tl-lbl {
    font-size: 10.5px;
  }
}
