:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --panel-alt: #fff;
  --border: #e5e8ef;
  --accent: #2f6fed;
  --accent-2: #5b8def;
  --accent-dark: #1d4ed8;
  --accent-rgb: 47, 111, 237;
  --title: #1a2332;
  --text: #2c3a4f;
  --muted: #6b778c;
  --shadow: 0 2px 12px rgba(26, 35, 50, 0.05);
  --chart-bg: #ffffff;
  --chart-text: #1a2332;
  --chart-muted: #6b778c;
  --chart-line: #e5e8ef;
  --table-head-from: #5b8def;
  --table-head-to: #2f6fed;
  --table-highlight: rgba(47, 111, 237, 0.1);
  --table-zebra: rgba(247, 248, 250, 0.9);
  --btn-from: #5b8def;
  --btn-to: #2f6fed;
  --btn-shadow: rgba(47, 111, 237, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.stars {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: -1;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: 2rem;
  padding: 0 0.7rem 0 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 237, 0.28);
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.link-back-arrow {
  font-size: 0.95rem;
  line-height: 1;
}

.link-back:hover {
  color: var(--accent-dark);
  border-color: rgba(47, 111, 237, 0.45);
  background: #f7f8fa;
}

.logo {
  margin-left: auto;
  text-align: right;
  min-width: 0;
}

.logo-glow {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 237, 0.28);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.liqi-main {
  width: 100%;
  max-width: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.form-area {
  max-width: 520px;
  margin: 0 auto;
  padding: 0.85rem 0.9rem 0.5rem;
}

.page-section-title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.liqi-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-area {
  width: 100%;
}

.result-area.has-result {
  background: transparent;
  border-top: none;
  padding: 0.5rem 0.35rem 1rem;
  padding-left: max(0.35rem, env(safe-area-inset-left));
  padding-right: max(0.35rem, env(safe-area-inset-right));
}

.result-area.has-result .empty-hint {
  display: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1rem 1.05rem;
  box-shadow: var(--shadow);
}

.field-card {
  margin: 0;
}

.form-panel {
  width: 100%;
}

.panel h2 {
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.field-block-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 0.85rem;
  letter-spacing: 0.04em;
}

.field-block-title::before {
  content: "";
  width: 3px;
  height: 0.95em;
  border-radius: 2px;
  background: var(--accent);
  flex: 0 0 auto;
}

.field-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.12);
  border-radius: 4px;
  vertical-align: middle;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.field-label-row label {
  margin-bottom: 0;
  color: var(--title);
  font-size: 0.82rem;
  font-weight: 700;
}

.needle-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #eef1f6;
  color: #7b8494;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.field-block {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border);
}

.field-block:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.field-row { margin-bottom: 0.75rem; }
.field-row:last-child { margin-bottom: 0; }
.field-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field-row label {
  display: block;
  font-size: 0.78rem;
  color: var(--chart-muted);
  margin-bottom: 0.25rem;
}

.field-row label .label-hint {
  font-weight: normal;
  color: var(--muted);
  margin-left: 0.15rem;
}

.field-row select,
.field-row input[type="text"],
.shan-sub-block > select {
  width: 100%;
  padding: 0.58rem 2rem 0.58rem 0.7rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field-row select:disabled {
  color: var(--title);
  font-weight: 600;
  background-color: #fafbfc;
  opacity: 1;
  cursor: default;
}

.shan-feng-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shan-feng-row select {
  flex: 1;
  min-width: 0;
}

.field-desc {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.shan-feng-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  min-height: 0;
}

.shan-feng-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.28rem 0.2rem 0.55rem;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.35;
}

.shan-feng-tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
}

.shan-feng-tag-x:hover,
.shan-feng-tag-x:focus {
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.22);
  outline: none;
}

.chao-xiang-display {
  padding: 0.5rem 0.65rem;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--title);
}

.checkbox-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.jian-fields.hidden { display: none; }

.zuoxiang-preview,
.shan-preview {
  display: inline-flex;
  align-items: center;
  margin: 0.35rem 0 0;
  padding: 0.22rem 0.7rem;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 0;
}

.zuoxiang-preview:empty,
.shan-preview:empty {
  display: none;
}

.shan-preview.small {
  font-size: 0.78rem;
}

