/* ========================================
   iOS 简约毛玻璃风格 - 全局样式
   配色遵循 iOS 系统规范
   ======================================== */

/* 页面标题 */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; color: #1C1C1E; }
.page-subtitle { font-size: 14px; color: #8E8E93; margin-bottom: 16px; }

/* 详情区 */
.detail-section { margin-bottom: 20px; }
.detail-label { font-size: 13px; color: #8E8E93; margin-bottom: 8px; font-weight: 500; }
.detail-content { font-size: 15px; color: #1C1C1E; line-height: 1.6; }

/* 消息提示 */
.msg { text-align: center; margin-top: 16px; font-size: 15px; }
.msg-success { color: #34C759; }
.msg-error { color: #FF3B30; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #F2F2F7;
  color: #1C1C1E;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 容器 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px 24px;
}

/* ========================================
   毛玻璃导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  color: #1C1C1E;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-links a {
  font-size: 15px;
  color: #007AFF;
  text-decoration: none;
  transition: opacity 0.2s;
}

.navbar-links a:hover {
  opacity: 0.7;
}

.navbar-user {
  font-size: 15px;
  color: #8E8E93;
}

/* ========================================
   卡片
   ======================================== */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: #007AFF;
  color: #fff;
}

.btn-primary:hover {
  background: #0066d6;
}

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

.btn-secondary {
  background: #fff;
  color: #007AFF;
  border: 1px solid #007AFF;
}

.btn-secondary:hover {
  background: rgba(0, 122, 255, 0.04);
}

.btn-danger {
  background: #FF3B30;
  color: #fff;
}

.btn-danger:hover {
  background: #d6342a;
}

.btn-success {
  background: #34C759;
  color: #fff;
}

.btn-success:hover {
  background: #28a745;
}

.btn-block {
  width: 100%;
}

.btn + .btn {
  margin-left: 8px;
}

/* ========================================
   表单
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 8px;
  font-size: 15px;
  color: #1C1C1E;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: #007AFF;
}

.form-input::placeholder {
  color: #C7C7CC;
}

textarea.form-input {
  height: auto;
  padding: 12px 16px;
  min-height: 100px;
  resize: vertical;
}

select.form-input {
  appearance: auto;
}

/* ========================================
   表格
   ======================================== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

table th {
  background: #F2F2F7;
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}

table td {
  font-size: 15px;
  padding: 14px 16px;
  border-top: 0.5px solid rgba(60,60,67,0.12);
  color: #1C1C1E;
}

/* ========================================
   题目卡片（答题页）
   ======================================== */
.question-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.question-title {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #1C1C1E;
  line-height: 1.6;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  background: rgba(0, 122, 255, 0.04);
  border-color: #007AFF;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: #007AFF;
}

.option-item.selected {
  background: rgba(0, 122, 255, 0.08);
  border-color: #007AFF;
}

.result-correct {
  color: #34C759;
  font-weight: 500;
  margin-top: 12px;
  font-size: 15px;
}

.result-wrong {
  color: #FF3B30;
  font-weight: 500;
  margin-top: 12px;
  font-size: 15px;
}

.explanation-box {
  background: #F2F2F7;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  font-size: 15px;
  color: #1C1C1E;
  line-height: 1.6;
}

/* ========================================
   错题本
   ======================================== */
.wrong-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.wrong-question {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
  color: #1C1C1E;
  line-height: 1.6;
}

.wrong-answer {
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.wrong-answer.user {
  color: #FF3B30;
}

.wrong-answer.correct {
  color: #34C759;
}

.wrong-explanation {
  background: #F2F2F7;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  font-size: 15px;
  color: #1C1C1E;
  line-height: 1.6;
}

/* ========================================
   统计卡片（仪表盘）
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-label {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #1C1C1E;
}

/* ========================================
   搜索页专用
   ======================================== */
.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-input {
  flex: 1;
}

.result-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.result-section {
  margin-bottom: 20px;
}

.result-section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 6px;
  font-weight: 500;
}

.section-content {
  font-size: 15px;
  color: #1C1C1E;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.section-content.question {
  font-weight: 500;
  padding: 16px;
  background: #F2F2F7;
  border-radius: 8px;
}

.section-content.answer {
  color: #007AFF;
  font-weight: 600;
  font-size: 17px;
}

.section-content.sources a {
  color: #007AFF;
  margin-right: 12px;
  text-decoration: none;
}

.section-content.sources a:hover {
  text-decoration: underline;
}

.result-note {
  font-size: 13px;
  color: #8E8E93;
  text-align: center;
  padding: 16px;
  background: #F2F2F7;
  border-radius: 8px;
}

.feedback-btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.feedback-btn {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.feedback-btn.correct {
  background: #34C759;
  color: #fff;
}

.feedback-btn.wrong {
  background: #FF3B30;
  color: #fff;
}

.feedback-btn:hover {
  opacity: 0.85;
}

/* ========================================
   会员中心 / 设备管理
   ======================================== */
.member-status {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.member-level {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 8px;
}

.member-level-value {
  font-size: 20px;
  font-weight: 600;
  color: #007AFF;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(60,60,67,0.12);
}

.status-row:last-child {
  border-bottom: none;
}

.status-label {
  font-size: 15px;
  color: #8E8E93;
}

.status-value {
  font-size: 15px;
  font-weight: 500;
  color: #1C1C1E;
}

.level-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.level-trial {
  background: #FFF3E0;
  color: #E65100;
}

.level-member {
  background: #E8F5E9;
  color: #1B5E20;
}

.level-expired {
  background: #FCE4EC;
  color: #C62828;
}

.device-list {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.device-item {
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(60,60,67,0.12);
}

.device-item:last-child {
  border-bottom: none;
}

.device-name {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #1C1C1E;
}

.device-info {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 2px;
}

/* ========================================
   后台管理菜单
   ======================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-menu-item {
  display: block;
  padding: 24px 20px;
  text-align: center;
  background: #fff;
  border-radius: 14px;
  color: #1C1C1E;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.admin-menu-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.admin-menu-item .menu-title {
  font-size: 15px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.admin-menu-item .menu-desc {
  font-size: 13px;
  color: #8E8E93;
  font-weight: 400;
  display: block;
}

/* ========================================
   消息提示
   ======================================== */
.msg {
  text-align: center;
  margin-top: 16px;
  font-size: 15px;
}

.msg-success {
  color: #34C759;
}

.msg-error {
  color: #FF3B30;
}

.msg-info {
  color: #8E8E93;
}

.loading {
  text-align: center;
  color: #8E8E93;
  padding: 24px;
  font-size: 15px;
}

/* ========================================
   输入框组合
   ======================================== */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}

.filter-row .form-input {
  width: auto;
}

/* ========================================
   登录/注册页
   ======================================== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 40px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-title {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  color: #1C1C1E;
}

.auth-btn {
  width: 100%;
  height: 44px;
  background: #007AFF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: #0066d6;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 15px;
  color: #8E8E93;
}

.auth-link a {
  color: #007AFF;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* ========================================
   卡片列表区域
   ======================================== */
.card-list-box {
  max-height: 200px;
  overflow-y: auto;
  background: #F2F2F7;
  padding: 16px;
  border-radius: 8px;
  margin: 8px 0;
  font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========================================
   详情展开区
   ======================================== */
.expand-detail {
  background: #F2F2F7;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 0;
}

.expand-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0;
  font-size: 13px;
  font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

.round-item {
  border-bottom: 0.5px solid rgba(60,60,67,0.12);
  padding: 12px 0;
  margin-bottom: 8px;
}

.round-item:last-child {
  border-bottom: none;
}

/* ========================================
   响应式
   ======================================== */
/* ========================================
   向后兼容 - quiz.js 使用的旧类名
   ======================================== */
.md3-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.md3-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 8px;
  font-size: 15px;
  color: #1C1C1E;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.md3-input:focus {
  border-color: #007AFF;
}

.md3-input::placeholder {
  color: #C7C7CC;
}

.md3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  background: #007AFF;
  color: #fff;
  line-height: 1;
}

.md3-btn:hover {
  background: #0066d6;
}

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

.md3-card .question {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #1C1C1E;
  line-height: 1.6;
}

.md3-card .option {
  margin: 0;
  padding: 0;
  border-radius: 0;
}

.md3-card .option label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.md3-card .option label:hover {
  background: rgba(0, 122, 255, 0.04);
  border-color: #007AFF;
}

.md3-card .option label input[type="radio"],
.md3-card .option label input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: #007AFF;
}

.md3-card .result {
  font-weight: 500;
  margin-top: 12px;
  font-size: 15px;
  min-height: 1.5em;
}

.md3-card .result.correct {
  color: #34C759;
}

.md3-card .result.incorrect {
  color: #FF3B30;
}

.md3-card .explanation {
  background: #F2F2F7;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  font-size: 15px;
  color: #1C1C1E;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .container {
    padding: 72px 16px 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

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

  .navbar {
    padding: 0 16px;
  }

  .navbar-links {
    gap: 10px;
  }

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

  .filter-row {
    flex-direction: column;
  }

  .filter-row .form-input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 32px 24px;
  }
}