/* ========================================
   能碳管理学 - 管理端样式
   ======================================== */

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px; color: #333;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== 登录页 ===== */
.login-body {
  background: linear-gradient(135deg, #0a3d62 0%, #1a6d3f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo {
  font-size: 48px;
  margin-bottom: 8px;
}
.login-header h1 {
  font-size: 24px;
  color: #0a3d62;
  font-weight: 900;
  letter-spacing: 2px;
}
.login-header p {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}
.login-form .form-group {
  margin-bottom: 18px;
}
.login-form label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}
.login-form label i { margin-right: 6px; color: #1a7d3f; }
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.login-form input:focus { border-color: #1a7d3f; }
.login-error {
  background: #fdecea;
  color: #c0392b;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #0a3d62, #1a7d3f);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
}
.btn-login:hover { opacity: 0.9; }
.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.login-footer a {
  color: #888;
  font-size: 13px;
}
.login-footer a:hover { color: #1a7d3f; }

/* ===== 管理后台布局 ===== */
.dashboard-body {
  background: #f0f2f5;
  min-height: 100vh;
}
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
  width: 230px;
  background: #1a2633;
  color: #ccc;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #2c3e50;
}
.brand-icon { font-size: 28px; }
.sidebar-brand strong { display: block; font-size: 15px; color: #fff; }
.sidebar-brand small { font-size: 11px; color: #888; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 13.5px;
  color: #bbb;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(26,125,63,0.2);
  color: #27ae60;
  border-left-color: #27ae60;
}
.nav-item i { width: 18px; text-align: center; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #2c3e50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-outline {
  display: block;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 12.5px;
  color: #bbb;
  transition: all 0.2s;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* 主内容区 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-topbar {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar h2 { font-size: 18px; color: #222; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-badge {
  font-size: 13px;
  color: #555;
  padding: 5px 12px;
  background: #f0f9f4;
  border-radius: 4px;
}
.btn-save-all {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-save-all:hover { background: #1e8449; }

/* 内容面板 */
.admin-content { padding: 20px 24px; flex: 1; overflow-y: auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 概览卡片 */
.overview-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.ov-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}
.ov-card:hover { transform: translateY(-3px); }
.ov-card i { font-size: 28px; color: #1a7d3f; margin-bottom: 6px; }
.ov-num { font-size: 32px; font-weight: 900; color: #222; }
.ov-label { font-size: 12px; color: #888; margin-top: 4px; }

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  color: #222;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 18px; }
.card-body p { font-size: 13.5px; color: #555; line-height: 1.8; }

/* 可编辑内容区域 */
.edit-section {
  margin-bottom: 20px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}
.edit-section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f5e9;
}
.section-head h3 {
  font-size: 15px;
  color: #0a3d62;
  margin: 0;
}

/* 表单字段（带标签） */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  padding-left: 2px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #1a7d3f;
  box-shadow: 0 0 0 3px rgba(26,125,63,0.1);
}
.form-field textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.6;
}
.form-field select {
  cursor: pointer;
  appearance: auto;
}

/* 预览框 */
.preview-box {
  transition: opacity 0.2s;
}

/* 徽标 */
.badge {
  display: inline-block;
  font-size: 11px;
  color: #888;
  background: #eee;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  margin-left: 8px;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2980b9;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.btn-add:hover { background: #2471a3; }

/* 文档管理 */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.doc-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.doc-card .doc-icon {
  font-size: 36px;
  color: #1a7d3f;
  margin-bottom: 8px;
}
.doc-card .doc-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}
.doc-card .doc-meta {
  font-size: 11px;
  color: #888;
  margin-bottom: 12px;
}
.doc-card .doc-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* 文件上传区域 */
.upload-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone:hover {
  border-color: #1a7d3f;
  background: #f0f9f4;
}
.upload-zone i { font-size: 32px; color: #aaa; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: #888; }

/* 按钮通用 */
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; font-weight: 500; }
.btn-sm-green { background: #27ae60; color: #fff; }
.btn-sm-green:hover { background: #1e8449; }
.btn-sm-red { background: #e74c3c; color: #fff; }
.btn-sm-red:hover { background: #c0392b; }
.btn-sm-blue { background: #2980b9; color: #fff; }
.btn-sm-blue:hover { background: #2471a3; }

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #27ae60;
  color: #fff;
  padding: 14px 22px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 9999;
  animation: slideUp 0.3s ease;
}
.toast.error { background: #e74c3c; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 响应式 */
@media (max-width: 1024px) {
  .overview-cards { grid-template-columns: repeat(3, 1fr); }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 8px; }
  .nav-item { padding: 8px 12px; font-size: 12px; border-left: none; }
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
}
