:root {
  --teal-900: #123f2c;
  --teal-700: #17553a;
  --teal-600: #1c6a47;
  --teal-500: #2c8059;
  --teal-100: #e7f0e9;
  --teal-50: #f1f6f0;
  --amber: #c08a2e;
  --red: #c9524c;
  --green: #2f8a5c;
  --ink: #17251d;
  --ink-2: #46564c;
  --ink-3: #8c9a91;
  --line: #ece8dd;
  --bg: #f6f3ec;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 37, 29, .04), 0 10px 26px rgba(23, 37, 29, .05);
}

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

html, body { height: 100%; }

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

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--teal-600); text-decoration: none; }
::selection { background: #bde7e6; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 12% -10%, #e2ede3 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, #f1ece0 0%, transparent 55%),
    #f8f5ee;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 60px rgba(12, 58, 68, .12);
  border: 1px solid #ece8dd;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo .mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(140deg, var(--teal-500), var(--teal-700));
  display: grid; place-items: center; font-size: 24px;
  box-shadow: 0 6px 16px rgba(18, 128, 143, .28);
}
.login-logo h1 { font-size: 21px; letter-spacing: .5px; }
.login-logo span { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
.login-card p.sub { color: var(--ink-3); font-size: 13px; margin: 14px 0 26px; line-height: 1.7; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: #fbfaf6; outline: none; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal-500); background: #fff; box-shadow: 0 0 0 3px rgba(23, 150, 159, .12);
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--ink-3); text-align: center; }
.login-error { color: var(--red); font-size: 13px; margin-top: -4px; margin-bottom: 12px; display: none; }

/* ---------- 布局 ---------- */
.shell { display: none; min-height: 100vh; }
.shell.active { display: flex; }

