/* 艾拉米官网后台样式
 * 结构类名沿用远航 CRM 后台（login-mask / sidebar / topbar / view / modal / toast），
 * 主色换成官网品牌色 #14508C，保持与 www.ailami.cn 的观感一致。 */

:root {
  --primary: #14508C;
  --primary-d: #0E3A68;
  --primary-l: #E8F1FA;
  --bg: #F6F8FA;
  --card: #fff;
  --text: #1E2429;
  --text-2: #8A949C;
  --text-3: #B7BEC4;
  --line: #E2E7EB;
  --red: #E34D4D;
  --green: #1F9D55;
  --orange: #D97A1A;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-box { width: 340px; padding: 24px; text-align: center; }
.login-mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 10px; background: var(--primary); color: #fff;
  font-size: 26px; font-weight: 600; line-height: 56px;
}
.login-title { font-size: 20px; font-weight: 600; }
.login-sub { color: var(--text-2); font-size: 13px; margin-bottom: 24px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

@media (max-width: 480px) {
  .login-box { width: calc(100vw - 32px); max-width: 340px; padding: 20px 16px; }
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex: 0 0 200px;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 6px; flex: 0 0 32px;
  background: var(--primary); color: #fff; text-align: center; line-height: 32px; font-weight: 600;
}
.brand-text { display: flex; flex-direction: column; overflow: hidden; }
.brand-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.brand-en { font-size: 11px; color: var(--text-2); }

.nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-group { padding: 12px 16px 4px; font-size: 11px; color: var(--text-3); letter-spacing: .5px; }
.nav-item {
  display: block; padding: 9px 16px; color: var(--text);
  cursor: pointer; border-left: 3px solid transparent; font-size: 14px;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-l); border-left-color: var(--primary); color: var(--primary-d); font-weight: 600; }

.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.me-name { font-size: 13px; font-weight: 600; }
.me-role { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: 0 0 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.hint { font-size: 12px; color: var(--text-2); }
.view { padding: 20px; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-danger { color: var(--red); border-color: #F3C9C9; }
.btn-danger:hover { background: #FDF1F1; border-color: var(--red); color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .field select, .field textarea {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 4px;
  font-size: 13px; outline: none; background: #fff; color: var(--text);
  font-family: inherit;
}
.input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.7; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input, .toolbar select { width: auto; min-width: 140px; height: 32px; }
.toolbar .grow { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-2); font-weight: 500; background: #FAFCFD; white-space: nowrap; }
tbody tr:hover { background: #FAFCFD; }
td.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.t-center { text-align: center; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-size: 12px; background: var(--bg); color: var(--text-2); border: 1px solid var(--line);
}
.tag-on { background: #EAF6EE; color: var(--green); border-color: #C6E8D2; }
.tag-off { background: #FBF1F1; color: var(--red); border-color: #F0D3D3; }
.tag-draft { background: var(--primary-l); color: var(--primary-d); border-color: #CFE0F1; }
.tag-pub { background: #EAF6EE; color: var(--green); border-color: #C6E8D2; }

.empty { padding: 40px 0; text-align: center; color: var(--text-2); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); }

/* ---------- 概览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px;
}
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 24px; font-weight: 600; color: var(--primary-d); line-height: 1.4; }
.stat-sub { font-size: 12px; color: var(--text-3); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--text-2); }
.field .tip { font-size: 12px; color: var(--text-3); }

.kv-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.kv-row .input { flex: 1; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check-item input { width: auto; height: auto; margin: 0; }

.cover-preview {
  width: 100%; max-width: 240px; border: 1px solid var(--line); border-radius: 4px;
  display: block; margin-top: 8px; background: var(--bg);
}

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 36, 41, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 200;
}
.modal { background: #fff; border-radius: 8px; width: 720px; max-width: 100%; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600;
}
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-2); }
.modal-body { padding: 16px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: rgba(30, 36, 41, .92); color: #fff; padding: 8px 18px;
  border-radius: 4px; font-size: 13px; z-index: 300;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { width: 160px; flex-basis: 160px; }
}
