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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Comic Sans MS", sans-serif;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
  color: #2c3e50;
}

.app { width: 100%; max-width: 1080px; }

.screen { margin: 0 auto; }

.card {
  background: #ffffff;
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.title {
  font-size: 40px;
  text-align: center;
  color: #ff6b6b;
  margin-bottom: 12px;
}

.subtitle { text-align: center; font-size: 20px; color: #576574; margin-bottom: 28px; }

.setting { text-align: center; margin-bottom: 28px; font-size: 20px; }
.setting select {
  font-size: 18px; padding: 8px 14px; border-radius: 12px;
  border: 2px solid #ffd93d; background: #fffef0; cursor: pointer;
}

.hint { text-align: center; color: #8395a7; font-size: 15px; margin-top: 22px; }

.btn {
  border: none; cursor: pointer; border-radius: 16px;
  font-weight: bold; transition: transform .08s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }

.btn-primary { background: #54a0ff; color: #fff; box-shadow: 0 6px 0 #2e86de; }
.btn-primary:hover { background: #48dbfb; }
.btn-primary.big { display: block; width: 320px; margin: 0 auto; font-size: 26px; padding: 18px 0; }

.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 22px; font-weight: bold; margin-bottom: 10px; color: #fff;
}
.progress, .score-board { background: rgba(0,0,0,.18); padding: 6px 16px; border-radius: 14px; }

.progress-bar { height: 14px; background: rgba(255,255,255,.4); border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#1dd1a1,#10ac84); transition: width .3s ease; }

.question-card { text-align: center; margin-bottom: 26px; }
.q-text { font-size: 28px; margin-bottom: 18px; color: #341f97; }

.btn-play {
  background: #ff9ff3; color: #fff; font-size: 22px; padding: 14px 30px;
  box-shadow: 0 6px 0 #f368e0;
}
.btn-play:hover { background: #f368e0; }

.timer { margin-top: 16px; font-size: 20px; color: #ee5253; font-weight: bold; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.option {
  background: #feca57; color: #2c3e50; font-size: 40px; font-weight: bold;
  padding: 34px 0; border-radius: 22px; box-shadow: 0 8px 0 #ff9f43;
  text-align: center; user-select: none;
}
.option:hover { background: #ff9f43; color: #fff; }
.option.correct { background: #1dd1a1; color: #fff; box-shadow: 0 8px 0 #10ac84; }
.option.wrong { background: #ff6b6b; color: #fff; box-shadow: 0 8px 0 #ee5253; }
.option:disabled { cursor: default; opacity: .9; }

/* 结果页 */
.summary { text-align: center; margin: 10px 0 26px; }
.summary .big-score { font-size: 56px; color: #ff6b6b; font-weight: bold; }
.summary .meta { font-size: 20px; color: #576574; margin-top: 10px; }

.detail-table { width: 100%; border-collapse: collapse; margin-bottom: 26px; font-size: 16px; }
.detail-table th, .detail-table td { border: 1px solid #dfe6e9; padding: 10px 8px; text-align: center; }
.detail-table th { background: #f1f2f6; color: #2f3542; }
.detail-table tr:nth-child(even) td { background: #fafafa; }
.tag-ok { color: #10ac84; font-weight: bold; }
.tag-no { color: #ee5253; font-weight: bold; }
.replay-btn { background: #54a0ff; color: #fff; border: none; border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.replay-btn:hover { background: #2e86de; }

.hidden { display: none !important; }

/* 顶栏与菜单 */
.topbar { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 20px; padding: 14px 24px; box-shadow: 0 10px 24px rgba(0,0,0,.1); margin-bottom: 26px; }
.brand { font-size: 26px; font-weight: bold; color: #ff6b6b; }
.top-actions { display: flex; gap: 14px; align-items: center; }
.link-btn { background: none; border: none; color: #54a0ff; font-size: 17px; cursor: pointer; font-weight: bold; text-decoration: none; }
.link-btn:hover { color: #2e86de; text-decoration: underline; }

.menu-title { text-align: center; color: #341f97; font-size: 26px; margin-bottom: 22px; }
.menu-group-title { font-size: 20px; color: #576574; margin: 18px 4px 8px; font-weight: bold; }
.menu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.menu-card { background: #fff; border: none; border-radius: 22px; padding: 30px 10px; cursor: pointer; box-shadow: 0 10px 22px rgba(0,0,0,.1); transition: transform .1s ease; }
.menu-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0,0,0,.16); }
.mc-emoji { font-size: 46px; }
.mc-name { font-size: 22px; font-weight: bold; color: #2c3e50; margin-top: 8px; }

.text-q { font-size: 30px; line-height: 1.4; }

/* 登录 */
.login-card { max-width: 420px; margin: 40px auto; }
#login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
#login-form label { display: flex; flex-direction: column; font-size: 16px; color: #576574; gap: 6px; }
#login-form input { padding: 12px 14px; border-radius: 12px; border: 2px solid #dfe6e9; font-size: 17px; }
.err { color: #ee5253; text-align: center; font-size: 15px; }

/* 后台 */
.tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.tab-btn { background: #fff; border: none; border-radius: 14px 14px 0 0; padding: 12px 22px; font-size: 18px; font-weight: bold; cursor: pointer; color: #8395a7; }
.tab-btn.active { background: #54a0ff; color: #fff; }
.tab-panel { background: #fff; border-radius: 0 18px 18px 18px; padding: 22px; box-shadow: 0 12px 30px rgba(0,0,0,.1); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.toolbar select { font-size: 16px; padding: 8px 12px; border-radius: 10px; border: 2px solid #ffd93d; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { border: 1px solid #ecf0f1; padding: 10px 8px; text-align: center; }
.admin-table th { background: #f1f2f6; color: #2f3542; }
.admin-table tr:nth-child(even) td { background: #fafbfc; }
.q-prompt { max-width: 240px; word-break: break-word; }
.mini-btn { border: none; border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: 14px; color: #fff; margin: 0 3px; }
.mini-btn.edit { background: #54a0ff; }
.mini-btn.del { background: #ff6b6b; }
.mini-btn.view { background: #1dd1a1; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 20px; padding: 28px; width: 520px; max-width: 92vw; max-height: 90vh; overflow: auto; }
.modal-box h3 { color: #341f97; margin-bottom: 16px; }
#q-form { display: flex; flex-direction: column; gap: 12px; }
#q-form label { display: flex; flex-direction: column; font-size: 15px; color: #576574; gap: 6px; }
#q-form input, #q-form select, #q-form textarea { padding: 10px 12px; border-radius: 10px; border: 2px solid #dfe6e9; font-size: 16px; font-family: inherit; }
.modal-actions { display: flex; gap: 12px; margin-top: 6px; }
.modal-actions .btn-primary { flex: 1; }

/* 顶栏登录态 / 角色标签 */
.top-actions { display: flex; align-items: center; gap: 14px; }
.hello { font-size: 17px; color: #2f3542; font-weight: bold; }
.role-badge { font-size: 13px; padding: 2px 10px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.role-badge.admin { background: #ffeaa7; color: #b8860b; }
.role-badge.user { background: #dff9ff; color: #0984e3; }

/* 登录页 / 注册页脚链 */
.login-foot { display: flex; justify-content: center; gap: 18px; margin-top: 16px; font-size: 15px; }

/* 用户管理弹窗表单 */
#user-form { display: flex; flex-direction: column; gap: 12px; }
#user-form label { display: flex; flex-direction: column; font-size: 15px; color: #576574; gap: 6px; }
#user-form input, #user-form select { padding: 10px 12px; border-radius: 10px; border: 2px solid #dfe6e9; font-size: 16px; font-family: inherit; }
