/* ==========================================================================
   云等保指标判定器 — GA/T 2347—2025《云计算测评指引》
   模块样式（自 yun_judge.html 的 <style> 块移植）

   规则：颜色一律取自 site.css 的 CSS 变量，不硬编码任何色值；
        所有选择器限定在 .judge 作用域内，避免影响站点外壳。
   ========================================================================== */

.judge {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

/* ------------------------------ 顶部说明 ------------------------------ */

.judge-intro { margin: 0 0 4px; }
.judge-intro-sub {
  margin: 0;
  font-size: 13px;
  color: var(--sub);
}
.judge-intro-sub strong { color: var(--blue-d); }

/* ------------------------------ 面板 / 标题 ------------------------------ */

.judge .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.judge h2 {
  font-size: 17px;
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--blue);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.judge h2 .n {
  background: var(--blue);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  flex: none;
}
.judge h3 {
  font-size: 14.5px;
  margin: 20px 0 8px;
  color: var(--blue-d);
  padding-left: 10px;
  border-left: 3px solid var(--blue);
}

/* ------------------------------ 表单 ------------------------------ */

.judge .fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.judge .f {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.judge .f.f-full { grid-column: 1 / -1; }

.judge .f label.fl {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-d);
  margin-bottom: 9px;
}
.judge .f label.fl .q {
  display: inline-block;
  width: 17px;
  height: 17px;
  line-height: 17px;
  text-align: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--card);
  font-size: 11px;
  margin-right: 6px;
}
.judge .judge-req { color: var(--red); }

.judge .opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.judge .opts.row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
}
.judge .opt {
  position: relative;
  display: block;
  cursor: pointer;
}
.judge .opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.judge .opt span {
  display: block;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  font-size: 13.5px;
  transition: .13s;
  user-select: none;
}
.judge .opts.row .opt span { padding: 7px 13px; }
.judge .opt input:checked + span {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue-d);
  font-weight: 650;
}
.judge .opt input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.judge .hint {
  font-size: 12px;
  color: var(--sub);
  margin-top: 8px;
  line-height: 1.6;
}

.judge select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
}
.judge select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}
.judge select:disabled {
  background: var(--card-2);
  color: var(--muted);
  cursor: not-allowed;
}
.judge #baseWrap.hidden { display: none; }

.judge .btnrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center;
}
.judge .judge-hintline {
  font-size: 12.5px;
  color: var(--sub);
}
.judge button {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--card);
  cursor: pointer;
  font-weight: 600;
}
.judge button:hover {
  background: var(--blue-d);
  border-color: var(--blue-d);
}
.judge button:focus-visible {
  outline: 2px solid var(--blue-d);
  outline-offset: 2px;
}
.judge button.ghost {
  background: var(--card);
  color: var(--blue);
}
.judge button.ghost:hover {
  background: var(--blue-bg);
  border-color: var(--blue-line);
}

/* ------------------------------ 结果区 ------------------------------ */

.judge #out { display: none; }

.judge .scen {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 4px;
}
.judge .scen .b {
  flex: 1;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  background: var(--card-2);
}
.judge .scen .b .t {
  font-size: 12px;
  color: var(--sub);
}
.judge .scen .b .v {
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
}
.judge .scen .b .v.v-sm { font-size: 14px; }
.judge .scen .b.hi {
  background: var(--purple-bg);
  border-color: var(--purple-line);
}
.judge .scen .b.hi .v { color: var(--purple); }

.judge .counts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
}
.judge .cnt {
  flex: 1;
  min-width: 130px;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  text-align: center;
  border: 1px solid;
}
.judge .cnt .n {
  font-size: 30px;
  font-weight: 750;
  line-height: 1.1;
}
.judge .cnt .l {
  font-size: 12.5px;
  margin-top: 3px;
}
.judge .cnt.ok {
  background: var(--green-bg);
  border-color: var(--green-line);
  color: var(--green);
}
.judge .cnt.no {
  background: var(--red-bg);
  border-color: var(--red-line);
  color: var(--red);
}
.judge .cnt.tot {
  background: var(--blue-bg);
  border-color: var(--blue-line);
  color: var(--blue-d);
}

/* ------------------------------ 表格 ------------------------------ */

