/* ====================================
   会议报名与评价系统 - 全局样式
   移动端优先，蓝色主题
   ==================================== */

/* CSS 变量 */
:root {
  --primary: #1565C0;
  --primary-light: #1E88E5;
  --primary-lighter: #42A5F5;
  --primary-bg: #E3F2FD;
  --accent: #0D47A1;
  --bg: #F0F4F8;
  --card-bg: #FFFFFF;
  --text: #212121;
  --text-secondary: #616161;
  --text-muted: #9E9E9E;
  --border: #E0E0E0;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --warning: #E65100;
  --danger: #C62828;
  --danger-bg: #FFEBEE;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(21, 101, 192, 0.10);
  --shadow-hover: 0 4px 24px rgba(21, 101, 192, 0.18);
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

/* ====== 页面布局 ====== */

.page-wrapper {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* 顶部 Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 32px 20px 28px;
  text-align: center;
}

.hero h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.hero .meta {
  font-size: 14px;
  opacity: 0.85;
}

.hero .meta span {
  margin: 0 6px;
}

/* ====== 视图切换 ====== */

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ====== 首页选择卡片 ====== */

.action-section {
  padding: 28px 20px;
}

.action-section .section-title {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-btn {
  background: var(--card-bg);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--primary);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.card-btn:active {
  transform: scale(0.96);
  box-shadow: none;
}

.card-btn .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--primary-bg);
}

.card-btn .card-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
}

.card-btn .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ====== 表单区域 ====== */

.form-section {
  padding: 20px;
}

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

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.form-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

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

.form-group:last-of-type {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group label .required-mark {
  color: var(--danger);
  margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12);
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

/* 表单提示信息 */
.form-hint {
  font-size: 13px;
  color: var(--success);
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-hint.hidden {
  display: none;
}

/* ====== 按钮 ====== */

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  letter-spacing: 0.5px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--primary-bg);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ====== 评价问卷 ====== */

.eval-section {
  padding: 20px;
}

.eval-progress {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 12px;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.question-number {
  font-size: 12px;
  color: var(--primary-lighter);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.options-group {
  display: flex;
  gap: 10px;
}

.option-label {
  flex: 1;
}

.option-label input[type="radio"] {
  display: none;
}

.option-btn {
  display: block;
  text-align: center;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 2px solid;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.option-label.opt-good .option-btn {
  border-color: #2E7D32;
  color: #2E7D32;
}

.option-label.opt-mid .option-btn {
  border-color: #E65100;
  color: #E65100;
}

.option-label.opt-low .option-btn {
  border-color: #C62828;
  color: #C62828;
}

.option-label.opt-good input:checked + .option-btn {
  background: #2E7D32;
  color: #fff;
}

.option-label.opt-mid input:checked + .option-btn {
  background: #E65100;
  color: #fff;
}

.option-label.opt-low input:checked + .option-btn {
  background: #C62828;
  color: #fff;
}

/* ====== 成功页 ====== */

.success-view {
  padding: 48px 20px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 12px;
}

.success-msg {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ====== Toast 提示 ====== */

#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(33, 33, 33, 0.9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ====== Loading 遮罩 ====== */

#loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  display: none;
}

#loading.show {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--primary-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading .loading-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ====== 弹窗 ====== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  display: none;
}

.modal-overlay.show {
  display: flex;
}

.modal-sheet {
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 600px;
  animation: slideUp 0.25s ease-out;
}

.modal-sheet.modal-center {
  border-radius: var(--radius);
  max-width: 360px;
  margin: auto;
  animation: fadeIn 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ====== 页脚 ====== */

footer {
  padding: 24px 20px;
  text-align: center;
}

#admin-entry {
  font-size: 11px;
  color: #D0D0D0;
  cursor: pointer;
  user-select: none;
  letter-spacing: 1px;
}

#admin-entry:hover {
  color: var(--text-muted);
}

/* ====== 管理员页面（admin.html）====== */

.admin-hero {
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
  color: #fff;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-hero h1 {
  font-size: 18px;
  font-weight: 700;
}

.admin-login-box {
  max-width: 360px;
  margin: 60px auto;
  padding: 0 20px;
}

.admin-login-box .login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
}

.admin-login-box .login-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.admin-login-box h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.admin-panel {
  padding: 16px;
  display: none;
}

.admin-panel.show {
  display: block;
}

/* Tab 导航 */
.tab-nav {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
}

/* 操作栏 */
.action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.action-bar .btn {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  font-size: 14px;
}

/* 统计卡片 */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 数据表格（移动端横向滚动）*/
.table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 14px;
}

table th {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary-lighter);
}

table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover td {
  background: var(--primary-bg);
}

.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 15px;
}

/* 表格操作按钮 */
.table-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-sm:active {
  opacity: 0.7;
}

.btn-edit {
  background: var(--primary-bg);
  color: var(--primary);
}

.btn-del {
  background: var(--danger-bg);
  color: var(--danger);
}

/* 评价答案标签 */
.answer-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.answer-tag.good {
  background: #E8F5E9;
  color: #2E7D32;
}

.answer-tag.mid {
  background: #FFF3E0;
  color: #E65100;
}

.answer-tag.low {
  background: #FFEBEE;
  color: #C62828;
}

/* 管理员编辑弹窗 */
.edit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  display: none;
}

.edit-modal-overlay.show {
  display: flex;
}

.edit-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.2);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

.edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.edit-modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* 分隔符 */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* 登出按钮 */
.logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  font-family: inherit;
  padding: 4px 8px;
}

.logout-btn:hover {
  color: #fff;
}

/* 移动端响应式 */
@media (max-width: 400px) {
  .action-cards {
    grid-template-columns: 1fr;
  }

  .options-group {
    gap: 8px;
  }

  .option-btn {
    padding: 9px 0;
    font-size: 14px;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}
