/* admin/css/admin.css */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; background: #f5f6f7; color: #1a1a1a; font-size: 14px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  background: #e6f3ef;
  color: #1e5751;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.file-info {
  background: #f5f6f7;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.8;
}
.file-info-row { color: #555; }
.file-info-label { color: #888; margin-right: 6px; }

.field-helper {
  background: #f0f7f5;
  color: #555;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  border-left: 3px solid #1e5751;
  line-height: 1.6;
}
.hint { font-size: 12px; color: #888; margin-top: 4px; }

/* ============== 登录页 ============== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e5751 0%, #2a6f67 100%);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  width: 380px;
  padding: 40px 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.login-card h1 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 22px;
  color: #1e5751;
}
.login-card .sub { text-align: center; color: #888; font-size: 13px; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #555; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
  background: #fafafa;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: #1e5751; outline: none; background: #fff;
}
.form-row { display: flex; gap: 8px; align-items: center; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.captcha-box {
  display: flex; align-items: center; gap: 8px;
}
.captcha-canvas {
  border: 1px solid #ddd; border-radius: 6px; background: #f5f6f7; cursor: pointer;
  width: 110px; height: 38px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 14px; transition: all 0.2s;
}
.btn-primary { background: #1e5751; color: #fff; }
.btn-primary:hover { background: #2a6f67; }
.btn-block { width: 100%; padding: 12px; }
.btn-ghost { background: transparent; border: 1px solid #ddd; color: #555; }
.btn-ghost:hover { border-color: #1e5751; color: #1e5751; }
.btn-danger { background: #d9534f; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-link { background: transparent; border: none; color: #1e5751; cursor: pointer; padding: 0; }
.error { color: #d9534f; font-size: 12px; margin-top: 8px; }
.ok { color: #1e5751; background: #e6f3ef; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-top: 8px; }
.hint { color: #888; font-size: 12px; margin-top: 4px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12px; color: #aaa; }

/* ============== 主框架 ============== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #1e5751; color: #fff;
  display: flex; flex-direction: column;
}
.brand {
  padding: 20px 24px; font-size: 18px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 8px;
}
.brand .logo { width: 28px; height: 28px; border-radius: 6px; background: #fff; color: #1e5751; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.nav { flex: 1; padding: 16px 0; }
.nav-item {
  padding: 12px 24px; cursor: pointer; color: rgba(255,255,255,0.85);
  display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #fff; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.user-box { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }
.user-box .name { font-weight: 500; }
.user-box .logout { color: rgba(255,255,255,0.6); cursor: pointer; font-size: 12px; margin-top: 4px; }
.user-box .logout:hover { color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: #fff; padding: 14px 24px; border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h2 { margin: 0; font-size: 18px; color: #1e5751; }
.topbar .breadcrumb { color: #888; font-size: 13px; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* ============== 卡片 ============== */
.card {
  background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 16px; overflow: hidden;
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: #333;
}
.card-body { padding: 20px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ============== 表格 ============== */
table { width: 100%; border-collapse: collapse; }
table th, table td {
  padding: 10px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
table th { background: #fafafa; color: #555; font-weight: 600; }
table tr:hover td { background: #fafdfc; }
table .actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-green { background: #e8f5ed; color: #2d7a3e; }
.badge-blue { background: #e6f3f3; color: #1e5751; }
.badge-red { background: #fdecea; color: #d9534f; }
.badge-gray { background: #f0f0f0; color: #666; }

/* ============== 弹窗 ============== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: 8px; width: 600px; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid #eee; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid #eee; display: flex; gap: 8px; justify-content: flex-end;
}
.modal-close { background: transparent; border: none; cursor: pointer; font-size: 18px; color: #999; }

.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: #fff; border-radius: 8px; padding: 18px; }
.stat-card .label { color: #888; font-size: 12px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: #1e5751; margin-top: 6px; }

.field-helper { background: #f6f8f8; border-left: 3px solid #1e5751; padding: 8px 12px; border-radius: 4px; color: #666; font-size: 12px; margin-bottom: 12px; }

.list-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #eee; }
.list-row .grow { flex: 1; }
.list-row .del { color: #d9534f; cursor: pointer; }
.list-row .del:hover { text-decoration: underline; }

.tag-input-wrap {
  border: 1px solid #ddd; border-radius: 6px; padding: 8px; min-height: 80px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start;
  background: #fafafa;
}
.tag-input-wrap .tag {
  background: #e6f3f3; color: #1e5751; padding: 2px 8px; border-radius: 4px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px;
}
.tag-input-wrap .tag .x { cursor: pointer; opacity: 0.6; }
.tag-input-wrap .tag .x:hover { opacity: 1; }
.tag-input-wrap input {
  flex: 1; min-width: 80px; border: none; outline: none; background: transparent; padding: 4px;
}