.judge table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.judge th,
.judge td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.judge th {
  background: var(--card-2);
  font-weight: 650;
  white-space: nowrap;
}
.judge tbody tr:nth-child(even) { background: var(--card-2); }
.judge td.c,
.judge th.c {
  text-align: center;
  white-space: nowrap;
}
.judge td.cl {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-d);
  font-weight: 650;
  white-space: nowrap;
}
.judge td.lp {
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--sub);
}
.judge td.num {
  color: var(--sub);
  font-size: 12px;
  width: 44px;
}
.judge .why {
  font-size: 12.5px;
  color: var(--red);
}
.judge .okwhy {
  font-size: 12.5px;
  color: var(--green);
}
.judge tr.row-na td { background: var(--red-bg); }
.judge tr.row-na:hover td { background: var(--red-line); }
.judge td.dim { color: var(--muted); }

/* ------------------------------ 折叠 / 徽标 / 提示 ------------------------------ */

.judge .whybar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.judge details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0 10px;
  border-bottom: 2px solid var(--blue);
}
.judge details > summary::-webkit-details-marker { display: none; }
.judge details > summary::before {
  content: "▸";
  color: var(--blue);
  font-weight: 700;
  margin-right: 7px;
}
.judge details[open] > summary::before { content: "▾"; }
.judge details > summary:hover .sumsub { color: var(--sub); }
.judge .sum {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.judge .sumsub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--sub);
}

.judge .cntline {
  margin: 12px 0 10px;
  padding: 9px 13px;
  background: var(--blue-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--blue-d);
}
.judge .cntline b { font-size: 15px; }

.judge .badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.judge .b-mode  { background: var(--card-2);   color: var(--sub); }
.judge .b-layer { background: var(--amber-bg);  color: var(--amber); }
.judge .b-scene { background: var(--purple-bg); color: var(--purple); }
.judge .b-ok    { background: var(--green-bg);  color: var(--green); }
.judge .b-no    { background: var(--red-bg);    color: var(--red); }
.judge .b-own   { background: var(--blue-bg);   color: var(--blue-d); }

.judge .box {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 13px 0;
  font-size: 13.5px;
  border-left: 4px solid;
}
.judge .box p { margin: 5px 0; }
.judge .box p:first-child { margin-top: 0; }
.judge .box p:last-child { margin-bottom: 0; }
.judge .box.warn {
  background: var(--red-bg);
  border-color: var(--red);
}
.judge .box.warn strong { color: var(--red); }
.judge .box.info {
  background: var(--blue-bg);
  border-color: var(--blue);
}
.judge .box.info strong { color: var(--blue-d); }
.judge .box.gray {
  background: var(--card-2);
  border-color: var(--line);
}

.judge .empty {
  color: var(--sub);
  font-size: 13.5px;
}
.judge .empty.compact { padding: 10px 0; }

/* ------------------------------ 底部说明 / 状态 ------------------------------ */

.judge .judge-foot {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 22px 4px 0;
  line-height: 1.9;
}
.judge .judge-loading { padding: 14px 0; }

/* ------------------------------ 响应式（≤900px） ------------------------------ */

@media (max-width: 900px) {
  .judge .panel {
    padding: 16px 15px;
    margin-top: 14px;
  }
  .judge .fgrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .judge .scen .b {
    min-width: 130px;
    padding: 10px 12px;
  }
  .judge .scen .b .v { font-size: 15px; }
  .judge .cnt {
    min-width: 108px;
    padding: 11px 12px;
  }
  .judge .cnt .n { font-size: 24px; }
  .judge .btnrow { gap: 8px; }
  .judge button { padding: 8px 15px; font-size: 13.5px; }
  .judge .judge-foot { text-align: left; }
}

/* ------------------------------ 打印 ------------------------------ */

@media print {
  .judge .no-print { display: none !important; }
  .judge .panel {
    border: 1px solid var(--line);
    margin-top: 10px;
    padding: 14px 16px;
    break-inside: auto;
  }
  .judge h2, .judge h3 {
    break-after: avoid;
    page-break-after: avoid;
  }
  .judge table {
    font-size: 8.8pt;
    break-inside: auto;
  }
  .judge tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .judge thead { display: table-header-group; }
  .judge .box {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