.shan-sub-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.shan-sub-block .sub-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.jian-toggle-row.compact {
  margin-bottom: 0;
}

.jian-toggle-row.compact .checkbox-label {
  font-size: 0.72rem;
  line-height: 1.35;
}

.form-action {
  margin-top: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border);
}

.form-action .btn.primary {
  margin-top: 0;
}

.btn.primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.72rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(47, 111, 237, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn.primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28);
  transform: translateY(-1px);
}

.btn.primary:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.empty-hint {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--chart-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

.empty-hint .muted { font-size: 0.8rem; opacity: 0.85; }
.hidden { display: none !important; }

.result-wrap {
  width: 100%;
}

.result-area.has-result .result-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.result-area.has-result .summary-bar {
  padding: 0.85rem 0.75rem;
  margin: 0;
  background: var(--panel-alt);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  box-shadow: none;
  font-size: 0.85rem;
  line-height: 1.65;
}

@media (min-width: 769px) {
  .result-area.has-result .summary-bar {
    padding: 0.85rem 1.25rem;
  }
}

.summary-bar strong {
  color: var(--title);
  font-size: 0.92rem;
}

.summary-zuoxiang {
  color: var(--title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  margin-bottom: 0;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.summary-ai-btn.btn-realtime {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.32rem 0.85rem;
  border: 1px solid rgba(47, 111, 237, 0.32);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #5b8def, #2f6fed);
  box-shadow: 0 3px 10px rgba(47, 111, 237, 0.2);
  animation: realtime-breathe 2.8s ease-in-out infinite;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.summary-ai-btn .btn-realtime-glow {
  position: absolute;
  inset: -40%;
  z-index: 0;
  background: conic-gradient(from 180deg, transparent 0deg, rgba(255, 255, 255, 0.28) 40deg, transparent 80deg);
  opacity: 0.4;
  animation: realtime-spin 4.2s linear infinite;
  pointer-events: none;
}

.summary-ai-btn .btn-realtime-text {
  position: relative;
  z-index: 1;
}

.summary-ai-btn.btn-realtime:after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  z-index: 2;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.38) 50%, transparent 80%);
  transform: skewX(-18deg);
  animation: realtime-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.summary-ai-btn.btn-realtime:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 6px 14px rgba(47, 111, 237, 0.22);
  animation: none;
}

.summary-ai-btn.btn-realtime:disabled {
  opacity: 0.7;
  animation: none;
}

@keyframes realtime-breathe {
  0%, 100% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 3px 10px rgba(47, 111, 237, 0.1); transform: scale(1); }
  50% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 5px 12px rgba(47, 111, 237, 0.2); transform: scale(1.02); }
}

@keyframes realtime-shine {
  0%, 55% { left: -120%; }
  80%, 100% { left: 140%; }
}

@keyframes realtime-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .summary-ai-btn.btn-realtime,
  .summary-ai-btn .btn-realtime-glow,
  .summary-ai-btn.btn-realtime:after {
    animation: none;
  }
}

.summary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(176, 140, 90, 0.28);
  border-radius: 10px;
  background: #fff;
}

.summary-fact-table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  table-layout: fixed;
}

.summary-fact-table th,
.summary-fact-table td {
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(176, 140, 90, 0.28);
  text-align: left;
  vertical-align: middle;
  font-size: 0.82rem;
  line-height: 1.45;
}

.summary-fact-table thead th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(176, 140, 90, 0.08);
}

.summary-fact-table tbody tr:last-child td {
  border-bottom: 1px solid rgba(176, 140, 90, 0.28);
}

