/* =========================
   Global
========================= */
body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  background-color: #f2f2f2;
  color: #333;
}

h2, p { text-align: center; }
h2 { margin-top: 10px; margin-bottom: 5px; color: #0e7b3b; }
p { font-size: 13px; color: #666; margin-bottom: 20px; }
a { color: #0e7b3b; }

/* =========================
   Upload page
========================= */
.upload-container {
  max-width: 600px;
  margin: 0 auto;
}

.upload-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e1e1e1;
  text-align: center;
}

.upload-icon { font-size: 28px; margin-bottom: 8px; }

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.upload-desc {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

.required { color: #e74c3c; font-size: 12px; font-weight: 400; }
.optional { color: #999; font-size: 12px; font-weight: 400; }

input[type="file"] { display: none; }

.file-label {
  display: inline-block;
  padding: 8px 24px;
  background: #0e7b3b;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.file-label:active { opacity: 0.9; }

.file-name {
  margin-top: 8px;
  font-size: 13px;
  color: #0e7b3b;
  font-weight: 500;
  min-height: 18px;
}

/* =========================
   Action area
========================= */
.action {
  margin-top: 24px;
  text-align: center;
  padding-bottom: 40px;
}

button {
  background: #0e7b3b;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 48px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(14, 123, 59, 0.2);
}
button:active { opacity: 0.9; transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.loading {
  margin-top: 12px;
  color: #0e7b3b;
  font-size: 14px;
}

.error-msg {
  margin-top: 12px;
  color: #e74c3c;
  font-size: 14px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

/* =========================
   Score section
========================= */
.score-section {
  text-align: center;
  margin-bottom: 24px;
}

.score-badge {
  display: inline-block;
  width: 100px;
  height: 100px;
  line-height: 100px;
  border-radius: 50%;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.score-green { background: #27ae60; }
.score-yellow { background: #f39c12; }
.score-red { background: #e74c3c; }

.score-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.score-summary { font-size: 14px; color: #555; }
.pass-count { color: #27ae60; font-weight: 600; }
.fail-count { color: #e74c3c; font-weight: 600; }

/* =========================
   Rule cards
========================= */
.rules-section {
  max-width: 600px;
  margin: 0 auto;
}

.rule-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #ccc;
}
.rule-card.pass { border-left-color: #27ae60; }
.rule-card.fail { border-left-color: #e74c3c; }

.rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-icon { font-size: 18px; }

.rule-name {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.violation-badge {
  background: #fce4e4;
  color: #e74c3c;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.rule-desc {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  margin-left: 28px;
}

.violation-details {
  margin-top: 10px;
  margin-left: 28px;
}

.violation-details summary {
  cursor: pointer;
  color: #0e7b3b;
  font-size: 13px;
  font-weight: 500;
}

.violation-details ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.violation-details li {
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* =========================
   All violations
========================= */
.all-violations {
  max-width: 600px;
  margin: 24px auto;
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.all-violations h3 {
  font-size: 15px;
  color: #e74c3c;
  margin: 0 0 12px 0;
}

.all-violations ul {
  margin: 0;
  padding-left: 20px;
}

.all-violations li {
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  line-height: 1.5;
}
