/* ======================
   SENTENCE.CSS — AI 量刑预估工具页
   ====================== */

/* ---------- 页头 ---------- */
.page-hero { padding-bottom: 28px; }
.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-body);
}
.hero-meta-row .ico-check { color: #16a34a; margin-right: 4px; }
.hero-meta-row .ico-check::before { content: '✓'; font-weight: 700; }

/* 页头醒目边界说明 */
.sentence-boundary {
  margin-top: 18px;
  padding: 16px 18px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 5px solid #ea580c;
  border-radius: 10px;
  color: #9a3412;
  font-size: 14px;
  line-height: 1.75;
}
.sentence-boundary strong { color: #7c2d12; display: block; margin-bottom: 8px; font-size: 15px; }
.sentence-boundary ul { margin: 0; padding-left: 1.2em; }
.sentence-boundary li { margin: 4px 0; }

/* ---------- 两栏布局 ---------- */
.sentence-wrap { padding-top: 10px; padding-bottom: 20px; }
.sentence-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 960px) {
  .sentence-grid { grid-template-columns: 1fr; }
}

/* 通用表单元素：复用全局 .form-control/.form-group/.form-row，再加少量补丁 */
.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- 左：表单卡片 ---------- */
.sentence-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 20px;
}
.sfc-head h2 { font-size: 19px; margin-bottom: 6px; color: var(--text-title); }
.sfc-tip { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 18px; }
.sfc-tip br { display: block; content: ''; margin-bottom: 4px; }

