/* Admin Panel Styles */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: #f0f2f5; color: #333; }
a { color: #2563eb; text-decoration: none; }

/* Login Page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f172a, #1e3a5f); }
.login-wrapper { width: 420px; }
.login-card { background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon { width: 56px; height: 56px; background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; border-radius: 12px; margin-bottom: 12px; }
.login-logo h1 { font-size: 20px; color: #1e3a5f; }
.login-logo p { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* Admin Page Layout */
.admin-page { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 220px; background: linear-gradient(180deg, #0f172a, #1a2332); color: #fff;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform .3s;
  display: flex; flex-direction: column;
}
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo { width: 40px; height: 40px; background: linear-gradient(135deg, #2563eb, #fbbf24); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-title { font-size: 15px; font-weight: 600; }
.sidebar-sub { font-size: 11px; color: #64748b; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #94a3b8;
  font-size: 14px; transition: all .2s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.sidebar-nav a.active { background: rgba(37,99,235,.15); color: #fbbf24; border-left-color: #fbbf24; }
.sidebar-nav a i { font-size: 16px; width: 20px; text-align: center; }

/* Main Area */
.main-area { flex: 1; margin-left: 220px; }

/* Top Bar */
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex;
  align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.topbar-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #1e3a5f; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right a { font-size: 13px; color: #64748b; }
.topbar-right a:hover { color: #2563eb; }
.btn-logout { color: #ef4444 !important; }

/* Content */
.content { padding: 24px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 24px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); position: relative;
}
.stat-card .stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-card .stat-num { font-size: 32px; font-weight: 700; color: #1e3a5f; }
.stat-card .stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }
.stat-badge {
  position: absolute; top: 12px; right: 12px; background: #ef4444; color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
}

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-card { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.dashboard-card h3 { font-size: 16px; color: #1e3a5f; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #f1f5f9; }

/* Panel */
.panel { background: #fff; border-radius: 10px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel h3 { font-size: 16px; color: #1e3a5f; margin-bottom: 0; }
.table-more { display: block; text-align: right; font-size: 13px; color: #2563eb; margin-top: 12px; }

/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #1e3a5f; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
  outline: none; transition: border-color .2s; background: #f8fafc; font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #2563eb; background: #fff; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: 6px; font-weight: 600;
  font-size: 14px; cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #1e3a5f; color: #fff; }
.btn-secondary:hover { background: #152840; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Captcha */
.captcha-group .captcha-row { display: flex; gap: 12px; align-items: center; }
.captcha-group input { flex: 1; }
.captcha-group img { height: 40px; cursor: pointer; border-radius: 4px; border: 1px solid #e2e8f0; }

/* Error message */
.form-error { background: #fee2e2; color: #991b1b; padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.form-msg { padding: 12px 20px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; }
.form-msg.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 13px; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.table tbody td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }
.empty-msg { text-align: center; color: #94a3b8; padding: 24px; }

/* Status Badge */
.status-badge { font-size: 11px; padding: 3px 10px; border-radius: 4px; white-space: nowrap; }
.status-1 { background: #dcfce7; color: #166534; }
.status-0 { background: #fee2e2; color: #991b1b; }

/* Action Buttons */
.btn-action { font-size: 12px; padding: 4px 10px; border-radius: 4px; border: none; cursor: pointer; transition: all .15s; }
.btn-edit { background: #eff6ff; color: #2563eb; }
.btn-edit:hover { background: #dbeafe; }
.btn-duplicate { background: #f0fdf4; color: #16a34a; }
.btn-duplicate:hover { background: #dcfce7; }
.btn-delete { background: #fef2f2; color: #ef4444; }
.btn-delete:hover { background: #fee2e2; }

/* Params Section */
.params-section { margin-bottom: 20px; }
.params-section h4 { font-size: 14px; color: #1e3a5f; margin-bottom: 10px; }
.param-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.param-row input { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.btn-remove-param { background: #fee2e2; color: #ef4444; border: none; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; }
.btn-remove-param:hover { background: #fecaca; }

/* Image Upload */
.image-upload-area { margin-bottom: 8px; }
.image-preview { margin-bottom: 12px; }
.image-preview img { display: block; }
.image-hint { font-size: 12px; color: #64748b; margin-top: 6px; }

/* Badge */
.badge-count { display: inline-block; background: #eff6ff; color: #2563eb; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 12px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .topbar-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
