/* ========== 基础 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 16px;
  color: #333;
  -webkit-text-size-adjust: 100%;
  max-width: 450px;
  margin: 0 auto;
  min-height: 100vh;
}

.page {
  padding: 15px;
  padding-bottom: 60px;
}

/* ========== 头部 ========== */
.header {
  background: linear-gradient(135deg, #1a73e8, #2b8cf5);
  border-radius: 10px;
  padding: 24px 18px;
  margin-bottom: 18px;
  color: #fff;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.header-desc {
  font-size: 14px;
  opacity: 0.85;
}

.header-count {
  font-size: 13px;
  color: #999;
}

/* ========== 章节 ========== */
.section {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a73e8;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eef2fb;
}

/* ========== 表单项 ========== */
.form-item {
  margin-bottom: 18px;
}

.form-item:last-child {
  margin-bottom: 0;
}

.sub-item {
  margin-left: 22px;
  padding: 12px 16px;
  background: #f8fafd;
  border-radius: 8px;
  border-left: 4px solid #1a73e8;
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.required {
  color: #e74c3c;
  margin-left: 2px;
}

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

.text-input,
.select-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #f5f7fa;
  border-radius: 6px;
  font-size: 15px;
  border: 2px solid #e8ecf2;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus,
.select-input:focus {
  border-color: #1a73e8;
}

.select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input-with-unit {
  display: flex;
  align-items: center;
}

.input-with-unit .text-input {
  flex: 1;
}

.unit {
  margin-left: 10px;
  font-size: 15px;
  color: #666;
  white-space: nowrap;
}

.form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* ========== 单选框 ========== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-item {
  display: flex;
  align-items: center;
  height: 40px;
  font-size: 15px;
  color: #444;
  cursor: pointer;
}

.radio-item input[type="radio"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  accent-color: #1a73e8;
}

/* ========== 预估节能率 ========== */
.estimate-section {
  background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
  border: 2px solid #c8ddf5;
}

.estimate-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.estimate-base {
  font-size: 15px;
  color: #555;
}

.estimate-bonus-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.estimate-bonus {
  font-size: 13px;
  color: #27ae60;
  font-weight: 500;
}

.estimate-result {
  display: flex;
  align-items: baseline;
  padding-top: 10px;
  border-top: 2px dashed #c8ddf5;
}

.estimate-label {
  font-size: 15px;
  color: #333;
  font-weight: 600;
}

.estimate-value {
  font-size: 28px;
  font-weight: 800;
  color: #555;
  margin-left: 6px;
}

.estimate-value.has-bonus {
  color: #27ae60;
}

.estimate-note {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
}

/* ========== 按钮区 ========== */
.btn-area {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-area-row {
  flex-direction: row;
}

.submit-btn {
  width: 100%;
  height: 50px;
  border: none;
  outline: none;
  background: linear-gradient(135deg, #1a73e8, #2b8cf5);
  color: #fff;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.reset-btn {
  width: 100%;
  height: 44px;
  border: 2px solid #e0e0e0;
  outline: none;
  background: #fff;
  color: #666;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  -webkit-appearance: none;
}

.back-btn {
  flex: 1;
  height: 48px;
  border: 2px solid #e0e0e0;
  outline: none;
  background: #fff;
  color: #666;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  -webkit-appearance: none;
}

.share-btn {
  flex: 1;
  height: 48px;
  border: none;
  outline: none;
  background: linear-gradient(135deg, #1a73e8, #2b8cf5);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.go-btn {
  height: 44px;
  border: none;
  outline: none;
  background: linear-gradient(135deg, #1a73e8, #2b8cf5);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.clear-btn {
  flex: 1;
  height: 44px;
  border: 2px solid #e0e0e0;
  outline: none;
  background: #fff;
  color: #e74c3c;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  -webkit-appearance: none;
}

/* ========== 评分卡片 ========== */
.score-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 18px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid;
}

.score-circle.grade-A { border-color: #27ae60; background: #eafaf1; }
.score-circle.grade-B { border-color: #2b8cf5; background: #eef6fe; }
.score-circle.grade-C { border-color: #f39c12; background: #fef9e7; }
.score-circle.grade-D { border-color: #e74c3c; background: #fdedec; }

.score-num {
  font-size: 34px;
  font-weight: 800;
  color: #333;
}

.score-label {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.grade-badge {
  display: inline-block;
  border-radius: 24px;
  padding: 6px 24px;
  font-size: 17px;
  font-weight: 600;
}

.grade-badge.grade-A { background: #eafaf1; color: #27ae60; }
.grade-badge.grade-B { background: #eef6fe; color: #2b8cf5; }
.grade-badge.grade-C { background: #fef9e7; color: #f39c12; }
.grade-badge.grade-D { background: #fdedec; color: #e74c3c; }

.grade-letter {
  font-size: 13px;
  font-weight: 400;
}

/* ========== 单位信息行 ========== */
.info-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}

.info-row:last-child { border-bottom: none; }

.info-label {
  width: 80px;
  font-size: 14px;
  color: #888;
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  color: #333;
  flex: 1;
  word-break: break-all;
}

/* ========== 各维度得分 ========== */
.detail-item {
  margin-bottom: 16px;
}
.detail-item:last-child { margin-bottom: 0; }

.detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.detail-icon { font-size: 15px; margin-right: 6px; }

.detail-name {
  font-size: 14px;
  color: #333;
  flex: 1;
}

.detail-weight {
  font-size: 12px;
  color: #aaa;
}

.progress-bar {
  height: 8px;
  background: #eef2fb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.detail-score {
  font-size: 12px;
  color: #999;
}

/* ========== 改进建议 ========== */
.suggestion-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
  line-height: 1.7;
}
.suggestion-item:last-child { margin-bottom: 0; }

.suggestion-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a73e8;
  margin-top: 9px;
  margin-right: 10px;
  flex-shrink: 0;
}

.suggestion-item span {
  font-size: 14px;
  color: #555;
}

/* ========== 历史记录 ========== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

.empty-icon { font-size: 48px; margin-bottom: 14px; }

.empty-text {
  font-size: 15px;
  color: #999;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 13px;
  color: #bbb;
  margin-bottom: 24px;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  position: relative;
  cursor: pointer;
}

.record-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.record-score {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
  border: 4px solid;
}

.record-score.grade-A { border-color: #27ae60; background: #eafaf1; }
.record-score.grade-B { border-color: #2b8cf5; background: #eef6fe; }
.record-score.grade-C { border-color: #f39c12; background: #fef9e7; }
.record-score.grade-D { border-color: #e74c3c; background: #fdedec; }

.record-num {
  font-size: 22px;
  font-weight: 800;
  color: #333;
}

.record-label {
  font-size: 11px;
  color: #999;
}

.record-info {
  flex: 1;
}

.record-company {
  display: block;
  font-size: 14px;
  color: #333;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-grade {
  display: block;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.grade-text-A { color: #27ae60; }
.grade-text-B { color: #2b8cf5; }
.grade-text-C { color: #f39c12; }
.grade-text-D { color: #e74c3c; }

.record-time {
  font-size: 12px;
  color: #999;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  color: #666;
  background: #f5f7fa;
  padding: 3px 8px;
  border-radius: 4px;
}

.record-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #ccc;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 450px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  padding: 12px 15px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 12px));
  background: #fff;
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.04);
}

/* ========== 管理员弹窗 ========== */
.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.admin-modal {
  width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 30px 24px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.admin-title {
  font-size: 19px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 22px;
}

.admin-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: #f5f7fa;
  border-radius: 8px;
  font-size: 15px;
  border: 2px solid #e8ecf2;
  margin-bottom: 20px;
  outline: none;
  -webkit-appearance: none;
}

.admin-input:focus {
  border-color: #1a73e8;
}

.admin-btns {
  display: flex;
  gap: 12px;
}

.admin-btn-cancel {
  flex: 1;
  height: 44px;
  border: 2px solid #e0e0e0;
  outline: none;
  background: #fff;
  color: #666;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  -webkit-appearance: none;
}

.admin-btn-confirm {
  flex: 1;
  height: 44px;
  border: none;
  outline: none;
  background: linear-gradient(135deg, #1a73e8, #2b8cf5);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

/* ========== 管理员后台 ========== */
.admin-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-btn-small {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d0d0d0;
  outline: none;
  background: #fff;
  color: #333;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  -webkit-appearance: none;
}

.admin-btn-export {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

.admin-btn-back {
  background: #f0f0f0;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.admin-table th {
  background: #f0f4ff;
  color: #1a73e8;
  font-weight: 600;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #d8e3f8;
}

.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef2fb;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table tbody tr:hover {
  background: #f8fafd;
}

.admin-grade {
  font-weight: 700;
  font-size: 13px;
}

.admin-detail-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #1a73e8;
  outline: none;
  background: #fff;
  color: #1a73e8;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  -webkit-appearance: none;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
  animation: toastIn 0.3s ease;
}

.toast.toast-hide {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