.summary-fact-table .col-fact-label {
  width: 3.4em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.summary-fact-table .col-fact-value {
  width: 38%;
  color: var(--title);
  font-weight: 700;
  word-break: break-word;
}

.summary-fact-table .col-fact-tags {
  width: auto;
}

.summary-fact-table tr.is-ok .col-fact-value { color: #1f6b4c; }
.summary-fact-table tr.is-bad .col-fact-value { color: #a1382c; }
.summary-fact-table tr.is-resolved .col-fact-value { color: #8a5a14; }

.summary-fact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
}

.summary-fact-none {
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-fact-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.06rem 0.3rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-fact-tag.ok {
  color: #1f6b4c;
  background: rgba(46, 125, 90, 0.12);
}

.summary-fact-tag.bad {
  color: #a1382c;
  background: rgba(176, 70, 58, 0.12);
}

.summary-fact-tag.resolved {
  color: #8a5a14;
  background: rgba(180, 120, 40, 0.14);
}

.summary-fact-tag.ping,
.summary-fact-tag.neutral {
  color: #6b6256;
  background: rgba(120, 110, 95, 0.1);
}

.summary-empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-detail {
  color: var(--chart-muted);
  font-size: 0.82rem;
}

@media (max-width: 520px) {
  .summary-fact-table th:nth-child(3),
  .summary-fact-table td.col-fact-tags {
    min-width: 9.5rem;
  }

  .summary-fact-table .col-fact-value {
    width: 34%;
  }
}

.result-area.has-result .result-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 769px) {
  .result-area.has-result .result-table-head {
    padding: 0.6rem 1.25rem;
  }
}

.result-table-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-dark);
  letter-spacing: 0.06em;
}

.result-table-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.result-area.has-result .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  max-height: none;
  border: none;
  border-radius: 0 0 14px 14px;
  background: #fff;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-scroll-hint {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.35rem 0.65rem 0.25rem;
  text-align: right;
}

.liqi-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  border: 0;
}

.liqi-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.liqi-table thead th {
  background: linear-gradient(180deg, var(--table-head-from) 0%, var(--table-head-to) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-top: 0;
}

.liqi-table thead th:first-child {
  border-left: 0;
}

.liqi-table thead th:last-child {
  border-right: 0;
}

.liqi-table tbody td {
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--chart-line);
  text-align: center;
  vertical-align: middle;
  line-height: 1.55;
}

.liqi-table tbody td:first-child {
  border-left: 0;
}

.liqi-table tbody td:last-child {
  border-right: 0;
}

.liqi-table tbody tr:last-child td {
  border-bottom: 0;
}

.liqi-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.liqi-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.liqi-table tbody tr:nth-child(even) td {
  background: var(--table-zebra);
}

.liqi-table tbody tr:hover td {
  background: rgba(var(--accent-rgb), 0.06);
}

.liqi-table .col-idx {
  width: 2.6em;
  min-width: 2.6em;
  color: var(--chart-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.liqi-table .col-name {
  min-width: 4.8em;
  font-weight: 600;
  color: #7a5c40;
  white-space: nowrap;
}

.liqi-table .col-status {
  min-width: 4.2em;
  white-space: nowrap;
}

.liqi-table .col-detail {
  min-width: 12rem;
  max-width: none;
  color: var(--text);
  white-space: nowrap;
  text-align: left;
}

.status-badge {
  display: inline-block;
  min-width: 2.5em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
}

.status-badge.ok {
  color: #2d6a4f;
  background: rgba(46, 139, 87, 0.14);
  border: 1px solid rgba(46, 139, 87, 0.25);
}

.status-badge.bad {
  color: #a93226;
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.22);
}

.status-badge.resolved {
  color: #2f6fed;
  background: rgba(47, 111, 237, 0.1);
  border: 1px solid rgba(47, 111, 237, 0.28);
}

.status-badge.ping {
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge.neutral {
  color: #666;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.liqi-table tbody tr.row-highlight td {
  background: var(--table-highlight);
}

.liqi-table tbody tr.row-highlight:hover td {
  background: rgba(var(--accent-rgb), 0.16);
}

.liqi-table tbody tr.row-highlight .col-name {
  color: var(--accent-dark);
}

.liqi-table tbody tr.row-highlight .col-idx {
  font-weight: 600;
  color: var(--accent);
}

.liqi-table tbody tr.row-highlight td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  padding: 0.65rem 1.2rem;
  background: rgba(51, 51, 51, 0.92);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 100;
}

@media (max-width: 768px) {
  .form-area { padding: 0.75rem 0.75rem 0.35rem; }
  .result-area.has-result {
    padding: 0.4rem 0.3rem 0.85rem;
    padding-left: max(0.3rem, env(safe-area-inset-left));
    padding-right: max(0.3rem, env(safe-area-inset-right));
  }
  .field-row.two-col { grid-template-columns: 1fr; }
  .result-area.has-result .summary-bar,
  .result-area.has-result .result-table-head {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .liqi-table {
    font-size: 0.86rem;
  }
  .liqi-table thead th {
    font-size: 0.76rem;
    padding: 0.65rem 0.35rem;
  }
  .liqi-table tbody td {
    padding: 0.6rem 0.35rem;
  }
  .liqi-table .col-detail {
    min-width: 14rem;
  }
  .status-badge {
    padding: 0.12rem 0.3rem;
    font-size: 0.72rem;
    min-width: 0;
  }
}

.col-name-click .liqi-name-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent-dark);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

.col-name-click .liqi-name-btn:hover {
  color: var(--title);
}

.col-name-click .liqi-name-btn:focus {
  outline: none;
}

.col-name-click .liqi-name-btn:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
  border-radius: 2px;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .result-wrap,
body.modal-open .form-area,
body.modal-open .top-bar {
  pointer-events: none;
  user-select: none;
}

body.modal-open .liqi-table tbody tr:hover td,
body.modal-open .liqi-table tbody tr.row-highlight:hover td {
  background: inherit;
}

body.modal-open .liqi-table tbody tr:nth-child(even):not(.row-highlight) td {
  background: var(--table-zebra);
}

body.modal-open .liqi-table tbody tr:nth-child(odd):not(.row-highlight) td {
  background: #fff;
}

body.modal-open .liqi-table tbody tr.row-highlight td {
  background: var(--table-highlight);
}

body.modal-open .liqi-table thead {
  position: relative;
  z-index: auto;
}

.liqi-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.52);
  -webkit-tap-highlight-color: transparent;
}

