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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  height: 100vh;
  overflow: hidden;
}

.layout {
  display: flex;
  height: 100vh;
}

/* ===== 左侧面板 ===== */
.panel-left {
  width: 380px;
  min-width: 340px;
  background: #fff;
  border-right: 1px solid #e8eaf0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.logo-icon { font-size: 28px; }
.logo-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.logo-sub { font-size: 11px; color: #999; margin-top: 2px; }

/* 图例 */
.legend {
  background: #f8f9fc;
  border-radius: 8px;
  padding: 12px;
}
.legend-title { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-desc { font-size: 12px; color: #777; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-core    { background: #fff8c5; color: #7a6000; border: 1px solid #f0d060; }
.tag-non     { background: #ffe0e0; color: #9b2020; border: 1px solid #f5a0a0; }
.tag-dir     { background: #fff0d6; color: #8a4a00; border: 1px solid #ffc070; text-decoration: underline; }
.tag-inf     { background: #ddeeff; color: #1040a0; border: 1px solid #80b0f0; }

/* 表单 */
form { display: flex; flex-direction: column; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.label-hint { font-size: 11px; font-weight: 400; color: #999; margin-left: 4px; }

textarea {
  border: 1px solid #dde2ea;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  color: #333;
  transition: border-color 0.2s;
  font-family: inherit;
}
textarea:focus { outline: none; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
textarea::placeholder { color: #bbb; }

.btn-analyze {
  background: linear-gradient(135deg, #4a6cf7, #6a4cf7);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
.btn-analyze:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,108,247,0.4); }
.btn-analyze:active { transform: translateY(0); }
.btn-analyze:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sample {
  text-align: center;
  color: #4a6cf7;
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}
.btn-sample:hover { background: #f0f2ff; }

/* ===== 右侧面板 ===== */
.panel-right {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #aaa;
  gap: 10px;
}
.empty-icon { font-size: 64px; opacity: 0.4; }
.empty-title { font-size: 18px; font-weight: 500; }
.empty-sub { font-size: 14px; }

/* 结果区 */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
}

.result-product {
  font-size: 15px;
  color: #444;
  font-weight: 500;
  background: #f8f9fc;
  padding: 10px 14px;
  border-radius: 8px;
  flex: 1;
}

.risk-badge-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.risk-badge {
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.risk-badge.high { background: #ffe0e0; color: #c0392b; border: 2px solid #e74c3c; }
.risk-badge.medium { background: #fff3cd; color: #856404; border: 2px solid #ffc107; }
.risk-badge.low { background: #d4edda; color: #155724; border: 2px solid #28a745; }
.risk-score { font-size: 12px; color: #999; }

/* Checklist bar */
.checklist-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: #555;
}
.check-item.warn { border-color: #f5c518; background: #fff9e6; color: #7a5800; }
.check-item.alert { border-color: #f5a0a0; background: #fff0f0; color: #9b2020; }
.check-item.ok { border-color: #a0d4a0; background: #f0fff0; color: #206020; }

/* 风险概述 */
.risk-summary-box {
  background: #fff;
  border-left: 4px solid #4a6cf7;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 16px;
}

/* 通用 section */
.section {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
  border: 1px solid #eaedf3;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

/* 高风险词 */
.top-risks-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8f8;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
  padding: 10px 12px;
}
.risk-word {
  background: #ffe0e0;
  color: #c0392b;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.risk-detail { font-size: 13px; color: #555; line-height: 1.5; }
.risk-detail .suggestion { color: #27ae60; font-weight: 500; margin-top: 2px; }

/* 字段标注区 */
.field-block {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
  border: 1px solid #eaedf3;
}
.field-title {
  font-size: 13px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-count {
  background: #f0f2f5;
  color: #888;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.field-text {
  font-size: 14px;
  line-height: 2;
  color: #333;
  word-break: break-word;
  white-space: pre-wrap;
}

/* 内联高亮 */
.hl-core    { background: #fff8c5; border-bottom: 2px solid #f0d060; padding: 0 2px; border-radius: 2px; cursor: pointer; }
.hl-non     { background: #ffe0e0; border-bottom: 2px solid #f5a0a0; padding: 0 2px; border-radius: 2px; cursor: pointer; }
.hl-dir     { background: #fff0d6; border-bottom: 2px solid #ffc070; text-decoration: underline; text-underline-offset: 3px; padding: 0 2px; border-radius: 2px; cursor: pointer; }
.hl-inf     { background: #ddeeff; border-bottom: 2px solid #80b0f0; padding: 0 2px; border-radius: 2px; cursor: pointer; }

/* tooltip */
.hl-core:hover::after, .hl-non:hover::after, .hl-dir:hover::after, .hl-inf:hover::after {
  content: attr(data-reason);
  position: absolute;
  background: rgba(30,30,50,0.92);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 999;
  margin-top: -36px;
  margin-left: -40px;
  pointer-events: none;
}
[data-reason] { position: relative; }

/* 建议列表 */
.suggestions-list { padding-left: 18px; }
.suggestions-list li { font-size: 14px; color: #444; margin-bottom: 8px; line-height: 1.6; }

/* 错误区 */
.error-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #c0392b;
  gap: 10px;
  font-size: 15px;
}
.error-icon { font-size: 48px; }

.hidden { display: none !important; }
