/*
 * 历史朝代查询 - 页面私有样式（中国风：宣纸底 · 朱砂 · 黛蓝 · 鎏金）
 * 注意：.links-section/.links-grid/footer 等公共区块样式由 /css/style.css 提供，此处不得重复定义
 */

/* ══════════ 查询工具面板 ══════════ */
.ld-tool {
  background: linear-gradient(180deg, #faf6ec 0%, #f6efdd 100%);
  border: 1px solid #e0d3b0;
  border-radius: var(--border-radius, 12px);
  padding: 22px 22px 18px;
  margin: 18px 0 26px;
  box-shadow: 0 2px 10px rgba(107, 86, 55, 0.08);
}

.ld-stat-line {
  text-align: center;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 17px;
  color: #4a3f2c;
  margin: 0 0 18px;
}
.ld-stat-line strong { color: #a4342a; font-size: 20px; padding: 0 2px; }

.ld-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: #6d5637;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.ld-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #a4342a;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: 1px;
}

.ld-query-row {
  display: flex;
  gap: 10px;
}
.ld-query-row input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  padding: 10px 14px;
  border: 1px solid #cdbd94;
  border-radius: 10px;
  background: #fffdf6;
  color: #3b3226;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ld-query-row input:focus {
  border-color: #a4342a;
  box-shadow: 0 0 0 3px rgba(164, 52, 42, 0.14);
}

.ld-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #8a7f6a;
}
.ld-sample {
  font-size: 12.5px;
  padding: 4px 12px;
  border: 1px solid #d5c69d;
  border-radius: 999px;
  background: #fffdf6;
  color: #6d5637;
  cursor: pointer;
  transition: all 0.15s;
}
.ld-sample:hover {
  border-color: #a4342a;
  color: #a4342a;
  background: #fbf3e4;
}

.ld-error {
  margin: 10px 0 0;
  font-size: 14px;
  color: #b91c1c;
}

