/**
 * style.css —— 国潮风 / 毕业季主题样式
 */

/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(180deg, #fff9f0 0%, #fff0e0 100%);
  min-height: 100vh;
  color: #333;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  outline: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: #ff6b35; }
textarea { resize: vertical; min-height: 80px; }

/* ==================== 导航栏 ==================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}
.navbar .logo {
  font-size: 18px;
  font-weight: bold;
  color: #d4380d;
  display: flex;
  align-items: center;
  gap: 6px;
}
.navbar .logo::before {
  content: '🎓';
  font-size: 20px;
}
.navbar .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.navbar .nav-links a {
  font-size: 14px;
  color: #666;
  transition: color 0.2s;
}
.navbar .nav-links a:hover, .navbar .nav-links a.active {
  color: #ff6b35;
  font-weight: bold;
}
.navbar .nav-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
}
.navbar .nav-btn.secondary {
  background: #f5f5f5;
  color: #666;
}

/* ==================== 页面容器 ==================== */
.page {
  display: none;
  padding-top: 56px;
  min-height: 100vh;
}
.page.active { display: block; }
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* ==================== 登录弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  width: 360px;
  max-width: 90%;
  padding: 32px 28px 24px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 8px;
}
.modal-title {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}
.modal-form .form-group {
  margin-bottom: 16px;
}
.modal-form .form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}
.modal-form .btn-login {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  margin-top: 8px;
}
.modal-form .error-msg {
  color: #e53935;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
}
.modal-footer {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 16px;
}

/* ==================== 首页同学墙 ==================== */
.home-header {
  text-align: center;
  padding: 30px 20px 20px;
}
.home-header h1 {
  font-size: 26px;
  color: #d4380d;
  margin-bottom: 6px;
}
.home-header p {
  font-size: 14px;
  color: #888;
}
.search-box {
  max-width: 400px;
  margin: 0 auto 20px;
  position: relative;
}
.search-box input {
  padding-left: 40px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

/* 长条卡片 */
.student-strip {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.student-strip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.student-strip .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.student-strip .info {
  flex: 1;
}
.student-strip .name {
  font-size: 17px;
  font-weight: bold;
  color: #d4380d;
}
.student-strip .class {
  font-size: 13px;
  color: #d4380d;
  opacity: 0.8;
  margin-top: 2px;
}
.student-strip .arrow {
  font-size: 18px;
  color: #ccc;
  transition: transform 0.2s;
}
.student-strip.expanded .arrow {
  transform: rotate(90deg);
}

/* 展开的小卡片 */
.mini-card {
  background: #fffbf5;
  border-radius: 0 0 12px 12px;
  padding: 16px 20px;
  margin: -6px 0 14px 20px;
  border-left: 3px solid #ff6b35;
  display: none;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.mini-card.show { display: block; }
.mini-card .field-row {
  display: flex;
  padding: 6px 0;
  font-size: 14px;
}
.mini-card .field-label {
  color: #888;
  width: 90px;
  flex-shrink: 0;
}
.mini-card .field-value {
  color: #333;
  flex: 1;
}
.mini-card .field-value.red {
  color: #d4380d;
  font-weight: bold;
}
.mini-card .privacy-mask {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 13px;
}
.mini-card .privacy-mask button {
  background: none;
  border: none;
  color: #ff6b35;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

/* ==================== 个人主页 / 我的主页 ==================== */
.profile-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.profile-header .big-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.profile-header .titles h2 {
  font-size: 22px;
  color: #d4380d;
}
.profile-header .titles .sub {
  font-size: 14px;
  color: #888;
  margin-top: 2px;
}

.profile-fields .field {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.profile-fields .field:last-child { border-bottom: none; }
.profile-fields .field label {
  width: 100px;
  color: #888;
  flex-shrink: 0;
}
.profile-fields .field span {
  color: #333;
  flex: 1;
}

/* 编辑模式 */
.edit-form .form-row {
  margin-bottom: 14px;
}
.edit-form .form-row label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}
.edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.edit-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
}
.edit-actions .btn-save {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
}
.edit-actions .btn-cancel {
  background: #f5f5f5;
  color: #666;
}

/* 权限管理 */
.perm-section h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}
.perm-section .perm-desc {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

/* 注销按钮 */
.danger-btn {
  background: none;
  border: none;
  color: #e53935;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 0;
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

/* ==================== 管理员后台 ==================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 56px;
}
.admin-sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid #eee;
  padding: 20px 0;
  position: fixed;
  top: 56px; bottom: 0; left: 0;
}
.admin-sidebar .menu-item {
  display: block;
  padding: 12px 24px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-sidebar .menu-item:hover, .admin-sidebar .menu-item.active {
  color: #ff6b35;
  background: #fff5f0;
  font-weight: bold;
}
.admin-content {
  flex: 1;
  margin-left: 200px;
  padding: 24px;
  max-width: calc(100% - 200px);
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-content h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #333;
}

/* 表格 */
.data-table {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 14px;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.data-table th {
  background: #fafafa;
  font-weight: bold;
  color: #666;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .actions button {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 6px;
  cursor: pointer;
}
.data-table .actions .btn-view {
  background: #e3f2fd;
  color: #1976d2;
}
.data-table .actions .btn-del {
  background: #ffebee;
  color: #c62828;
}

/* 批量导入区域 */
.import-area {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.import-area .btn-group {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.import-area button {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}
.import-area button.secondary {
  background: #f5f5f5;
  color: #666;
}
.import-area textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 10px;
  font-family: monospace;
  font-size: 13px;
}
.import-area .hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #bbb;
}
.empty-state .icon { font-size: 48px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* ==================== 模态框（通用） ==================== */
.detail-modal .modal-body {
  max-height: 60vh;
  overflow-y: auto;
  margin: 16px 0;
}
.detail-modal .detail-row {
  display: flex;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}
.detail-modal .detail-row label {
  width: 100px;
  color: #888;
  flex-shrink: 0;
}
.detail-modal .detail-row span {
  color: #333;
  flex: 1;
  word-break: break-all;
}

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
  .admin-sidebar { width: 160px; }
  .admin-content { margin-left: 160px; max-width: calc(100% - 160px); padding: 16px; }
  .navbar .nav-links { gap: 12px; }
  .navbar .nav-links a { font-size: 13px; }
  .container { padding: 12px; }
  .profile-card { padding: 20px; }
}