.sentence-form-card .req { color: #dc2626; }

#sentenceSubmit {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}
.btn-loading { font-size: 14px; opacity: 0.9; }
button:disabled { cursor: not-allowed; opacity: 0.75; }

.sfc-compliance {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.7;
}

.sfc-plots {
  margin-top: 18px;
  padding: 14px 14px 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
}
.sfc-plots-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 12px;
}
.sfc-plots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
@media (max-width: 640px) {
  .sfc-plots-grid { grid-template-columns: 1fr; }
}
.sfc-plot-item {
  margin-bottom: 0;
}
.sfc-plot-item[hidden] {
  display: none !important;
}
.sfc-plot-item label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}
.sfc-plot-item select,
.sfc-plot-item input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}
.sfc-input-unit {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.sfc-input-unit .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
  min-width: 0;
}
.sfc-unit {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-color, #e5e7eb);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}
.sfc-plot-item[data-depends] {
  grid-column: 1 / -1;
}

/* ---------- 右：结果列 ---------- */
.sentence-result-col { display: flex; flex-direction: column; gap: 16px; min-height: 400px; }

.result-placeholder, .result-loading, .result-error {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
}
.ph-illus { font-size: 48px; margin-bottom: 10px; }
.result-placeholder h3, .result-loading h3, .result-error h3 {
  font-size: 17px; color: var(--text-title); margin-bottom: 8px;
}
.result-placeholder p, .result-loading p, .result-error p {
  font-size: 14px; color: var(--text-body); line-height: 1.7;
}
.result-placeholder ul {
  list-style: none;
  padding: 0; margin: 14px auto 0;
  text-align: left;
  max-width: 360px;
  font-size: 14px;
  color: var(--text-body);
}
.result-placeholder li {
  padding: 5px 0;
  border-bottom: 1px dashed var(--border-color);
}
.result-placeholder li:last-child { border-bottom: none; }

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-dots {
  margin-top: 14px;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}
.loading-dots span {
  width: 8px; height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: bounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.result-error .re-icon { font-size: 40px; margin-bottom: 8px; }
.result-error h3 { color: #991b1b; }
.result-error button { margin-top: 10px; }

/* ---------- 结果内容 ---------- */
#resultContent { display: flex; flex-direction: column; gap: 14px; }

.sentence-disclaimer {
  padding: 14px 16px;
  background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%);
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.8;
  color: #92400e;
}
.sentence-disclaimer strong { color: #78350f; }

.result-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.rb-title {
  font-size: 16px;
  color: var(--text-title);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* 匹配罪名列表 */
.matched-crime-list { display: flex; flex-direction: column; gap: 12px; }
.matched-crime-item {
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
@media (prefers-color-scheme: dark) {
  .matched-crime-item { background: #0f172a; }
}
.mci-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mci-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.matched-crime-item:nth-child(1) .mci-rank { background: #dc2626; }
.matched-crime-item:nth-child(2) .mci-rank { background: #d97706; }
.matched-crime-item:nth-child(3) .mci-rank { background: #2563eb; }

.mci-info { flex: 1; min-width: 0; }
.mci-name { font-size: 16px; font-weight: 600; color: var(--text-title); }
.mci-law  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.mci-prob { width: 160px; flex-shrink: 0; text-align: right; }
.prob-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.prob-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #6366f1);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.prob-text { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.mci-reason {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.7;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

/* 量刑大卡 */
.sentence-block {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
}
.sentence-big {
  text-align: center;
  padding: 20px 0 16px;
}
.sb-range {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.sb-from, .sb-to {
  font-size: 34px;
  font-weight: 800;
  color: #4338ca;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sb-tilde { font-size: 20px; color: var(--text-muted); font-weight: 600; }
.sb-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.sentence-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 8px;
}
.sm-item {
  background: rgba(255,255,255,0.6);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e0e7ff;
}
.sm-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.sm-val   { font-size: 15px; font-weight: 600; color: var(--text-title); }
.sm-prob-高 { color: #16a34a; }
.sm-prob-中 { color: #d97706; }
.sm-prob-低 { color: #dc2626; }
.sm-prob-无法判断 { color: var(--text-muted); }

.factors h4 {
  font-size: 14px; color: var(--text-title); margin: 12px 0 8px;
}
.factors ul { margin: 0; padding-left: 18px; }
.factors li { font-size: 13px; line-height: 1.8; color: var(--text-body); }

/* 辩护要点 */
.defense-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.defense-list li {
  padding: 12px 14px;
  background: #ecfdf5;
  border-left: 3px solid #10b981;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: #065f46;
}
@media (prefers-color-scheme: dark) {
  .defense-list li { background: #052e2b; color: #a7f3d0; }
}
.def-dot { margin-right: 8px; color: #10b981; font-weight: 700; }

/* 律师建议 */
.advice-block {
  background: linear-gradient(90deg, #f0f9ff 0%, #fef3c7 100%);
  border: 1px solid #bae6fd;
}
.advice-text {
  font-size: 15px;
  line-height: 1.85;
  color: #0c4a6e;
  margin: 0;
}

/* AI 原文兜底 */
.ai-raw {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 留资表单 */
.leave-block {
  background: linear-gradient(135deg, #fff1f2 0%, #eff6ff 100%);
  border: 1px solid #fecdd3;
}
.matched-lawyer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.75);
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1px solid #fecaca;
}
.ml-label { font-size: 13px; color: var(--text-muted); }
.ml-name {
  font-size: 16px;
  font-weight: 700;
  color: #dc2626;
  text-decoration: none;
}
.ml-name:hover { text-decoration: underline; }
.ml-desc { font-size: 12px; color: var(--text-muted); flex-basis: 100%; }

.leave-form .form-row { gap: 16px; }
#leaveSubmit { width: 100%; justify-content: center; }
.leave-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}
.leave-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.leave-msg.success {
  background: #dcfce7; border: 1px solid #86efac; color: #166534;
}
.leave-msg.error {
  background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b;
}
.leave-msg .ico { margin-right: 6px; }

/* ---------- 相似内容区 ---------- */
.similar-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
@media (max-width: 720px) { .similar-row { grid-template-columns: 1fr; } }
.similar-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.similar-col h4 {
  font-size: 15px; color: var(--text-title); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--border-color);
}
.similar-col ul { list-style: none; padding: 0; margin: 0; }
.similar-col li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 14px;
  line-height: 1.55;
}
.similar-col li:last-child { border-bottom: none; }
.similar-col a {
  color: var(--color-accent);
  text-decoration: none;
  position: relative;
  padding-left: 18px;
  display: block;
}
.similar-col a::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.similar-col a:hover { text-decoration: underline; }
