/* ============================================
   云上学术 — 统一主题文件
   用于所有PC端 + 手机端页面
   ============================================ */

/* ── Core Variables (matches admin.html) ── */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;
  --primary-subtle: #dbeafe;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: rgba(37,99,235,0.2);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --cream: #f8f9fb;
  --cream-dark: #eef0f4;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Header gradient for mobile */
  --header-gradient: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%);
  --card-gradient: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Mixins ── */
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
.badge.pending { background: var(--warning-bg); color: var(--warning); }
.badge.approved { background: var(--success-bg); color: var(--success); }
.badge.rejected { background: var(--danger-bg); color: var(--danger); }
.badge.draft { background: var(--bg-page); color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border: none;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Region tags ── */
.region-tag { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.region-tag.r1 { background: #dbeafe; color: #1d4ed8; }
.region-tag.r2 { background: #dcfce7; color: #15803d; }
.region-tag.r3 { background: #fef3c7; color: #b45309; }
.region-tag.r4 { background: #f3e8ff; color: #7c3aed; }

/* ── Panels (for PC pages) ── */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.panel-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--primary); font-size: 16px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 14px;
  background: var(--bg-page);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px; font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle; color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }
tbody tr { transition: background var(--transition); }

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; color: var(--text-secondary);
  margin-bottom: 6px; font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; outline: none; color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Modal ── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000; align-items: center; justify-content: center;
  animation: modalFadeIn 0.15s ease;
}
.modal.show { display: flex; }
.modal-content {
  background: var(--bg-card); border-radius: var(--radius-xl);
  width: 800px; max-width: 92vw; max-height: 88vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  animation: modalSlideUp 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--text-muted); transition: color var(--transition);
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); background: var(--bg-page); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
