/* 有鱼助手 · 后台管理系统（暖色调简洁风格） */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #F2761B;
  --brand-deep: #C1440E;
  --bg: #F6F1EA;
  --panel: #FFFFFF;
  --text: #3A2E23;
  --muted: #9C8C7C;
  --line: #EFE5D8;
  --green: #5B9A4C;
}
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); outline: none; }

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #F79B3C 0%, #C1440E 100%);
}
.login-box {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.login-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #F79B3C, #E86A12);
  margin: 0 auto 14px;
  position: relative;
}
.login-logo::before {
  content: ''; position: absolute; left: 14px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 16px 0 0 #fff;
}
.login-logo::after {
  content: ''; position: absolute; left: 12px; bottom: 12px;
  width: 32px; height: 12px; border-radius: 6px 6px 12px 12px; background: #fff;
}
.login-title { text-align: center; font-size: 22px; font-weight: 700; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.login-box input:focus { border-color: var(--brand); }
.login-err { color: var(--brand-deep); font-size: 13px; margin-bottom: 10px; min-height: 18px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  background: linear-gradient(180deg, #3A2A1B, #2C2014);
  color: #D9C9B4;
  flex-shrink: 0;
  padding: 20px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-logo { display: flex; align-items: center; padding: 6px 22px 20px; color: #fff; }
.side-logo .dot {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #F79B3C, #E86A12);
  margin-right: 12px; flex-shrink: 0;
  position: relative;
}
.side-logo .dot::before {
  content: ''; position: absolute; left: 8px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 10px 0 0 #fff;
}
.side-logo .dot::after {
  content: ''; position: absolute; left: 7px; bottom: 7px;
  width: 20px; height: 7px; border-radius: 4px 4px 8px 8px; background: #fff;
}
.side-logo b { font-size: 16px; }
.side-group { padding: 16px 22px 6px; font-size: 12px; opacity: .55; }
.side a {
  display: flex; align-items: center;
  padding: 12px 22px;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.on { background: rgba(242,118,27,.18); color: #FFD9AE; border-left-color: var(--brand); }
.side .ico { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 4px; margin-right: 12px; flex-shrink: 0; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .user { color: var(--muted); display: flex; align-items: center; gap: 14px; }
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #F79B3C, #E86A12);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.content { padding: 24px 28px 60px; }

/* 卡片 */
.card {
  background: var(--panel);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(120, 80, 40, .05);
}
.card h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; }
.card h3::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: var(--brand); margin-right: 10px;
}
.card .head-right { margin-left: auto; display: flex; gap: 10px; }

/* 统计块 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--panel);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(120, 80, 40, .05);
}
.stat .s-label { color: var(--muted); font-size: 13px; }
.stat .s-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat .s-value.brand { color: var(--brand-deep); }
.stat .s-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .s-sub em { font-style: normal; color: var(--green); }

/* 按钮 */
.btn {
  border: none;
  background: linear-gradient(135deg, #F79B3C, #E86A12);
  color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
}
.btn:hover { opacity: .92; }
.btn.plain { background: #fff; color: #6E5B49; border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--brand-deep); border: 1px solid #F0CDB6; }
.btn.sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #FBF7F1; }
tbody tr:hover { background: #FDF9F3; }
td .cover {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
  background: #FFF1E2; display: block;
}
.tag {
  display: inline-block;
  font-size: 12px;
  background: #FFF1E2; color: var(--brand-deep);
  border-radius: 5px; padding: 2px 8px;
}
.tag.green { background: #EAF4E6; color: var(--green); }
.tag.gray { background: #F0EAE2; color: var(--muted); }
.tag.red { background: #FBE9DF; color: var(--brand-deep); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }

/* 筛选条 */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff;
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs .tab {
  padding: 7px 16px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: #6E5B49; cursor: pointer;
}
.tabs .tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 弹窗 */
.overlay {
  position: fixed; inset: 0;
  background: rgba(40, 28, 16, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  width: 560px; max-width: 94vw; max-height: 88vh;
  background: #fff; border-radius: 16px; padding: 24px 26px;
  overflow-y: auto;
}
.modal.wide { width: 860px; }
.modal h3 { font-size: 16px; margin-bottom: 20px; }
.form-row { display: flex; align-items: flex-start; margin-bottom: 14px; }
.form-row label { width: 96px; color: #6E5B49; font-size: 13px; padding-top: 9px; flex-shrink: 0; }
.form-row .ctl { flex: 1; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=date],
.form-row input[type=datetime-local], .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.form-row textarea { height: 90px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--brand); }
.modal .foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.img-preview { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; background: #FFF1E2; display: block; margin-bottom: 8px; }
.chk-row { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 7px; }
.chk-row label { display: flex; align-items: center; gap: 5px; width: auto; padding: 0; }

/* 图表 */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.retention-cell { text-align: center; font-weight: 600; }
.ret-cell-0 { color: #C9BCAC; }
.ret-cell-1 { color: #E8A23D; }
.ret-cell-2 { color: #D9772A; }
.ret-cell-3 { color: var(--brand-deep); }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #3A2A1B; color: #fff; font-size: 13px;
  padding: 10px 22px; border-radius: 10px; z-index: 200;
  animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -8px); } }
