.liuren-cases-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 0 48px;
}

.liuren-cases-tabs {
  display: flex;
  gap: 6px;
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 0 14px;
  padding: 2px 4px;
  border-radius: 10px;
  background: rgba(32, 35, 33, 0.06);
}

.liuren-cases-tab {
  flex: 1;
  border: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #68706a);
  min-height: 36px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.liuren-cases-tab.is-active {
  background: var(--cinnabar, #b74635);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb, 183, 70, 53), 0.24);
}

.liuren-cases-panel {
  position: relative;
  z-index: 0;
  margin: 0;
  border: 1px solid var(--line, #ddd6c7);
  border-radius: var(--radius-lg, 18px);
  background: color-mix(in srgb, var(--surface, #fffdf7) 88%, transparent);
  padding: 12px;
}

.liuren-cases-status {
  padding: 24px;
  text-align: center;
  color: var(--muted, #68706a);
}

.liuren-cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.liuren-case-card {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--line, #ddd6c7);
  border-radius: var(--radius-lg, 18px);
  background: var(--surface, #fffdf7);
  padding: 0;
  color: var(--ink, #202321);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.liuren-case-card:hover,
.liuren-case-card:focus-visible {
  border-color: color-mix(in srgb, var(--cinnabar, #b74635) 55%, var(--line, #ddd6c7));
  background: color-mix(in srgb, var(--surface, #fffdf7) 94%, var(--cinnabar, #b74635));
  outline: none;
}

.liuren-case-table {
  display: block;
  min-width: 0;
}

.liuren-case-row {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--line, #ddd6c7);
}

.liuren-case-row:last-child {
  border-bottom: 0;
}

.liuren-case-label {
  padding: 8px 6px;
  color: var(--cinnabar, #b74635);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.liuren-case-value {
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
  color: var(--ink, #202321);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liuren-cases-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.liuren-cases-pager button {
  border: 1px solid var(--line, #ddd6c7);
  border-radius: 8px;
  background: var(--surface, #fffdf7);
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.liuren-cases-pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.liuren-cases-page-info {
  color: var(--muted, #68706a);
  font-size: 13px;
}

.liuren-case-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  visibility: hidden;
  overflow-x: hidden;
  overflow-y: auto;
  background: inherit;
  pointer-events: none;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
}

.liuren-case-result-overlay.is-ready {
  visibility: visible;
  pointer-events: auto;
}

.liuren-case-result-overlay.is-loading {
  visibility: visible;
  pointer-events: auto;
}

.liuren-case-result-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 60px;
  margin: 0;
  padding: 28px clamp(18px, 4vw, 56px) 0;
  background: transparent;
}

.liuren-case-result-summary-mount {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  padding: 12px 16px 4px;
  background: transparent;
}

.liuren-case-result-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 4px;
  padding: 18px 20px;
  border: 1px solid rgba(var(--accent-rgb, 185, 65, 50), 0.18);
  border-radius: var(--card-radius, 18px);
  background: var(--surface, #fffdf7);
  color: var(--ink, #202321);
  box-shadow: var(--panel-shadow, 0 10px 28px rgba(33, 36, 31, 0.10), 0 1px 2px rgba(33, 36, 31, 0.07));
}

.liuren-case-result-loading strong {
  color: var(--cinnabar, #b94132);
  font-size: 15px;
  white-space: nowrap;
}

.liuren-case-result-loading > span:last-child {
  min-width: 0;
  color: var(--muted, #68706a);
  font-size: 13px;
  line-height: 1.5;
}

.liuren-case-result-loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  box-sizing: border-box;
  border: 2px solid rgba(var(--accent-rgb, 185, 65, 50), 0.20);
  border-top-color: var(--cinnabar, #b94132);
  border-radius: 50%;
  animation: liuren-case-result-spin 0.8s linear infinite;
}

@keyframes liuren-case-result-spin {
  to { transform: rotate(360deg); }
}

.liuren-case-result-summary {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(32, 35, 33, 0.12);
  border-radius: var(--card-radius, 18px);
  background: var(--surface, #fffdf7);
  color: var(--ink, #202321);
  box-shadow: var(--panel-shadow, 0 10px 28px rgba(33, 36, 31, 0.10), 0 1px 2px rgba(33, 36, 31, 0.07));
  box-sizing: border-box;
}

.liuren-case-result-summary .pp-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.liuren-case-result-summary .pp-info-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  min-width: 0;
}

.liuren-case-result-summary .pp-info-label {
  flex: 0 0 auto;
  min-width: 72px;
  color: var(--muted, #8a8577);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.liuren-case-result-summary .pp-info-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink, #202321);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liuren-case-result-summary .pp-info-value-multi {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.liuren-case-result-summary .pp-info-section {
  margin-top: 10px;
}

.liuren-case-result-summary .pp-info-section-title {
  margin-bottom: 8px;
  color: var(--muted, #8a8577);
  font-size: 13px;
  font-weight: 600;
}

.liuren-case-result-summary .pp-pill-row {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 6px;
}

.liuren-case-result-summary .pp-pill-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.liuren-case-result-summary .pp-pill-row-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.liuren-case-result-summary .pp-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 4px;
  overflow: hidden;
  border: 1px solid rgba(32, 35, 33, 0.08);
  border-radius: 8px;
  background: var(--surface-strong, #fffdf7);
  box-shadow: 0 2px 8px rgba(33, 36, 31, 0.06);
}

.liuren-case-result-summary .pp-pill-label {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted, #8a8577);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liuren-case-result-summary .pp-pill-gz {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink, #202321);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liuren-case-result-summary .pp-pill-gz .wxmu,
.liuren-case-result-summary .pp-info-value .wxmu { color: #00a879 !important; }
.liuren-case-result-summary .pp-pill-gz .wxhuo,
.liuren-case-result-summary .pp-info-value .wxhuo { color: #ed4d49 !important; }
.liuren-case-result-summary .pp-pill-gz .wxtu,
.liuren-case-result-summary .pp-info-value .wxtu { color: #a64b00 !important; }
.liuren-case-result-summary .pp-pill-gz .wxjin,
.liuren-case-result-summary .pp-info-value .wxjin { color: #ffa500 !important; }
.liuren-case-result-summary .pp-pill-gz .wxshui,
.liuren-case-result-summary .pp-info-value .wxshui { color: #0074e4 !important; }

.liuren-case-result-back {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line, #ddd6c7);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--ink, #202321);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.liuren-case-result-back:hover {
  border-color: var(--cinnabar, #b74635);
  color: var(--cinnabar, #b74635);
}

.liuren-case-result-heading {
  min-width: 0;
}

.liuren-case-result-heading h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.liuren-case-result-heading h2 {
  color: var(--ink, #202321);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.18;
}

.liuren-case-result-frame {
  display: block;
  width: calc(100% - 32px);
  height: calc(100dvh - 92px);
  min-height: 0;
  flex: 0 0 auto;
  margin: 12px 16px 24px;
  border: 0;
  border-radius: var(--card-radius, 18px);
  background: var(--app-panel-surface, #faf7ee);
  box-shadow: var(--panel-shadow, 0 10px 28px rgba(33, 36, 31, 0.10), 0 1px 2px rgba(33, 36, 31, 0.07));
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

.liuren-case-result-overlay.is-loading .liuren-case-result-frame {
  visibility: hidden;
}

/* Keep the title and return control available while the board renders. */
.liuren-case-result-overlay.is-loading .liuren-case-result-summary-mount {
  visibility: hidden !important;
}

.liuren-case-result-overlay.is-ready .liuren-case-result-frame {
  visibility: visible;
}

body.liuren-case-result-open {
  overflow: hidden;
}

/* Keep the iOS standalone status area and the page header on the same light
   surface. This page used to leave the safe-area strip to the WebView default
   (black on iOS), unlike the other top-level pages. */
html,
body[data-page="liuren-cases"] {
  background-color: var(--bg, #f4f3ee);
}

body[data-page="liuren-cases"] .topbar {
  padding-top: max(0px, env(safe-area-inset-top));
}

.mingli-liuren-embed {
  max-width: none;
  margin: 0;
  padding: 0;
}

.mingli-liuren-embed .liuren-cases-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.mingli-cases-panel .liuren-case-card {
  border-color: rgba(32,35,33,.08);
  background: linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,249,241,.92)),radial-gradient(circle at 88% 18%,rgba(var(--accent-rgb),.12),transparent 28%);
  box-shadow: 0 10px 28px rgba(33,36,31,.08);
}

.liuren-cases-status[hidden], .liuren-cases-pager[hidden], .liuren-cases-grid[hidden] { display: none; }

@media (max-width: 640px) {
  .liuren-cases-wrap {
    padding-inline: 0;
  }

  .liuren-case-row {
    grid-template-columns: 52px minmax(0,1fr);
  }

  .liuren-cases-panel {
    padding: 10px;
  }

  .liuren-case-result-header {
    min-height: 60px;
    gap: 12px;
    padding: 14px 14px 0;
  }

  .liuren-case-result-summary-mount {
    padding: 8px 10px 2px;
  }

  .liuren-case-result-summary {
    padding: 14px;
  }

  .liuren-case-result-summary .pp-pill-row-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .liuren-case-result-summary .pp-pill-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .liuren-case-result-summary .pp-pill {
    padding: 4px 2px;
  }

  .liuren-case-result-summary .pp-pill-label {
    font-size: 9px;
  }

  .liuren-case-result-summary .pp-pill-gz {
    font-size: 11px;
  }

  .liuren-case-result-frame {
    width: calc(100% - 20px);
    height: calc(100dvh - 78px);
    min-height: 560px;
    margin: 10px 10px 18px;
  }
}

/* 案例面板恢复自然流：面板头部、分类轨道和案例卡片一起滚动。 */
body[data-page="liuren-cases"] .liuren-cases-tabs-sticky-shell {
  position: static;
  z-index: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  overflow: visible;
}

body[data-page="liuren-cases"] .liuren-cases-tabs {
  position: static;
  top: auto;
  margin-top: 0;
  margin-bottom: 14px;
  background: rgba(32, 35, 33, 0.06);
  box-shadow: none;
}
