/* =============================================================================
 *  09-terms.css — 二十四节气：查询控件 + 二十四节气详解
 *  ---------------------------------------------------------------------------
 *  只吃 00-tokens.css 的变量，不写死颜色，换主题自动跟着变。
 *  控件结构由 79-terms.js 生成，类名以 jq- 开头；节气详解写在 HTML 里，
 *  类名以 ti- 开头。与 08-zodiac.css 同套路，两边互不依赖。
 * ========================================================================== */

/* ---------------------------------------------------------------- 容器 */
.terms-wrap {
  margin: 20px 0 0;
  padding: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}

/* ---------------------------------------------------------------- 日期选择条 */
.jq-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.jq-sel {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px;
  cursor: pointer;
  max-width: 100px;
}
.jq-unit { font-size: 13px; color: var(--muted); margin-right: 4px; }

.jq-today {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.jq-today:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}
.jq-today:active { transform: translateY(1px); }

.jq-sel:focus-visible,
.jq-today:focus-visible,
.jq-row:focus-visible,
.jq-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------- 结果卡 */
.jq-now + .jq-year { margin-top: 20px; }

.jq-card {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.jq-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.jq-emoji { font-size: 40px; line-height: 1; }
.jq-who {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  line-height: 1.2;
}
.jq-order { margin-top: 4px; font-size: 13px; color: var(--muted); }

.jq-kv { margin: 0 0 12px; }
.jq-kv th { white-space: nowrap; }

.jq-next {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-2);
}
.jq-next b { color: var(--accent-2); }

.jq-more {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
}
.jq-more:hover { border-bottom-style: solid; }

.jq-empty { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- 全年交节表 */
.jq-year-title { margin: 0 0 4px; font-size: 17px; }
.jq-order-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.jq-group {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.jq-group-head {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
}

.jq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.jq-table th,
.jq-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.jq-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper-2);
}
.jq-table tbody tr:last-child th,
.jq-table tbody tr:last-child td { border-bottom: 0; }
.jq-table tbody th { font-weight: 600; color: var(--ink); }

.jq-row { cursor: pointer; transition: background .12s; }
.jq-row:hover { background: var(--accent-soft); }
.jq-row.is-now { background: var(--accent-soft); }
.jq-row.is-now th { color: var(--accent-2); }
.jq-row.is-now th::after {
  content: ' ●';
  font-size: 9px;
  vertical-align: middle;
  color: var(--accent);
}

.jq-time,
.jq-lon { color: var(--muted); font-variant-numeric: tabular-nums; }

.jq-hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- 二十四节气详解 */
.terms-list { margin-top: 4px; }

.term-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.term-item:first-child { border-top: 0; padding-top: 4px; }

.term-item h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink);
}
.ti-emoji { margin-right: 4px; font-size: 20px; }
.ti-meta {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.ti-summary {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent-2);
}

.ti-body p { margin: 0 0 10px; }
.ti-body p:last-child { margin-bottom: 0; }
.ti-note {
  padding: 10px 12px;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 14px;
  color: var(--ink-2);
}
.ti-note b { color: var(--ink); }

/* 结果卡点「看详解」时闪一下，和生肖页同一个交互 */
.term-item.is-flash { animation: jq-flash 1.6s ease-out 1; }
@keyframes jq-flash {
  0%, 40% { background: var(--accent-soft); }
  100% { background: transparent; }
}

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 640px) {
  .terms-wrap { padding: 12px; }
  .jq-emoji { font-size: 32px; }
  .jq-who { font-size: 22px; }
  .jq-table th, .jq-table td { padding: 6px 7px; font-size: 13px; }
  .ti-meta { display: block; margin-left: 0; margin-top: 2px; }
}
