/* assets/score.css — 打分页私有样式 */

/* ---------- Saved count hint ---------- */
.saved-hint {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.saved-hint a {
  color: var(--accent2);
  font-weight: 700;
  text-decoration: none;
}
.saved-hint a:hover {
  text-decoration: underline;
}

/* ---------- Checklist wrap ---------- */
.checklist-wrap {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Checklist toolbar ---------- */
.checklist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.8rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
}
.checklist-toolbar .company-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.checklist-toolbar label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}
.checklist-toolbar input[type="text"] {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  width: 200px;
}
.checklist-toolbar input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.toolbar-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- Score table ---------- */
.score-table-wrap {
  overflow-x: auto;
}
table.score-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
table.score-table thead th {
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 1rem 1.2rem;
  background: var(--bg2);
  border-bottom: 2px solid var(--rule);
}
table.score-table thead th:last-child,
table.score-table thead th.col-max {
  text-align: center;
}

/* Dimension row */
.dim-row td {
  padding: 0.9rem 1.2rem;
  background: #FBF8F4;
  border-bottom: 1px solid var(--rule);
  border-top: 2px solid var(--rule);
}
.dim-row .dim-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.dim-row .dim-weight {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
}
.dim-row .dim-subtotal {
  text-align: center;
  font-weight: 700;
  color: var(--accent2);
  font-size: 0.9rem;
}

/* Item row */
.item-row td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
  vertical-align: top;
  background: var(--surface);
}
.item-row td:first-child {
  padding-left: 2.4rem;
  color: var(--ink);
}
.item-row .crit {
  color: var(--muted);
  font-size: 0.86rem;
}
.item-row .max-cell {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

/* Score input */
.score-input-cell {
  text-align: center;
}
.score-input {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  width: 64px;
  text-align: center;
  padding: 0.35rem 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent);
  -moz-appearance: textfield;
  transition: background 0.15s ease, color 0.15s ease;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.score-input.is-max {
  background: var(--accent2-soft);
  color: var(--accent2);
}

/* ---------- Total bar ---------- */
.total-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 1.8rem;
  background: var(--ink);
  color: #fff;
}
.total-bar .total-label {
  font-size: 0.85rem;
  color: #C9BFB4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.total-bar .total-num {
  font-family: 'InstrumentSerif', serif;
  font-size: 3rem;
  line-height: 1;
  color: #fff;
}
.total-bar .total-num .denom {
  font-size: 1.2rem;
  color: #C9BFB4;
}

/* ---------- Reco badge ---------- */
.reco-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
}
.reco-badge.tier-a { background: #4A7C59; color: #fff; }
.reco-badge.tier-b { background: #6B9A7A; color: #fff; }
.reco-badge.tier-c { background: #D4A24C; color: #2A2622; }
.reco-badge.tier-d { background: #C0392B; color: #fff; }

/* ---------- Viz grid ---------- */
.viz-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.radar-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.radar-card h4 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.radar-card .radar-sub {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
#radar-chart {
  width: 100%;
  height: 360px;
}

/* ---------- Tier list ---------- */
.tier-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.tier-card h4 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 700;
  margin-bottom: 1rem;
}
.tier-list {
  list-style: none;
}
.tier-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.9rem;
}
.tier-list li:last-child {
  border-bottom: none;
}
.tier-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.35rem;
}
.tier-dot.a { background: #4A7C59; }
.tier-dot.b { background: #6B9A7A; }
.tier-dot.c { background: #D4A24C; }
.tier-dot.d { background: #C0392B; }
.tier-list .range {
  font-weight: 700;
  color: var(--ink);
}
.tier-list .desc {
  color: var(--muted);
}

/* ---------- Toast ---------- */
.score-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--accent2);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-toast.fade-out {
  opacity: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .viz-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .checklist-toolbar input[type="text"] {
    width: 140px;
  }
  .total-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar-btns {
    width: 100%;
  }
}

/* ---------- Print ---------- */
@media print {
  .checklist-wrap {
    box-shadow: none;
  }
  .btn,
  .checklist-toolbar input[type="text"] {
    display: none;
  }
  .score-input {
    border: 1px solid var(--muted);
    -webkit-appearance: none;
  }
  #radar-chart {
    display: none;
  }
  .score-toast {
    display: none;
  }
}
