/* =========================================================
   components.css —— 卡片、按钮、搜索、时钟、toast、骨架屏等
   ========================================================= */

/* ---------- 区块标题 ---------- */
.section { margin-bottom: 28px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head .more { font-size: .85rem; color: var(--brand); white-space: nowrap; }

/* ---------- 城市卡片 ---------- */
.city-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.city-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.city-card.is-dragging { opacity: .5; }

.city-card .card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-card .city-name {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.city-card .city-name a:hover { color: var(--brand); }
.city-card .city-en { font-size: .78rem; color: var(--text-3); }

.city-card .card-country {
  font-size: .78rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.city-card .card-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}

.city-card .card-date {
  font-size: .8rem;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.city-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: .76rem;
  color: var(--text-2);
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge.today { background: var(--warn-soft); color: var(--warn); }
.badge.yesterday { background: var(--bg-soft); color: var(--text-3); }
.badge.tomorrow { background: var(--brand-soft); color: var(--brand); }
.badge.dst { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: var(--bg-soft); color: var(--text-3); }
.badge.hot { background: var(--danger-soft); color: var(--danger); }
.badge.capital { background: var(--ok-soft); color: var(--ok); }
.badge.workday { background: var(--brand-soft); color: var(--brand); }
.badge.weekend { background: var(--ok-soft); color: var(--ok); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-s);
  font-size: .9rem;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  border: 1px solid transparent;
}

.btn:hover { background: var(--line); }

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover { background: var(--brand-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover { background: var(--bg-soft); }

.btn-icon {
  min-height: 34px;
  width: 34px;
  padding: 0;
  border-radius: var(--radius-s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg { width: 18px; height: 18px; }

/* 卡片上的小图标按钮 */
.icon-btn {
  min-height: 30px;
  width: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: transparent;
}

.icon-btn:hover { background: var(--bg-soft); color: var(--brand); }
.icon-btn.faved { color: var(--danger); }

.icon-btn svg { width: 16px; height: 16px; }

/* ---------- 搜索框与下拉结果 ---------- */
.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 30px;
  width: 30px;
  border-radius: 50%;
  color: var(--text-3);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.show { display: inline-flex; }
.search-clear:hover { background: var(--bg-soft); color: var(--text); }

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .72rem;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow: auto;
  z-index: 120;
  display: none;
}

.search-dropdown.open { display: block; }

.search-group-title {
  padding: 8px 14px 4px;
  font-size: .76rem;
  color: var(--text-3);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  font-size: .9rem;
}

.search-item:hover, .search-item.hl { background: var(--bg-soft); }

.search-item .si-main { flex: 1; min-width: 0; }
.search-item .si-zh { font-weight: 600; }
.search-item .si-en { font-size: .76rem; color: var(--text-3); }
.search-item .si-tag {
  font-size: .7rem;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  flex-shrink: 0;
}

.search-empty {
  padding: 16px 14px;
  font-size: .88rem;
  color: var(--text-3);
}

/* ---------- 大洲筛选 chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  font-size: .88rem;
  color: var(--text-2);
  transition: all .15s ease;
}

.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------- 大时钟（首页 / 城市页） ---------- */
.hero {
  background: linear-gradient(180deg, var(--brand-soft), transparent 80%);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px 20px;
  text-align: center;
}

.clock-zone-label {
  font-size: .9rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

.clock-big {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 9vw, 4.8rem);
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.clock-sub {
  margin-top: 8px;
  font-size: .95rem;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
}

.clock-controls {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.seg button {
  min-height: 40px;
  padding: 0 14px;
  font-size: .86rem;
  color: var(--text-2);
}

.seg button.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 时区选择器 / 表单 ---------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: .88rem;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
}

.select,
.input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg-card);
  font-size: .95rem;
}

.select:focus, .input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* 转换结果面板 */
.convert-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.convert-result {
  display: grid;
  gap: 10px;
}

.convert-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.convert-row .cr-label { flex-shrink: 0; width: 110px; color: var(--text-2); font-size: .88rem; }
.convert-row .cr-value { font-size: 1.05rem; font-weight: 600; }
.convert-row .cr-value.mono { font-family: var(--font-mono); }

.diff-big {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-s);
  background: var(--bg-soft);
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- 时区/城市信息表 ---------- */
.info-table { width: 100%; font-size: .92rem; }
.info-table td, .info-table th { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.info-table th { width: 130px; color: var(--text-2); font-weight: 600; white-space: nowrap; }

.tz-list { display: grid; gap: 10px; }
.tz-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 14px;
}
.tz-item .tz-name { font-family: var(--font-mono); font-size: .9rem; }
.tz-item .tz-time { font-family: var(--font-mono); font-size: .95rem; font-weight: 600; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px);
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-wrap { bottom: 24px; }
}

.toast {
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  font-size: .88rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
  max-width: 86vw;
}

.toast.show { opacity: 1; transform: none; }

/* ---------- 骨架屏 ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg-card) 70%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-3);
  font-size: .92rem;
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto 10px; opacity: .4; }

/* ---------- 折叠面板（关于页 FAQ） ---------- */
details.faq {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin-bottom: 10px;
}

details.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  padding: 4px 0;
}

details.faq p { margin-top: 8px; font-size: .9rem; color: var(--text-2); }

/* ---------- 快捷键提示 ---------- */
.kbd-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: .78rem;
  color: var(--text-3);
  margin-top: 10px;
  justify-content: center;
}

.kbd-hints kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  background: var(--bg-card);
}

/* ---------- 内链标签云 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .82rem;
  color: var(--text-2);
  background: var(--bg-card);
}
.tag-cloud a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 列表页表格 ---------- */
.table-wrap { overflow-x: auto; }
.list-table { width: 100%; font-size: .9rem; }
.list-table th, .list-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list-table th { color: var(--text-2); font-weight: 600; background: var(--bg-soft); }
.list-table tr:hover td { background: var(--bg-soft); }
.list-table .mono { font-family: var(--font-mono); }

/* ---------- 面板时钟（国家/时区页代表时区） ---------- */
.panel-clock { text-align: center; padding: 16px 10px; }
.panel-clock .panel-time {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.panel-clock .panel-sub { margin-top: 6px; font-size: .88rem; color: var(--text-2); }

/* ---------- 搜索分组 ---------- */
.search-group { margin-bottom: 4px; }
.search-item .si-main { display: flex; align-items: baseline; gap: 6px; min-width: 0; }

/* ---------- 时区项偏移 ---------- */
.tz-item .tz-offset { font-size: .8rem; color: var(--text-3); white-space: nowrap; }

/* ---------- 网格骨架屏 ---------- */
.grid-skeleton {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.grid-skeleton::before {
  content: "";
  grid-column: 1 / -1;
  height: 96px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  animation: shimmer 1.4s infinite;
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg-card) 70%, transparent), transparent);
  background-size: 200% 100%;
}

/* ---------- 转换结果补充 ---------- */
.convert-result { display: grid; gap: 6px; }
.convert-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