.sidebar {
  width: 218px; flex: 0 0 218px;
  background: #fbfaf6;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--teal-500), var(--teal-700)); font-size: 18px;
}
.brand b { font-size: 15.5px; letter-spacing: .5px; }
.brand em { display: block; font-size: 11px; color: var(--ink-3); font-style: normal; letter-spacing: .6px; }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: var(--ink-3); padding: 14px 10px 6px; letter-spacing: .8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--ink-2); font-size: 13.5px; margin-bottom: 2px; transition: .15s;
  position: relative;
}
.nav a .ico { font-family: "tdesign" !important; font-size: 15px; width: 18px; text-align: center;  width: 18px; text-align: center; opacity: .85; font-size: 15px; }
.nav a:hover { background: var(--teal-50); color: var(--teal-700); }
.nav a.on { background: var(--teal-100); color: var(--teal-700); font-weight: 600; }
.nav a .badge {
  margin-left: auto; background: var(--amber); color: #fff; font-size: 11px;
  padding: 1px 6px; border-radius: 20px; font-weight: 600;
}
.side-foot { padding: 14px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; }
.side-user .av {
  width: 34px; height: 34px; border-radius: 50%; background: var(--teal-100);
  color: var(--teal-700); display: grid; place-items: center; font-weight: 600;
}
.side-user b { font-size: 13px; display: block; }
.side-user span { font-size: 11.5px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 26px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16.5px; font-weight: 600; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.content { padding: 22px 26px 40px; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px;
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); cursor: pointer; transition: .15s; white-space: nowrap; font-size: 13.5px;
}
.btn:hover { border-color: #c8dbdd; background: #fafdfd; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  border-color: transparent; color: #fff; font-weight: 500;
  box-shadow: 0 4px 12px rgba(18, 128, 143, .22);
}
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--teal-600); }
.btn.ghost:hover { background: var(--teal-50); }
.btn.danger { color: var(--red); border-color: #f0d4d3; background: #fffafa; }
.btn.danger:hover { background: #fdf2f2; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; background: #f2f7f8; padding: 4px; border-radius: 10px; }
.tabs button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
  cursor: pointer; color: var(--ink-2); font-size: 13px; transition: .15s;
}
.tabs button.on { background: #fff; color: var(--teal-700); font-weight: 600; box-shadow: 0 1px 3px rgba(16,45,55,.1); }

.search {
  display: flex; align-items: center; gap: 8px; background: #f7fafb;
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 36px; min-width: 220px;
}
.search input { border: 0; background: transparent; outline: none; flex: 1; height: 100%; }
.search span { color: var(--ink-3); font-size: 14px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px;
  border-radius: 50%; background: var(--teal-50);
}
.stat .k { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 27px; font-weight: 650; letter-spacing: -.5px; margin: 7px 0 2px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11.5px; color: var(--ink-3); }
.stat .d b { color: var(--teal-600); font-weight: 600; }
.stat.warn .v { color: var(--amber); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500;
  padding: 11px 14px; background: #fafcfc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid #f0f5f6; vertical-align: middle; font-size: 13.5px; }
tbody tr:hover { background: #fbfaf6; }
tbody tr:last-child td { border-bottom: 0; }
.t-main { font-weight: 550; }
.t-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.t-name { display: flex; align-items: center; gap: 10px; }
.t-name .thumb {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  background: linear-gradient(140deg, var(--green-50), var(--green-100));
  display: grid; place-items: center; overflow: hidden;
  font-size: 18px; border: 1px solid #e6ede5;
}
.t-name .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 图标占位（无图时的统一降级） */
.ico-ph { font-family: "tdesign" !important; font-size: 19px; color: #9fb0a4; }
.av-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: -8px; margin-right: 4px; }
.av-txt {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--green-100); color: var(--green-800);
  font-size: 12px; font-weight: 600; vertical-align: -7px; margin-right: 4px;
}
.empty .e .t-icon { font-size: 30px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 3px 9px; border-radius: 20px; background: #f0f5f6; color: var(--ink-2);
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.pass { background: #eaf7f0; color: var(--green); }
.pill.wait { background: #fdf3e5; color: #c07a1f; }
.pill.reject { background: #fdeeee; color: var(--red); }
.tag {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: var(--teal-50); color: var(--teal-700); margin: 1px 4px 1px 0;
}

.pager { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pager .info { font-size: 12.5px; color: var(--ink-3); }
.pager .spacer { flex: 1; }

.empty { text-align: center; padding: 52px 20px; color: var(--ink-3); }
.empty .e { font-size: 34px; opacity: .5; margin-bottom: 10px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(11, 45, 55, .32); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 20px; overflow-y: auto;
}
.mask.on { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px;
  box-shadow: 0 30px 80px rgba(9, 40, 50, .25); animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; background: none; border: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.modal.wide { max-width: 860px; }
.modal.wide .modal-body { max-height: 72vh; overflow-y: auto; }
.form-sec {
  font-size: 12.5px; font-weight: 600; color: var(--teal-700, #2f6b52);
  margin: 4px 0 10px; padding-left: 9px; border-left: 3px solid #bcd8c4;
  letter-spacing: .3px;
}
.form-sec + .form-grid { margin-bottom: 16px; }
.form-sec:not(:first-child) { margin-top: 18px; }
.switch-row { display: flex; align-items: center; gap: 8px; padding-top: 9px; font-size: 12.5px; color: var(--ink-3); }
.switch-row input { width: 16px; height: 16px; accent-color: #2f6b52; }
.switch-row span { line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line);
  background: #fbfaf6; cursor: pointer; font-size: 12.5px; color: var(--ink-2); transition: .15s;
  font-family: inherit; line-height: 1.7;
}
.chip.on { background: var(--teal-100); border-color: #bcd8c4; color: var(--teal-700); font-weight: 550; }
.card-body .chips { padding-bottom: 14px; }

/* ---------- 内容卡片（可点进模块） ---------- */
.stat.link {
  display: block; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.stat.link:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(23, 37, 29, .09); }
.stat-go {
  position: absolute; right: 14px; bottom: 14px;
  font-size: 13px; color: #b6c2b8;
}

/* ---------- 攻略章节编辑器 ---------- */
.g-no {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--teal-50); color: var(--teal-700); font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sec-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink); margin: 18px 0 10px;
}
.sec-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--bg-soft, #fbfaf6);
}
.sec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sec-h {
  flex: 1; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink); padding: 4px 2px; outline: none;
}
.sec-p {
  width: 100%; min-height: 74px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; padding: 9px 11px; font-size: 13px; line-height: 1.7;
  color: var(--ink-2); font-family: inherit; outline: none; resize: vertical;
}
.sec-p:focus, .sec-h:focus { border-color: var(--teal-500); }
.preview-row { margin-top: 12px; }
.preview-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; display: block; }

/* ---------- 图表 ---------- */
.chart-wrap { padding: 8px 4px 0; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.donut-legend .num { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); }

.hot-list { display: flex; flex-direction: column; }
.hot-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eef4f5; }
.hot-item:last-child { border-bottom: 0; }
.hot-item .rank {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; background: #f1f7f8; color: var(--ink-3);
}
.hot-item:nth-child(1) .rank { background: var(--teal-100); color: var(--teal-700); }
.hot-item:nth-child(2) .rank { background: #e9f3f9; color: #3d7ea8; }
.hot-item:nth-child(3) .rank { background: #fdf3e5; color: #b8791f; }
.hot-item .nm { font-size: 13.5px; font-weight: 500; }
.hot-item .mt { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.hot-item .val { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--teal-700); font-weight: 600; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #16333a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(10, 40, 50, .28); animation: drop .22s ease; max-width: 78vw;
}
.toast.err { background: #a83b38; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

.skeleton { color: var(--ink-3); padding: 40px; text-align: center; font-size: 13px; }

/* ---------- 小程序预览提示 ---------- */
.hint {
  background: linear-gradient(120deg, #f2f6ef, #f7fbfb); border: 1px dashed #cfe7e8;
  border-radius: 12px; padding: 13px 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75;
}
.hint b { color: var(--teal-700); }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: #eef6f7; padding: 2px 6px; border-radius: 5px; color: var(--teal-700);
}

/* 单行省略 */
.nowrap-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }

/* 鱼情表格：缩略图 + 文本 */
.rep-cell { display: flex; gap: 10px; align-items: flex-start; }
.rep-thumb {
  width: 58px; height: 58px; flex: 0 0 58px;
  object-fit: cover;
  border-radius: 9px;
  background: #eef4f5;
  border: 1px solid #e6eff1;
}
.rep-thumb.empty-thumb {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #a8bcc2;
  border-style: dashed;
  background: #f7fafb;
}
.rep-txt { min-width: 0; }