/* ── 年份查询结果 ── */
.ld-yr-head {
  margin: 14px 0 8px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 16px;
  color: #4a3f2c;
}
.ld-yr-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: #fffdf6;
  border: 1px solid #e4d9bf;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.ld-yr-name {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 19px;
  font-weight: 700;
  color: #3b3226;
}
.ld-yr-range { font-size: 13px; color: #8a7f6a; }
.ld-yr-chips { font-size: 12.5px; color: #9c7c1d; flex-basis: 100%; }
.ld-yr-go { margin-left: auto; }
.ld-yr-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #fffdf6;
  border: 1px dashed #cdbd94;
  border-radius: 10px;
  font-size: 14px;
  color: #5a4f3c;
  line-height: 1.8;
}

/* ══════════ 时间轴 ══════════ */
.ld-tl-block { margin-top: 26px; }
.ld-tl-title {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 20px;
  color: #6d5637;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 4px solid #a4342a;
  line-height: 1.3;
}
.ld-tl-scroll {
  overflow-x: auto;
  padding: 4px 2px 2px;
  -webkit-overflow-scrolling: touch;
}
.ld-timeline {
  position: relative;
  min-width: 1000px;
  height: 46px;
}
.ld-tl-bar {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, #ece2c6 0 1px, transparent 1px 100%);
  background-size: 10% 100%;
  border-radius: 6px;
}
.ld-tl-seg {
  position: absolute;
  top: 7px;
  height: 32px;
  min-width: 3px;
  border: none;
  border-right: 1px solid rgba(255, 253, 246, 0.9);
  border-radius: 3px 0 0 3px;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: filter 0.15s, transform 0.15s;
}
.ld-tl-seg:last-child { border-radius: 0 3px 3px 0; border-right: none; }
.ld-tl-seg:hover { filter: brightness(1.12); transform: translateY(-2px); z-index: 2; }
.ld-tl-seg span {
  display: block;
  font-size: 12px;
  line-height: 32px;
  color: #fffdf6;
  white-space: nowrap;
  text-align: center;
  padding: 0 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.ld-tl-axis {
  position: relative;
  min-width: 1000px;
  height: 24px;
  margin-top: 4px;
}
.ld-tl-tick {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #8a7f6a;
  white-space: nowrap;
}
.ld-tl-tick::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 1px;
  height: 6px;
  background: #c9ba92;
}
.ld-tl-tick-end { transform: translateX(-100%); }
.ld-tl-tick-end::before { left: auto; right: 2px; }

.ld-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: #5a4f3c;
}
.ld-lg-item { display: inline-flex; align-items: center; gap: 6px; }
.ld-lg-item i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.ld-hint { margin: 10px 0 0; font-size: 12.5px; color: #9a8d72; }

/* ══════════ 朝代歌 ══════════ */
.ld-song {
  background: #f3ecd9;
  border: 1px solid #d8c9a3;
  border-radius: var(--border-radius, 12px);
  padding: 18px 16px;
  text-align: center;
  box-shadow: inset 0 0 24px rgba(107, 86, 55, 0.07);
}
.ld-song span {
  display: block;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 21px;
  letter-spacing: 3px;
  line-height: 2.1;
  color: #4a3f2c;
}
.ld-song-note {
  text-align: center;
  font-size: 13px;
  color: #9a8d72;
  margin: 12px 0 0;
}

/* ══════════ 朝代卡片 ══════════ */
.ld-catalog { margin-top: 6px; }
.ld-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
}
.ld-search-bar input {
  flex: 1;
  min-width: 220px;
  font-size: 15px;
  padding: 9px 14px;
  border: 1px solid #cdbd94;
  border-radius: 10px;
  background: #fffdf6;
  color: #3b3226;
  outline: none;
}
.ld-search-bar input:focus {
  border-color: #a4342a;
  box-shadow: 0 0 0 3px rgba(164, 52, 42, 0.14);
}
.ld-search-count { font-size: 13px; color: #8a7f6a; white-space: nowrap; }
.ld-empty {
  text-align: center;
  color: #8a7f6a;
  font-size: 14px;
  padding: 26px 0;
}

.ld-group { margin-top: 22px; }
.ld-group > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 22px;
  color: #4a3f2c;
}
.ld-group > h2 small {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #9a8d72;
}
.ld-group.hide { display: none; }
.ld-g-dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ld-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.ld-card {
  background: #fffdf6;
  border: 1px solid #e4d9bf;
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.ld-card:hover { box-shadow: 0 3px 12px rgba(107, 86, 55, 0.13); }
.ld-card.open { border-color: #d3b98a; background: #fffdf0; }
.ld-card.hide { display: none; }

@keyframes ldFlash {
  0%, 55% { box-shadow: 0 0 0 4px rgba(164, 52, 42, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(164, 52, 42, 0); }
}
.ld-card.ld-flash { animation: ldFlash 2s ease; }

.ld-card-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.ld-card-h h3 {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 19px;
  color: #3b3226;
  margin: 0;
}
.ld-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ld-range { font-size: 13px; color: #8a7f6a; }
.ld-chip {
  font-size: 12px;
  color: #9c7c1d;
  background: #f5ecd4;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.ld-toggle {
  margin-left: auto;
  font-size: 12px;
  color: #6d5637;
  background: transparent;
  border: 1px solid #cbb88a;
  border-radius: 8px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ld-toggle:hover { color: #a4342a; border-color: #a4342a; }

.ld-meta {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
}
.ld-meta > div { display: flex; }
.ld-meta dt {
  flex: 0 0 54px;
  font-size: 13px;
  color: #9a8d72;
}
.ld-meta dd {
  margin: 0;
  font-size: 13px;
  color: #4a3f2c;
  line-height: 1.65;
}

/* JS 可用时默认收起详情；无 JS 保持全部展开 */
.js .ld-card:not(.open) .ld-detail { display: none; }

.ld-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ddd0b0;
}
.ld-intro {
  font-size: 14px;
  line-height: 1.85;
  color: #5a4f3c;
  margin: 0 0 8px;
}
.ld-subchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.ld-subchip {
  font-size: 12px;
  color: #6d5637;
  background: #f5ecd4;
  border: 1px solid #e2d3a9;
  border-radius: 999px;
  padding: 2px 10px;
}
.ld-note {
  font-size: 13px;
  line-height: 1.8;
  color: #6b5b45;
  background: #f7f0dc;
  border-left: 3px solid #c9a227;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 8px;
}
.ld-note strong { color: #9c7c1d; margin-right: 8px; }
.ld-detail h4 {
  font-size: 13px;
  letter-spacing: 2px;
  color: #a4342a;
  margin: 12px 0 6px;
}
.ld-events {
  margin: 0;
  padding-left: 20px;
}
.ld-events li {
  font-size: 13px;
  line-height: 1.9;
  color: #5a4f3c;
}
.ld-figs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ld-figs span {
  font-size: 12px;
  color: #4a3f2c;
  background: #f5eeda;
  border: 1px solid #e2d3a9;
  border-radius: 999px;
  padding: 2px 11px;
}

/* ══════════ 朝代一览表 ══════════ */
.ld-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ld-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 13px;
}
.ld-table th {
  background: #6d5637;
  color: #fdf9ee;
  font-weight: 600;
  padding: 9px 10px;
  border: 1px solid #5d4a2e;
  white-space: nowrap;
  text-align: left;
}
.ld-table td {
  padding: 8px 10px;
  border: 1px solid #e7dcc0;
  color: #4a3f2c;
  line-height: 1.7;
  vertical-align: top;
}
.ld-table tbody tr:nth-child(odd) { background: #fbf7ec; }
.ld-table tbody tr:nth-child(even) { background: #fffdf6; }
.ld-table td:first-child { white-space: nowrap; }
.ld-table td .ld-dot { margin-right: 6px; vertical-align: 0; }
.ld-table a {
  color: #a4342a;
  text-decoration: none;
}
.ld-table a:hover { text-decoration: underline; }

/* ══════════ FAQ（页面私有，与 spider-robots 风格一致） ══════════ */
.faq-item {
  background: #fffdf6;
  border: 1px solid #e4d9bf;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.faq-item h3 {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 16px;
  color: #3b3226;
  margin: 0 0 8px;
}
.faq-item p {
  font-size: 14px;
  line-height: 1.85;
  color: #5a4f3c;
  margin: 0;
}

/* ══════════ 响应式 ══════════ */
@media (max-width: 640px) {
  .ld-tool { padding: 16px 14px 14px; }
  .ld-query-row { flex-direction: column; }
  .ld-query-row .btn { width: 100%; }
  .ld-song span { font-size: 17px; letter-spacing: 2px; }
  .ld-cards { grid-template-columns: 1fr; }
  .ld-yr-item { align-items: flex-start; }
  .ld-yr-go { margin-left: 0; }
  .ld-toggle { margin-left: 0; }
  .ld-stat-line { font-size: 15px; }
}
