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

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.intro-panel,
.result-section,
.user-info {
  background: #f8f9fa;
  border: 1px solid #e7ebf0;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.intro-panel ul,
.advice-box ol {
  padding-left: 20px;
}

.summary {
  margin-bottom: 12px;
  color: #555;
}

.volunteer-badge {
  display: inline-block;
  background: #edf4ff;
  color: #1f4e8c;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}

.school-card h3 {
  margin-bottom: 10px;
  color: #1f2d3d;
}

.tier-冲 {
  border-left: 5px solid #ff9f43;
}

.tier-稳 {
  border-left: 5px solid #2e86de;
}

.tier-保,
.tier-补位 {
  border-left: 5px solid #27ae60;
}

.placeholder-card {
  border-left: 5px solid #95a5a6;
}

@media print {
  body {
    background: white;
    font-family: "Microsoft YaHei", "SimSun", sans-serif;
  }

  .container {
    max-width: 100%;
    box-shadow: none;
    padding: 0;
  }

  .actions,
  .modal,
  .btn,
  footer {
    display: none !important;
  }

  .school-grid {
    grid-template-columns: 1fr;
  }

  .school-card,
  .intro-panel,
  .result-section,
  .user-info {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

header h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

form {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
  font-weight: 600;
}

.btn:hover {
  background: #2980b9;
}

.btn.secondary {
  background: #95a5a6;
  margin: 5px;
}

.btn.secondary:hover {
  background: #7f8c8d;
}

.actions {
  text-align: center;
  margin: 25px 0;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.school-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.school-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.school-card h4 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 16px;
}

.school-card p {
  margin: 5px 0;
  font-size: 14px;
}

.intro {
  color: #666;
  font-style: italic;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.user-info {
  background: #e8f4f8;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
}

footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #666;
}

.error {
  color: #e74c3c;
  text-align: center;
  padding: 20px;
}