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

:root {
  --primary-color: #003366;
  --primary-light: #4a90d9;
  --primary-lighter: #e8f4fc;
  --gold-color: #003366;
  --red-seal: #003366;
  --bg-color: #f0f7fc;
  --card-bg: #ffffff;
  --text-secondary: #4a6a8a;
  --max-content-width: 800px;
  --content-padding: 20px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  color: #003366;
  line-height: 1.6;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.login-container {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  text-align: center;
}

.login-logo img {
  width: 100px;
  height: auto;
  margin-bottom: 20px;
}

.login-container h1 {
  font-size: 1.6rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.login-subtitle { color: var(--text-secondary); margin-bottom: 30px; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { text-align: left; }
.form-group label { font-weight: 600; color: var(--primary-color); display: block; margin-bottom: 6px; }
.form-group input {
  width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1rem;
  transition: 0.3s; background: #fafafa;
}
.form-group input:focus { outline: none; border-color: var(--primary-color); background: white; }

.login-btn {
  padding: 14px; background: var(--primary-color); color: white; border: none;
  border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 10px;
}
.login-btn:hover { background: var(--primary-light); }

.error-message {
  background: rgba(220,53,69,0.1); color: #dc3545; padding: 12px; border-radius: 8px;
  margin-top: 16px; display: none;
}

.login-hint { margin-top: 20px; color: #888; font-size: 0.85rem; }

.main-page { min-height: 100vh; display: flex; flex-direction: column; }

header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white; padding: 16px 24px; display: flex; justify-content: space-between;
  align-items: center; position: sticky; top: 0; z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo { width: 50px; height: auto; }
.header-title h1 { font-size: 1.3rem; }
.header-subtitle { font-size: 0.75rem; opacity: 0.8; }

.logout-btn {
  padding: 8px 16px; background: rgba(255,255,255,0.2); color: white;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; cursor: pointer;
}

.search-section {
  padding: 24px; background: var(--card-bg); margin: 20px auto; border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  max-width: var(--max-content-width);
}

.search-header { text-align: center; margin-bottom: 20px; }
.search-header h2 { color: var(--primary-color); }

.search-box { display: flex; gap: 10px; max-width: 500px; margin: 0 auto; }
.search-box input {
  flex: 1; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 12px;
  font-size: 1rem;
}
.search-box button {
  padding: 12px 24px; background: var(--primary-color); color: white; border: none;
  border-radius: 12px; font-weight: 600; cursor: pointer;
}

.suggestions {
  max-width: 500px; margin: 12px auto 0; background: white; border: 1px solid #e2e8f0;
  border-radius: 12px; overflow: hidden;
}
.suggestion-item { padding: 10px 16px; cursor: pointer; }
.suggestion-item:hover { background: rgba(0,51,102,0.05); }
.no-match { padding: 10px 16px; color: #888; text-align: center; }

.result-container { padding: 0; max-width: var(--max-content-width); margin: 0 auto; }

.result-card {
  background: white; border-radius: 24px; padding: 32px; text-align: center;
  max-width: var(--max-content-width); margin: 0 auto; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.result-card .card-icon { font-size: 4rem; margin-bottom: 16px; }
.result-card h2 { color: var(--primary-color); margin-bottom: 16px; }
.not-retained-card { border-top: 5px solid #dc3545; }

.action-btn {
  padding: 12px 24px; border: none; border-radius: 12px; font-weight: 600; cursor: pointer;
}
.action-btn.secondary-btn { background: var(--primary-lighter); color: var(--primary-color); }

/* 任命书样式 */
.appointment-container { padding: 0; max-width: var(--max-content-width); margin: var(--content-padding) auto; }
.appointment-buttons { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }

.appointment-card {
  background: #fff; border: 3px solid var(--gold-color); border-radius: 0;
  position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  width: 100%;
}

.appointment-header-bar {
  background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
  color: white; text-align: center; padding: 20px 0 18px;
}
.appointment-header-bar .org-name { font-size: 1.1rem; letter-spacing: 0.3em; opacity: 0.9; }
.appointment-header-bar .award-title {
  font-size: 2.6rem; font-weight: 700; letter-spacing: 0.3em;
  font-family: 'STKaiti','KaiTi','楷体',serif;
}

.card-inner { padding: 40px 50px 30px; }
.appointment-body-new { text-align: center; }
.student-name { font-size: 3rem; font-weight: 700; color: var(--primary-color); margin: 10px 0; }
.role-highlight {
  font-size: 1.5rem; font-weight: 700; color: var(--primary-color);
  background: rgba(0,51,102,0.06); padding: 8px 30px; border-radius: 4px;
  display: inline-block; margin: 10px 0;
}
.term-line { font-size: 1rem; color: #666; margin-bottom: 20px; }
.appointment-reason-box {
  background: rgba(0,51,102,0.03); border-left: 4px solid var(--primary-color);
  padding: 16px 20px; margin: 20px 0 30px; text-align: left; border-radius: 0 8px 8px 0;
}
.signatures-table { width: 100%; margin: 30px 0 20px; border-collapse: collapse; }
.signatures-table td { width: 50%; text-align: center; padding: 10px 20px; }
.sig-org { font-size: 0.9rem; color: #666; margin-bottom: 30px; }
.sig-line { border-bottom: 1px solid #333; width: 60%; margin: 0 auto 8px; }
.sig-name { font-weight: 600; color: #333; }
.appointment-date-line { text-align: right; color: #666; margin-top: 10px; }

.appointment-seal-new {
  position: absolute; right: 40px; bottom: 60px; width: 100px; height: 100px;
}
.appointment-seal-new img {
  width: 100%; height: 100%; object-fit: contain; transform: rotate(-15deg); opacity: 0.9;
}

.download-card-btn {
  display: block; margin: 20px auto; padding: 14px 32px;
  background: var(--primary-color); color: white; border: none;
  border-radius: 12px; font-weight: 600; cursor: pointer;
}

/* 信息卡片 */
.info-grid { display: grid; grid-template-columns: 1fr; gap: var(--content-padding); max-width: var(--max-content-width); margin: 0 auto; }
.info-card {
  background: white; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); width: 100%;
}
.info-card h3 { color: var(--primary-color); margin-bottom: 20px; border-left: 4px solid var(--primary-color); padding-left: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-item {
  background: rgba(0,51,102,0.05); padding: 16px; border-radius: 12px; text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-color); }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

.chart-container { height: 280px; margin-bottom: 16px; }

.advisor-message-wrapper {
  background: var(--primary-lighter); border-left: 4px solid var(--primary-color);
  padding: 20px; margin-bottom: 20px; border-radius: 0 8px 8px 0;
}
.advisor-label { font-weight: 700; color: var(--primary-color); margin-bottom: 10px; }
.advisor-text { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); font-style: italic; }
.president-message { font-style: italic; margin-bottom: 16px; color: var(--text-secondary); }
.center-message-wrapper { margin-top: 16px; }
.center-message-label { text-align: right; font-weight: 600; color: var(--primary-color); }

.timeline-container { position: relative; padding-left: 30px; }
.timeline-container::before {
  content: ''; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: #e2e8f0;
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-marker {
  position: absolute; left: -26px; top: 2px; width: 24px; height: 24px;
  background: var(--primary-color); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: white; font-size: 0.75rem;
}
.timeline-content { background: rgba(0,51,102,0.03); padding: 12px 16px; border-radius: 12px; }

.colleagues-container {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.colleague-card {
  background: rgba(0,51,102,0.03); padding: 16px; border-radius: 12px; text-align: center;
}

.org-chart-layout {
  display: flex; gap: 24px;
  align-items: stretch;
}
.org-chart-image {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
.org-dimension {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dimension-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  padding: 4px 16px;
  background: var(--primary-lighter);
  border-radius: 12px;
}
.org-chart-description {
  flex: 1;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  background: rgba(0,51,102,0.03);
  border-radius: 12px;
}
.org-diagram {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 15px;
  background: rgba(0,51,102,0.03);
  border-radius: 12px;
}
.diagram-level {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.diagram-box {
  background: var(--primary-color);
  color: white;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  min-width: 100px;
}
.diagram-connector {
  width: 2px;
  height: 24px;
  background: var(--primary-color);
}
.description-section {
  padding: 12px;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
  border: 1px solid rgba(0,51,102,0.1);
}
.description-section h5 {
  color: var(--primary-color);
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.description-section p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.senior-messages {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.senior-card { background: rgba(0,51,102,0.03); padding: 20px; border-radius: 12px; }
.senior-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.senior-name { font-weight: 700; color: var(--primary-color); }
.senior-title { font-weight: 700; color: var(--primary-color); }

.colleagues-container {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.colleague-card {
  background: rgba(0,51,102,0.03); padding: 12px; border-radius: 12px; text-align: center;
}
.colleague-card.same-center {
  background: rgba(0,51,102,0.1);
  border: 2px solid var(--primary-color);
}
.colleague-name { font-weight: 700; color: var(--primary-color); font-size: 0.9rem; }
.colleague-role { color: var(--text-secondary); font-size: 0.8rem; }
.colleague-center { color: var(--primary-light); font-size: 0.75rem; }
.colleague-card.same-center .colleague-center { color: var(--primary-color); font-weight: 600; }

.faq-item { border-bottom: 1px solid #e2e8f0; margin-bottom: 8px; }
.faq-question {
  width: 100%; padding: 16px 0; display: flex; gap: 12px; background: none;
  border: none; cursor: pointer; font-size: 1rem; text-align: left;
}
.faq-answer { max-height: 0; overflow: hidden; transition: 0.3s; color: var(--text-secondary); }
.faq-answer.show { max-height: 200px; padding-bottom: 16px; }

footer {
  background: var(--primary-color); color: white; padding: 24px; text-align: center;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .appointment-card { padding: 20px; }
  .student-name { font-size: 2rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .org-chart-layout { flex-direction: column; }
  .diagram-box { min-width: 80px; padding: 8px 12px; font-size: 0.75rem; }
}