.liqi-modal.hidden {
  display: none;
}

.liqi-modal-panel {
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.liqi-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.1), rgba(26, 35, 50, 0.04));
  color: var(--title);
}

.liqi-modal-head h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--title);
}

.liqi-modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.liqi-modal-close:hover {
  color: var(--title);
  background: rgba(var(--accent-rgb), 0.12);
}

.liqi-modal-body {
  padding: 0.85rem 1rem 1rem;
}

.theory-section + .theory-section {
  margin-top: 0.65rem;
}

.theory-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.theory-verse {
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  font-size: 1.05rem;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--title);
  margin-bottom: 0.85rem;
  text-align: left;
}

.theory-note {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 0.5rem;
  text-align: left;
}

.theory-highlight {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.65;
  font-weight: 600;
  color: #7a4f00;
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.14), rgba(47, 111, 237, 0.08));
  border: 1px solid rgba(201, 162, 39, 0.35);
  text-align: left;
}

.theory-case {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.6;
}

.theory-case p + p {
  margin-top: 0.45rem;
}

.liqi-modal-panel-wide {
  width: min(880px, 100%);
}

.theory-table-wrap {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.theory-table-wrap:has(.theory-pair-table) {
  overflow: visible;
  display: table;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.theory-star-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 0;
}

.theory-star-table.theory-pair-table {
  width: auto;
  font-size: 0.86rem;
}

.theory-pair-table thead th {
  padding: 0.32rem 0.9rem;
  text-align: center;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #1d4ed8, #5b8def);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.theory-pair-table tbody td {
  padding: 0.26rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.theory-tianding-table thead th.col-zuo-xiang-h {
  background: linear-gradient(135deg, #1d4ed8, #5b8def);
}

.theory-tianding-table .col-zuo-xiang {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  color: var(--accent-dark);
  padding-left: 0.65rem;
  padding-right: 0.5rem;
}

.theory-tianding-table tbody td:not(.col-zuo-xiang) {
  text-align: center;
}

.theory-table-note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}

.theory-table-wrap:has(.theory-tianding-table) {
  overflow: visible;
  width: 100%;
  max-width: 100%;
}

.theory-star-table:not(.theory-pair-table) {
  min-width: 340px;
}

.theory-star-table thead th {
  padding: 0.42rem 0.35rem;
  text-align: center;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
}

.theory-star-table thead th.col-zuo-h {
  background: linear-gradient(135deg, #1d4ed8, #5b8def);
}

.theory-star-table thead th.col-zhong-h {
  background: linear-gradient(135deg, #c06510, #e67e22);
}

.theory-star-table thead th.col-huo-h {
  background: linear-gradient(135deg, #a83232, #c41e3a);
}

.theory-star-table tbody td {
  padding: 0.3rem 0.32rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.theory-star-table tbody tr:nth-child(even) td {
  background: rgba(255, 248, 235, 0.55);
}

.theory-star-table tbody tr:hover td {
  background: rgba(201, 162, 39, 0.1);
}

.theory-star-table tbody tr.row-forward td {
  background: rgba(201, 162, 39, 0.12);
}

.theory-star-table .col-zuo {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.theory-star-table .star-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
}

.theory-star-table .star-tag {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.25;
  border: 1px solid transparent;
}

.theory-star-table .star-tag-zhong {
  color: #2c3a4f;
  background: rgba(230, 126, 34, 0.12);
  border-color: rgba(230, 126, 34, 0.28);
}

.theory-star-table .star-tag-huo {
  color: #9b2335;
  background: rgba(196, 30, 58, 0.1);
  border-color: rgba(196, 30, 58, 0.22);
}

.theory-star-table .forward-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #1d4ed8;
  background: rgba(201, 162, 39, 0.18);
  vertical-align: middle;
}

body.loader-open {
  overflow: hidden;
}

/* —— 理气加载动画（与择日同款） —— */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.loader-core {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  margin-bottom: 1.5rem;
}

.orbit {
  position: absolute;
  inset: 0;
  animation: liqi-spin 12s linear infinite;
}
.orbit-inner {
  inset: 28px;
  animation-direction: reverse;
  animation-duration: 18s;
}

.orbit .stem,
.orbit .branch {
  position: absolute;
  left: 50%;
  top: 0;
  transform-origin: 50% 110px;
  font-size: 0.85rem;
  color: var(--accent-2);
  width: 1.2em;
  margin-left: -0.6em;
  text-align: center;
}
.orbit-inner .branch {
  transform-origin: 50% 82px;
  color: var(--title);
  font-size: 0.8rem;
}

.orbit .stem:nth-child(1) { transform: rotate(0deg); }
.orbit .stem:nth-child(2) { transform: rotate(36deg); }
.orbit .stem:nth-child(3) { transform: rotate(72deg); }
.orbit .stem:nth-child(4) { transform: rotate(108deg); }
.orbit .stem:nth-child(5) { transform: rotate(144deg); }
.orbit .stem:nth-child(6) { transform: rotate(180deg); }
.orbit .stem:nth-child(7) { transform: rotate(216deg); }
.orbit .stem:nth-child(8) { transform: rotate(252deg); }
.orbit .stem:nth-child(9) { transform: rotate(288deg); }
.orbit .stem:nth-child(10) { transform: rotate(324deg); }

.orbit-inner .branch:nth-child(1) { transform: rotate(0deg); }
.orbit-inner .branch:nth-child(2) { transform: rotate(30deg); }
.orbit-inner .branch:nth-child(3) { transform: rotate(60deg); }
.orbit-inner .branch:nth-child(4) { transform: rotate(90deg); }
.orbit-inner .branch:nth-child(5) { transform: rotate(120deg); }
.orbit-inner .branch:nth-child(6) { transform: rotate(150deg); }
.orbit-inner .branch:nth-child(7) { transform: rotate(180deg); }
.orbit-inner .branch:nth-child(8) { transform: rotate(210deg); }
.orbit-inner .branch:nth-child(9) { transform: rotate(240deg); }
.orbit-inner .branch:nth-child(10) { transform: rotate(270deg); }
.orbit-inner .branch:nth-child(11) { transform: rotate(300deg); }
.orbit-inner .branch:nth-child(12) { transform: rotate(330deg); }

.loader-center {
  position: absolute;
  inset: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bagua-ring {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(var(--accent-rgb), 0.35);
  border-radius: 50%;
  animation: liqi-pulse 2s ease-in-out infinite;
}
.bagua-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(139, 105, 20, 0.25);
  border-radius: 50%;
}

.loader-icon {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  animation: liqi-glow 1.5s ease-in-out infinite alternate;
  z-index: 1;
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: liqi-scan 2.2s ease-in-out infinite;
  top: 50%;
}

.loader-title {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  letter-spacing: 0.35em;
  color: var(--title);
  margin-bottom: 0.5rem;
}

.loader-status {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.4em;
  text-align: center;
  padding: 0 1rem;
  max-width: min(520px, 92vw);
  line-height: 1.5;
}

.loader-percent {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.loader-progress {
  position: relative;
  z-index: 1;
  width: min(320px, 80vw);
  height: 3px;
  background: rgba(var(--accent-rgb), 0.15);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}
.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--title));
  border-radius: 2px;
  transition: width 0.4s ease;
}

@keyframes liqi-spin { to { transform: rotate(360deg); } }
@keyframes liqi-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}
@keyframes liqi-glow {
  from { filter: none; }
  to { filter: drop-shadow(0 0 10px rgba(47, 111, 237, 0.45)); }
}
@keyframes liqi-scan {
  0%, 100% { top: 15%; opacity: 0.3; }
  50% { top: 85%; opacity: 1; }
}

@media (max-width: 480px) {
  .loader-core {
    width: 190px;
    height: 190px;
    margin-bottom: 1.1rem;
  }
  .orbit .stem,
  .orbit .branch {
    transform-origin: 50% 95px;
    font-size: 0.78rem;
  }
  .orbit-inner .branch {
    transform-origin: 50% 70px;
  }
  .loader-center {
    inset: 46px;
  }
  .loader-icon {
    font-size: 1.65rem;
  }
  .loader-title {
    font-size: 1rem;
    letter-spacing: 0.25em;
  }
}

.interpret-modal{position:fixed;z-index:140;inset:0;display:grid;place-items:center;padding:1rem}.interpret-modal.hidden{display:none}.interpret-backdrop{position:absolute;inset:0;background:rgba(26,35,50,.32);backdrop-filter:blur(3px)}.interpret-panel{position:relative;display:flex;flex-direction:column;width:min(920px,100%);max-height:min(88vh,860px);overflow:hidden;border:1px solid #e5e8ef;border-radius:12px;background:#ffffff;box-shadow:0 22px 58px rgba(26,35,50,.16)}.interpret-header{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.85rem 1rem;border-bottom:1px solid #e5e8ef;background:#f7f8fa}.interpret-header-text{min-width:0;display:flex;flex-direction:column;gap:.12rem}.interpret-header h2{margin:0;color:var(--title);font-size:1.15rem;line-height:1.25}.interpret-disclaimer{margin:0;color:#6b778c;font-size:.66rem;line-height:1.35}.interpret-close{width:34px;height:34px;flex:0 0 auto;border:1px solid #e5e8ef;border-radius:50%;color:var(--accent-dark);background:#fff;font-size:1.3rem;cursor:pointer}.interpret-body-shell{position:relative;flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.interpret-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding:1.05rem 1.1rem 1.3rem;background:radial-gradient(circle at top right,rgba(47,111,237,.08),transparent 28%),linear-gradient(180deg,#fffdf8,#f6efe4)}.interpret-loading{display:grid;min-height:240px;place-content:center;justify-items:center;gap:.45rem;padding:1.5rem;text-align:center;color:#7a6a56}.interpret-loader{width:34px;height:34px;border:3px solid #ead9b8;border-top-color:var(--accent);border-radius:50%;animation:interpret-spin .78s linear infinite}.interpret-loading strong{color:var(--title);font-size:.95rem}.interpret-loading p{margin:0;color:#8b7a64;font-size:.72rem;line-height:1.6}.interpret-loading.is-error .interpret-loader{display:none}.interpret-loading.is-error strong{color:#a14d4d}@keyframes interpret-spin{to{transform:rotate(360deg)}}.ai-scroll-latest{position:absolute;right:1rem;bottom:1.05rem;z-index:5;width:2.75rem;height:2.75rem;border:0;border-radius:50%;background:linear-gradient(145deg,#5b8def,#2f6fed);color:#fff;box-shadow:0 6px 18px rgba(47,111,237,.28);cursor:pointer;display:grid;place-items:center;animation:ai-scroll-pulse 1.8s ease-in-out infinite}.ai-scroll-latest-icon{width:1.2rem;height:1.2rem}.ai-scroll-latest.hidden{display:none}@keyframes ai-scroll-pulse{0%,100%{transform:translateY(0)}50%{transform:translateY(3px)}}.ai-interpret-hero{margin:0 0 1rem;padding:1rem 1.05rem;border:1px solid #e5e8ef;border-radius:14px;background:linear-gradient(135deg,rgba(47,111,237,.12),#fff 55%,#fff8ea)}.ai-interpret-eyebrow{display:inline-block;color:var(--accent-dark);font-size:.66rem;font-weight:700;letter-spacing:.16em}.ai-interpret-hero strong{display:block;margin:.28rem 0 .35rem;color:var(--title);font-size:1.12rem}.ai-interpret-hero p{margin:0;color:#8b7a64;font-size:.78rem;line-height:1.6}.ai-interpret-content{display:grid;gap:.85rem}.ai-section-card{overflow:hidden;border:1px solid #e5e8ef;border-radius:12px;background:#fff}.ai-section-head{display:flex;align-items:center;gap:.65rem;padding:.72rem .85rem;border-bottom:1px solid #e5e8ef;background:#f7f8fa}.ai-section-index{display:grid;place-items:center;width:1.7rem;height:1.7rem;border-radius:50%;color:#fff;background:linear-gradient(145deg,#5b8def,#2f6fed);font-size:.68rem;font-weight:700}.ai-section-title{margin:0;color:var(--title);font-size:1.02rem}.ai-section-body{padding:.75rem .85rem .9rem;display:grid;gap:.42rem}.ai-detail-line{display:flex;gap:.55rem;align-items:flex-start;padding:.55rem .65rem;border:1px solid rgba(47,111,237,.14);border-radius:8px;background:#fffdf8;font-size:.88rem;line-height:1.72;color:#3d4f68}.ai-detail-line b{flex:0 0 auto;min-width:4.6em;color:var(--accent-dark)}.ai-bullet,.ai-paragraph{margin:0;color:#3d4f68;font-size:.88rem;line-height:1.72}.ai-spacer{height:.2rem}.ai-hr{border:0;border-top:1px solid #e5e8ef;margin:.35rem 0}.ai-interpret-output.is-streaming .ai-interpret-content:after{content:"";display:inline-block;width:.52rem;height:1em;margin-left:.18rem;vertical-align:-.1em;background:var(--accent);animation:ai-caret .9s steps(1) infinite}@keyframes ai-caret{50%{opacity:0}}@media(max-width:860px){.interpret-modal{align-items:end;padding:0}.interpret-panel{width:100%;max-height:92vh;border-radius:14px 14px 0 0}.summary-ai-btn.btn-realtime{font-size:.7rem;padding:.24rem .62rem}}

/* ============================================================
   布局与视觉优化（2026-09-10）
   1) 宽屏双栏：左侧表单固定 / 右侧结果自适应，充分利用宽度
   2) 卡片与表单控件交互反馈
   3) 空状态卡片化、结果区容器收拢
   ============================================================ */

/* ---- 1. 宽屏双栏布局 ---- */
@media (min-width: 960px) {
  .liqi-main {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2.5rem;
  }

  .form-area {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .result-area {
    min-width: 0;
  }

  .result-area.has-result {
    padding: 0;
  }

  .page-section-title {
    text-align: left;
    margin: 0 0 1rem 0.15rem;
    letter-spacing: 0.08em;
  }
}

@media (min-width: 1280px) {
  .liqi-main {
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.25rem 1.75rem 2.5rem;
  }
}

@media (min-width: 1500px) {
  .liqi-main {
    grid-template-columns: 500px minmax(0, 1fr);
  }
}

/* ---- 2. 卡片视觉与交互 ---- */
.panel.field-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 769px) {
  .panel.field-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 6px 22px rgba(26, 35, 50, 0.08);
  }
}

.field-block-title {
  font-size: 0.95rem;
}

.field-block-title::before {
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
}

/* ---- 3. 表单控件交互反馈 ---- */
.field-row select:hover,
.field-row input[type="text"]:hover,
.shan-sub-block > select:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
}

.field-row select:focus,
.field-row input[type="text"]:focus,
.shan-sub-block > select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.checkbox-label:hover {
  color: var(--title);
}

/* ---- 4. 空状态卡片化 ---- */
.empty-hint {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 2.25rem 1.5rem;
}

.empty-hint p:first-child {
  margin: 0 0 0.5rem;
  color: var(--title);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---- 5. 宽屏下结果区收拢为卡片 ---- */
@media (min-width: 960px) {
  .result-area.has-result .result-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
}
