/* =====================
   GBMC 管理面板样式
   ===================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1C1B1A;
  background: #F5F7FA;
}

a { color: #2D6DA8; text-decoration: none; }
a:hover { color: #1B3A5C; }

/* ===== 布局 ===== */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  background: #0F2640;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: -0.02em;
}

.sidebar-logo span { color: #E8A838; }

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: #E8A838;
}

.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 12px 20px;
}

/* ===== 主内容区 ===== */
.main-content {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #1B3A5C;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6B6964;
}

.topbar-role {
  padding: 2px 8px;
  background: #F5F7FA;
  border-radius: 999px;
  font-size: 12px;
  color: #2D6DA8;
}

.content-body {
  padding: 32px;
  max-width: 1200px;
}

/* ===== Flash 消息 ===== */
.flash {
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.flash-success {
  background: #ECFDF5;
  color: #065F46;
  border-bottom: 1px solid #A7F3D0;
}

.flash-error {
  background: #FEF2F2;
  color: #DC2626;
  border-bottom: 1px solid #FECACA;
}

/* ===== 表格 ===== */
.table-wrap {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table th {
  background: #F9FAFB;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6B6964;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #F3F4F6;
}

.data-table tr:hover td {
  background: #F9FAFB;
}

.action-cell {
  white-space: nowrap;
}

/* ===== 表格内图片 ===== */
.table-thumb {
  width: 80px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
  background: #F9FAFB;
  display: block;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #1B3A5C;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary:hover { background: #2D6DA8; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #fff;
  color: #6B6964;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover { border-color: #2D6DA8; color: #2D6DA8; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #F5F7FA;
  color: #1B3A5C;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-sm:hover { border-color: #2D6DA8; color: #2D6DA8; }

.btn-danger {
  background: #FEF2F2;
  color: #DC2626 !important;
  border-color: #FECACA;
}

.btn-danger:hover { background: #FEE2E2; border-color: #FCA5A5; }

/* ===== 表单 ===== */
.admin-form { max-width: 900px; }

.form-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1B3A5C;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2D6DA8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(45,109,168,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== 预览图 ===== */
.image-preview {
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
  background: #F9FAFB;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(232,168,56,0.1);
  color: #B8860B;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin: 1px;
}

/* ===== 搜索栏 ===== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box input[type="text"] {
  padding: 9px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  width: 220px;
  transition: border-color 0.2s;
}

.search-box input[type="text"]:focus { border-color: #2D6DA8; outline: none; }

.sort-link {
  color: #6B6964;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}

.sort-link:hover { color: #1B3A5C; }
.sort-link .arrow { font-size: 10px; margin-left: 2px; }
.sort-link.active { color: #1B3A5C; font-weight: 700; }

/* ===== 多选 ===== */
.chk-col { width: 36px; text-align: center; }
.chk-all, .chk-item { cursor: pointer; width: 16px; height: 16px; }

.batch-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1E40AF;
}

.batch-bar.visible { display: flex; }
.batch-bar .count { font-weight: 700; }

/* ===== 分类标签 ===== */
.cat-tab {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: #6B6964 !important;
  text-decoration: none;
}

.cat-tab:hover { border-color: #2D6DA8; color: #2D6DA8 !important; }
.cat-tab.active { background: #1B3A5C; color: #fff !important; border-color: #1B3A5C; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-nav a { padding: 12px; justify-content: center; }
  .sidebar-nav a .nav-icon { margin: 0; }
  .sidebar-logo, .sidebar-nav a span { display: none; }
  .main-content { margin-left: 60px; }
  .content-body { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
}
