/* 雍陌艺术空间 - 新中式管理后台样式 */

:root {
  --color-primary: #5D4037;
  --color-primary-dark: #3E2723;
  --color-secondary: #8D6E63;
  --color-bg: #F5F0EB;
  --color-bg-light: #EFEBE9;
  --color-text: #3E2723;
  --color-text-light: #5D4037;
  --color-border: #D7CCC8;
  --color-white: #FFFFFF;
  --color-success: #4CAF50;
  --color-danger: #E53935;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* 登录页 */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 20px; }

.login-box {
  background: var(--color-white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-size: 24px;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 8px;
}

.login-box h2 {
  font-size: 16px;
  color: var(--color-text-light);
  text-align: center;
  margin-bottom: 30px;
  font-weight: normal;
}

/* 表单 */
.form-group { margin-bottom: 16px; }

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

textarea { resize: vertical; }

button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover { background: var(--color-primary-dark); }

.login-box button[type="submit"] {
  width: 100%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 16px;
  padding: 14px;
}

.login-box button[type="submit"]:hover { background: var(--color-primary-dark); }

.error-msg {
  color: var(--color-danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 18px;
}

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

.admin-header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 { font-size: 18px; font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 16px; }

.header-right button {
  background: rgba(255,255,255,0.15);
  color: var(--color-white);
  padding: 8px 16px;
}

.header-right button:hover { background: rgba(255,255,255,0.25); }

/* Tab切换 */
.tab-bar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  padding: 0 24px;
}

.tab-btn {
  background: none;
  color: var(--color-text-light);
  padding: 16px 24px;
  position: relative;
  font-size: 14px;
}

.tab-btn:hover { color: var(--color-primary); }

.tab-btn.active {
  color: var(--color-primary);
  font-weight: 500;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
}

/* 内容区 */
.admin-content { padding: 24px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-section {
  background: var(--color-white);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.panel-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--color-primary);
}

.panel-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.panel-toolbar select { width: auto; }

/* 统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--color-white);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-light);
}

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

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

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

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--color-bg); }

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

.data-table .actions button {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--color-bg-light);
  color: var(--color-text);
}

.data-table .actions .edit-btn:hover { background: #E3F2FD; color: #1565C0; }
.data-table .actions .del-btn:hover { background: #FFEBEE; color: var(--color-danger); }

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.status-badge.published { background: #E8F5E9; color: var(--color-success); }
.status-badge.draft { background: #FFF3E0; color: #E65100; }

/* 用户标签 */
.tag-small {
  display: inline-block;
  background: var(--color-bg-light);
  color: var(--color-text-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

/* 首页模块 */
.home-modules { display: flex; flex-direction: column; gap: 12px; }

.module-item {
  background: var(--color-white);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.module-icon { font-size: 32px; }

.module-info { flex: 1; }

.module-name { font-weight: 500; margin-bottom: 4px; }

.module-link { font-size: 12px; color: var(--color-text-light); }

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

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

.modal.active { display: flex; }

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

.modal-content h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--color-primary);
}

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

.form-actions button[type="submit"] {
  flex: 1;
  background: var(--color-primary);
  color: var(--color-white);
}

.form-actions button[type="button"] {
  flex: 1;
  background: var(--color-bg-light);
  color: var(--color-text);
}

@media (max-width: 1024px) {
  .tab-bar { padding: 0 16px; overflow-x: auto; }
  .admin-content { padding: 16px; }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
}

/* 首页配置 - 主图设置区块 */
.config-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
}
.config-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.form-row label {
  min-width: 80px;
  font-size: 13px;
  color: #666;
}
.form-row input[type="text"],
.form-row select {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
