/* ============================================================
   志愿者报名系统 - 样式表
   ============================================================ */

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

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --danger: #e53935;
  --success: #34a853;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ===== 顶部导航 ===== */
.top-bar {
  background: #fff;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 19px; font-weight: 700; color: var(--primary); }
.nav-link { color: var(--primary); text-decoration: none; font-size: 14px; }
.nav-link:hover { text-decoration: underline; }

/* ===== 通用容器 ===== */
.wrap { max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.sec-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-export { background: var(--success); color: #fff; }
.btn-export:hover { opacity: .9; }
.btn-block { width: 100%; padding: 12px; }

/* ===== 日历 ===== */
.calendar-card { padding: 20px; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.cal-center { display: flex; align-items: center; gap: 12px; }
.week-range { font-size: 16px; font-weight: 700; }
.btn-today { font-size: 13px; padding: 4px 12px; background: var(--primary-light);
             color: var(--primary); border: none; border-radius: 4px; cursor: pointer; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-head { text-align: center; padding: 6px 0; font-weight: 600; color: var(--text-light); font-size: 13px; }
.cal-cell {
  text-align: center; padding: 14px 4px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
}
.cal-cell:hover { background: var(--primary-light); }
.cal-cell.sel { background: var(--primary); color: #fff; }
.cal-cell.today { border-color: var(--primary); }
.cal-cell .d-num { font-size: 18px; font-weight: 700; display: block; }
.cal-cell .d-cnt { font-size: 11px; margin-top: 2px; opacity: .8; }

/* ===== 日期标题栏 ===== */
.date-bar {
  font-size: 16px; font-weight: 700; margin-bottom: 14px; padding: 0 4px;
}

/* ===== 项目卡片 ===== */
.project-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.project-card {
  background: #fff; border-radius: var(--radius); padding: 20px;
  width: 330px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
}
.project-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; gap: 8px;
}
.project-head h3 { font-size: 17px; color: var(--primary); flex: 1; }
.badge {
  background: var(--primary-light); color: var(--primary);
  padding: 2px 10px; border-radius: 20px; font-size: 12px;
  font-weight: 600; white-space: nowrap;
}
.project-desc {
  color: var(--text-light); font-size: 13px; line-height: 1.7;
  margin-bottom: 14px; flex: 1;
}
.btn-signup {
  width: 100%; padding: 10px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-bottom: 14px; transition: background .15s;
}
.btn-signup:hover { background: var(--primary-dark); }
.btn-signup:disabled { background: #ccc; cursor: not-allowed; }

.vol-section { border-top: 1px solid var(--border); padding-top: 12px; }
.vol-title { font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 8px; }
.vol-list { display: flex; flex-direction: column; gap: 5px; }
.vol-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; background: #f8f9fa; border-radius: 5px; font-size: 14px;
}
.vol-item .v-name::before { content: "\1F464\00a0"; }
.btn-cancel-sm {
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 12px; padding: 2px 6px;
}
.btn-cancel-sm:hover { text-decoration: underline; }

.empty { text-align: center; color: var(--text-light); padding: 40px; font-size: 15px; width: 100%; }
.empty-vol { color: var(--text-light); font-size: 13px; padding: 8px 0; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 400px; max-width: 92%;
  max-height: 90vh; overflow-y: auto;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--text-light); line-height: 1;
}
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.reg-project-name { font-weight: 600; color: var(--primary); margin-bottom: 16px; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 5px; font-size: 14px; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}
.req { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-light); margin-left: 4px; }
.flex1 { flex: 1; min-width: 200px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===== 管理后台 ===== */
.login-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.login-box {
  background: #fff; padding: 32px; border-radius: 12px;
  width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.login-box h2 { text-align: center; margin-bottom: 20px; color: var(--primary); }

.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.welcome { font-size: 14px; color: var(--text-light); }

.admin-form { margin-top: 4px; }
.export-bar { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.export-bar .field { margin-bottom: 0; }

.admin-date-group { margin-bottom: 24px; }
.admin-date-group > h3 {
  font-size: 15px; color: var(--primary); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--primary-light);
}
.admin-proj {
  background: #f8f9fa; border-radius: 8px; padding: 16px; margin-bottom: 10px;
}
.admin-proj-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.admin-proj-head strong { font-size: 16px; }
.admin-proj-desc { color: var(--text-light); font-size: 13px; margin-bottom: 10px; }

.vol-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vol-table th { text-align: left; padding: 7px 8px; border-bottom: 2px solid var(--border); color: var(--text-light); }
.vol-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.vol-table tr:last-child td { border-bottom: none; }
.btn-del {
  padding: 4px 10px; background: var(--danger); color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.btn-del:hover { opacity: .85; }

/* ===== 消息提示 ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 24px;
  border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .3s; z-index: 2000; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .project-card { width: 100%; }
  .cal-grid { gap: 3px; }
  .cal-cell { padding: 10px 2px; }
  .cal-cell .d-num { font-size: 14px; }
  .form-row { flex-direction: column; }
  .export-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
}
