/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* 主色调 */
:root {
  --primary-color: #1a1a2e;
  --secondary-color: #4a6fa5;
  --accent-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f5f5f5;
  --white: #fff;
  --border-color: #e0e0e0;
}

/* 登录页样式 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 100%);
}

.login-box {
  background: var(--white);
  padding: 60px 50px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 400px;
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
}

.login-form .form-group {
  margin-bottom: 24px;
}

.login-form label {
  display: block;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover {
  background: #2c3e50;
}

.login-subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
  text-align: center;
}

.login-version {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 16px;
}

.login-error {
  color: #e74c3c;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  padding: 8px;
  background: #fdeaea;
  border-radius: 6px;
}

/* 后台布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: var(--primary-color);
  color: var(--white);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

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

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
}

.sidebar-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  display: block;
  padding: 14px 24px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-item.active {
  background: var(--secondary-color);
  color: var(--white);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px 30px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 提示栏 */
.tips-bar {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.tips-text {
  font-size: 13px;
  color: #856404;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--secondary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: #3d5d8a;
}

.btn-default {
  background: var(--white);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-default:hover {
  background: #f8f8f8;
}

.btn-danger {
  background: var(--white);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-danger:hover {
  background: var(--accent-color);
  color: var(--white);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--text-light);
  font-size: 13px;
}

.data-table td {
  font-size: 14px;
}

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

.data-table .actions {
  display: flex;
  gap: 8px;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.status-tag.published {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-tag.unpublished {
  background: #fff3e0;
  color: #e65100;
}

.status-tag.online {
  background: #e3f2fd;
  color: #1565c0;
}

.status-tag.offline {
  background: #fafafa;
  color: #757575;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 24px;
}

/* 编辑表单 */
.edit-form .form-row {
  margin-bottom: 16px;
}

.edit-form label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.edit-form input,
.edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.edit-form input:focus,
.edit-form textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fdeaea;
  border-radius: 6px;
}

.form-success {
  color: #27ae60;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #e8f8f0;
  border-radius: 6px;
}

/* 宽弹窗 */
.modal-wide {
  width: 600px;
}

/* 表单分区 */
.form-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 16px;
}

/* 系统设置页面 */
.settings-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e0e0e0;
  max-width: 500px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

/* 底部版权 */
.admin-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 220px;
  padding: 12px 20px;
  background: var(--primary-color);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  text-align: center;
}

/* 复选框行 */
.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
}

/* 下拉框 */
.edit-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}

/* 设置区域 */
.settings-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.settings-form {
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-form .form-row {
  margin-bottom: 16px;
}

.settings-form label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.settings-form input,
.settings-form textarea,
.settings-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.settings-form input:focus,
.settings-form textarea:focus,
.settings-form select:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.settings-form .form-actions {
  margin-top: 20px;
}

/* 二维码预览弹窗 */
.qrcode-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.qrcode-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.qrcode-row:last-child {
  margin-bottom: 0;
}

.qrcode-row label {
  font-size: 13px;
  color: #666;
  width: 80px;
  flex-shrink: 0;
}

.qrcode-row span,
.qrcode-row code {
  font-size: 13px;
  color: #333;
}

.qrcode-row code {
  background: #e8eef5;
  padding: 2px 8px;
  border-radius: 4px;
  color: #4a6fa5;
}

.qrcode-preview {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.qrcode-preview canvas {
  max-width: 100%;
}

.qrcode-tips {
  text-align: center;
  color: #999;
  margin-bottom: 16px;
}

/* 封面图上传 */
.cover-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-status {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.upload-status.uploading {
  color: #4a6fa5;
}

.upload-status.success {
  color: #27ae60;
}

.upload-status.error {
  color: #e74c3c;
}
