:root {
  --accent: #2f6fd0;
  --accent-dark: #1f2a3a;
  --danger: #d64545;
  --success: #229e5e;
  --warn: #e48a20;
  --text: #40484f;
  --muted: #848c98;
  --line: #e3e8ee;
  /* 卡片外框色：比 --line 明显，避免白色背景上看不出卡片边界 */
  --card-border: #b8c2cf;
  /* 表格行分隔线：细但要看得清，方便区分每一行 */
  --row-line: #ccd5e0;
  --bg: #f2f5f9;
  --card: #ffffff;
  --nav-active: #e9f0fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }

/* ---------------- 落地页 ---------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2a3a 0%, #2f4a72 100%);
  color: #fff;
  padding: 24px;
}
.hero-inner { max-width: 720px; text-align: center; }
.hero h1 { font-size: 34px; margin: 0 0 16px; }
.hero p { font-size: 16px; line-height: 1.9; color: #c7d4e6; margin: 0 0 12px; }
.hero .actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; }
.hero .btn { height: 44px; padding: 0 32px; font-size: 15px; }
.hero .features {
  display: flex; gap: 18px; justify-content: center; margin-top: 44px; flex-wrap: wrap;
}
.hero .feature {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 13px;
  color: #dbe5f2;
}

/* ---------------- 登录 / 注册 ---------------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #1f2a3a 0%, #2f4a72 100%); }

/* 登录/注册：左侧广告 + 右侧表单 */
.auth-wrap { display: flex; gap: 28px; align-items: stretch; justify-content: center; width: 100%; max-width: 960px; }

.ad-panel {
  position: relative;
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 38px 34px 30px;
  border-radius: 16px;
  overflow: hidden;
  color: #eaf1fb;
  background: linear-gradient(150deg, #26456f 0%, #1b2b42 62%, #16223a 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.30);
}
/* 右上角光晕装饰 */
.ad-panel::after {
  content: '';
  position: absolute;
  right: -90px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 150, 230, 0.45), transparent 70%);
  pointer-events: none;
}
.ad-badge {
  align-self: flex-start;
  padding: 6px 15px;
  border-radius: 20px;
  background: linear-gradient(135deg, #4a8be0, #2f6fd0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  position: relative;
}
.ad-title {
  margin: 20px 0 10px;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 800;
  color: #ffffff;
  position: relative;
}
.ad-title em { font-style: normal; color: #7fb0ff; }
.ad-desc { margin: 0 0 22px; font-size: 14px; line-height: 1.7; color: #a8bdd8; position: relative; }

.ad-tags { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.ad-tags span {
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #dbe7f7;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-tags span:hover { background: rgba(95, 150, 230, 0.34); border-color: #7fb0ff; color: #fff; }

.ad-foot {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8ba3c2;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
}

.auth-card {
  position: relative;
  width: 480px;
  flex-shrink: 0;
  padding: 46px 46px 38px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.30);
}
/* 顶部彩色条，让表单卡片更醒目 */
.auth-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a8be0, #7fb0ff);
}
.auth-card h1 { margin: 0 0 8px; font-size: 24px; }
.auth-sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.auth-card label { display: block; margin: 18px 0 8px; font-size: 13px; color: #5b6472; font-weight: 600; }
/* 输入框用更深的外框 + 浅底，白底卡片上边界才看得清 */
.auth-card input[type="text"], .auth-card input[type="password"] {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--card-border);
  background: #fafbfd;
  border-radius: 10px; font-size: 15px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.auth-card input[type="text"]:focus, .auth-card input[type="password"]:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 208, 0.14);
}
.auth-card .btn { width: 100%; height: 48px; margin-top: 28px; font-size: 16px; }
.auth-error { min-height: 18px; margin-top: 14px; color: var(--danger); font-size: 13px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.captcha-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.captcha-row img { cursor: pointer; border-radius: 10px; display: block; border: 1px solid var(--card-border); }
.captcha-row input {
  flex: 1; height: 46px; padding: 0 14px;
  border: 1px solid var(--card-border);
  background: #fafbfd;
  border-radius: 10px; outline: none; font-size: 15px;
}
.captcha-row input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(47, 111, 208, 0.14); }

/* 窄屏放不下并排，隐藏广告栏，只留表单 */
@media (max-width: 900px) {
  .ad-panel { display: none; }
  .auth-card { width: 100%; max-width: 480px; padding: 36px 28px 30px; }
}

/* ---------------- 顶栏：标题绝对居中 ---------------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-left { flex: 1; }
/* 用绝对定位保证标题精确居中，不受左右两侧内容宽度影响 */
.topbar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.topbar-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.brand { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.user { color: var(--muted); font-size: 13px; }

/* ---------------- 通用 ---------------- */
.content { padding: 20px; }
.panel-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* 商城面板标题（子页已移到左侧项目栏，这里只显示当前子页名） */
.shop-panel-title { font-size: 15px; font-weight: 600; color: var(--text); }
/* 管理后台的用户列表：平台账号行是分组标题（可展开），玩家行折叠在它下面 */
.grid tr.group-row > td { font-weight: 600; background: #fff; }
.grid tr.sub-row > td { background: #f7f9fc; }
.grid tr.sub-row > td:first-child { padding-left: 26px; }
button.admin-toggle {
  width: 20px; height: 20px; margin-right: 6px; padding: 0;
  border: 1px solid var(--card-border); border-radius: 4px;
  background: #fff; color: var(--text);
  font-family: inherit; font-size: 11px; line-height: 1; cursor: pointer;
}
button.admin-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

.panel select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}
.muted { color: var(--muted); font-size: 13px; }
.text-danger { color: #d93025; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.chip-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 8px; background: #f2f6fb; border: 1px solid var(--card-border); font-size: 13px;
}
.chip-item button {
  border: 0; background: transparent; color: #d93025; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px;
}
.chip-empty { color: var(--muted); font-size: 13px; }
.btn {
  height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent);
  color: #fff; font-size: 13px; cursor: pointer;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: #eceff4; color: #3c424c; }
.btn-danger { background: var(--danger); }
.btn-small { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-ok { background: #e6f6ed; color: var(--success); }
.tag-warn { background: #fdf1e0; color: var(--warn); }
.tag-off { background: #f0f2f5; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------------- 服务器卡片 ---------------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.server-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.server-card h3 { margin: 0; font-size: 16px; }
.server-card .addr { color: var(--muted); font-size: 13px; font-family: Consolas, monospace; }
.server-card .meta { font-size: 12px; color: var(--muted); }
.server-card .card-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.server-card.disabled { opacity: 0.65; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(20, 26, 36, 0.45); align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { width: 460px; max-height: 90vh; overflow-y: auto; padding: 22px 24px; background: var(--card); border-radius: 12px; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3); }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal label { display: block; margin: 14px 0 6px; font-size: 13px; color: #5b6472; font-weight: 600; }
.modal input[type="text"], .modal input[type="number"], .modal input[type="password"] {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--card-border);
  background: #fafbfd;
  border-radius: 8px; outline: none;
}
.modal select {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--card-border);
  background: #fafbfd;
  border-radius: 8px; outline: none;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.modal input:focus, .modal select:focus { border-color: var(--accent); background: #fff; }
.modal .row { display: flex; gap: 10px; }
.modal .row > div { flex: 1; }
.modal .switch { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--text); font-size: 13px; }
/* 封禁方式单选：三选一 */
.modal .radio-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.modal .radio-item {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 15px;
  border: 2px solid var(--card-border);
  border-radius: 9px;
  background: #fafbfd;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.modal .radio-item:hover { border-color: #8fb3e0; }
.modal .radio-item input { margin: 0; }
.modal .radio-item:has(input:checked) {
  border-color: var(--accent);
  background: #eef4ff;
  color: var(--accent);
  font-weight: 600;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-error { min-height: 18px; margin-top: 12px; color: var(--danger); font-size: 13px; }

/* ---------------- 仪表盘：统计卡片 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { margin-top: 8px; font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-value.warn { color: var(--warn); }

/* ---------------- 仪表盘：标签页 ---------------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border: 0; border-radius: 8px 8px 0 0; background: transparent;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.tab.active { background: var(--card); color: var(--accent); font-weight: 700; }

.panel { display: none; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 0 12px 12px 12px; }
.panel.active { display: block; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th {
  padding: 11px 12px; background: #f7f9fc; color: var(--muted); font-weight: 600;
  text-align: left; white-space: nowrap; border-bottom: 1px solid var(--card-border);
}
/* 行分隔线加粗加深，并配合隔行浅底，方便区分每一行 */
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--row-line); white-space: nowrap; }
.grid tbody tr:nth-child(even) { background: #fafbfd; }
.grid tbody tr:hover { background: #eef5ff; }
.grid .empty { text-align: center; color: var(--muted); padding: 26px 0; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* ---------------- 列表分页条 ---------------- */
/* 由 app.js 的 renderPager 动态插在 .table-wrap 后面，所以每张表都自动带分页。 */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.pager-info { font-size: 13px; color: var(--muted); }
.pager-btns { display: flex; align-items: center; gap: 6px; }
.pager-now { font-size: 13px; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.pager-btns button[disabled] { opacity: .45; cursor: not-allowed; }
.pager-size {
  height: 28px; padding: 0 8px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}

/* ---------------- 玩家截图 ---------------- */
.shot-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.shot-card {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.shot-card .shot-img {
  width: 100%; display: block; border-radius: 6px; background: #111;
  aspect-ratio: 16 / 9; object-fit: contain;
}
.shot-placeholder {
  aspect-ratio: 16 / 9; border-radius: 6px; background: #f2f4f7;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 0 12px;
}
.shot-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 13px; font-weight: 600;
}
.shot-meta { font-size: 12px; color: var(--muted); }
.shot-fail { font-size: 12px; color: var(--danger); word-break: break-all; }
.shot-status {
  font-size: 11px; font-weight: 400; padding: 2px 6px; border-radius: 4px;
  background: #eef1f5; color: var(--muted); white-space: nowrap;
}
.shot-status-done { background: #e7f6ec; color: #1f8a4c; }
.shot-status-pending, .shot-status-captured { background: #fff5e0; color: #a86a00; }
.shot-status-failed { background: #fdecec; color: #c0392b; }

/* ---------------- 柱状图 ---------------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 260px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 46px; min-height: 3px; background: linear-gradient(180deg, #5b93e4, #2f6fd0); border-radius: 6px 6px 0 0; }
.bar-value { font-size: 12px; color: var(--accent); margin-bottom: 5px; }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 8px; white-space: nowrap; }

.topbar .back { color: var(--muted); font-size: 13px; margin-right: 12px; }
.topbar .title { font-size: 16px; font-weight: 700; }

/* ---------------- 后台布局：左侧整条项目栏 + 右侧内容 ---------------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 左侧项目栏：深色，整条贯穿页面高度；功能菜单在上，服务器信息固定在左下角 */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #1f2a3a;
  border-right: 1px solid #16202e;
  overflow: hidden;
}
.sidebar .side-top { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 0; }
.sidebar .side-bottom {
  flex: 0 0 auto;
  max-height: 46vh;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .side-title {
  padding: 16px 18px 8px;
  font-size: 12px;
  color: #74869e;
  letter-spacing: 1px;
}

/* 功能菜单：置于最上方，第一项为「在线玩家」
   每项做成带独立边框的小卡片，选项之间边界清晰 */
button.nav-item {
  display: block;
  width: calc(100% - 20px);
  box-sizing: border-box;
  margin: 0 10px 8px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c7d4e6;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  border-left-color: #8ab6ff;
}
button.nav-item.active {
  background: rgba(47, 111, 208, 0.85);
  color: #ffffff;
  border-color: rgba(138, 182, 255, 0.95);
  border-left-color: #8ab6ff;
  font-weight: 600;
}

/* 父菜单（如「商城」）：右侧带展开箭头 */
button.nav-item.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
button.nav-item.nav-parent .nav-caret { font-size: 12px; opacity: 0.9; }

/* 子菜单：缩进显示，父项选中时展开；同样保留边框，只是更细更淡 */
.nav-children { display: none; }
.nav-children.open { display: block; }
button.nav-item.nav-child {
  width: calc(100% - 36px);
  margin-left: 26px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #a9bad0;
  border-color: rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}
button.nav-item.nav-child:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  border-left-color: #8ab6ff;
}
button.nav-item.nav-child.active {
  background: rgba(47, 111, 208, 0.85);
  color: #ffffff;
  border-color: rgba(138, 182, 255, 0.95);
  border-left-color: #8ab6ff;
  font-weight: 600;
}

/* 服务器列表 */
button.server-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 16px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #c7d4e6;
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
button.server-item:hover { background: rgba(255, 255, 255, 0.07); }
button.server-item.active {
  background: rgba(47, 111, 208, 0.32);
  color: #ffffff;
  border-left-color: #8ab6ff;
  font-weight: 600;
}
button.server-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button.nav-item:focus-visible, button.server-item:focus-visible {
  outline: 2px solid #8ab6ff;
  outline-offset: -2px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #55637a; flex-shrink: 0; }
.dot.ok { background: #34c77b; }
.dot.bad { background: #ff6b6b; }

.side-divider { height: 1px; margin: 12px 0; background: rgba(255, 255, 255, 0.08); }
.side-quota { padding: 10px 18px; font-size: 12px; color: #74869e; }
.side-hint { padding: 8px 18px; font-size: 13px; color: #74869e; }

.main { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg); }

.settings-form { max-width: 560px; }
.settings-form label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.settings-form input[type="text"], .settings-form input[type="number"], .settings-form input[type="password"] {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; outline: none;
}
.settings-form input:focus { border-color: var(--accent); }
.settings-form .row { display: flex; gap: 12px; }
.settings-form .row > div { flex: 1; }
.settings-form .switch { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; }
.settings-form .actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.settings-form .danger-zone { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------------- 聊天/日志面板底部的消息输入栏 ---------------- */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--card-border);
  background: #f4f7fb;
}
.chat-input-bar textarea {
  flex: 1;
  height: 138px;
  padding: 12px 14px;
  border: 2px solid var(--card-border);
  background: #ffffff;
  border-radius: 10px;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-bar textarea::placeholder { color: #98a2b0; }
.chat-input-bar textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 208, 0.16);
}
.chat-input-bar .btn { height: 46px; padding: 0 22px; flex-shrink: 0; }

/* ---------------- 在线玩家列表（单列，自上而下） ---------------- */
.player-list { overflow-y: auto; padding-right: 4px; }
.player-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.player-item + .player-item { margin-top: 10px; }
.player-item:hover { border-color: #bcd3f2; box-shadow: 0 6px 18px rgba(47, 111, 208, 0.10); }

.player-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5b93e4, #2f6fd0);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.player-main { flex: 1; min-width: 0; }

.player-head { display: flex; align-items: center; gap: 8px; }
.player-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ping-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  background: #e8f7ef;
  color: var(--success);
}
.ping-badge.mid { background: #fdf3e3; color: var(--warn); }
.ping-badge.bad { background: #fdebeb; color: var(--danger); }

.player-line {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-line .label { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; color: #a6aeb9; }
.player-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 在线玩家卡片里的生存状态标签（血量 / 血 / 饥饿 / 口渴）：越低越红，一眼能看出状态 */
.player-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stat-chip {
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
  background: #eef2f7;
  color: #44506a;
  border: 1px solid #d8e0ec;
}
.stat-chip.mid { background: #fff6e5; color: var(--warn); border-color: #f0d9a8; }
.stat-chip.low { background: #fdecec; color: var(--danger); border-color: #f3c2c2; }

/* 物资日志里被判为可疑的行：淡橙底 + 原因写在下面 */
.grid tr.row-suspect > td { background: #fffaf3; }
.suspect-reason { display: block; margin-top: 4px; font-size: 12px; color: var(--warn); }

/* ---------------- 地图页（玩家位置 + 运动轨迹） ---------------- */
.map-wrap { position: relative; width: 100%; max-width: 880px; }
.map-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #eef3f9;
  cursor: grab;              /* 可以按住拖动平移 */
  user-select: none;
  touch-action: none;
}
.map-wrap canvas.map-grabbing { cursor: grabbing; }

/* 悬停标记点的浮层：玩家名 + 坐标 + 该点时间。pointer-events:none 是必须的，
   否则鼠标一压上去就触发 mouseleave/enter 抖动闪屏。 */
.map-tip {
  position: absolute;
  display: none;
  z-index: 5;
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}
.map-tip b { font-size: 13px; }
.map-tip-tag { color: var(--muted); }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  color: var(--text);
}
.map-legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

.panel-note {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  background: #fdf3e3;
  color: #a86413;
  border: 1px solid #f6e0c2;
}

/* ---------------- 在线玩家：最左玩家列表 + 右侧整块聊天/日志 ---------------- */
.players-layout { display: flex; gap: 16px; align-items: stretch; }
.players-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.log-panel {
  flex: 1;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  position: sticky;
  top: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.chat-status { flex: 1; text-align: right; font-size: 12px; font-weight: 400; color: var(--muted); }
.chat-body {
  flex: 1;
  min-height: 440px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 12px;
}
.chat-msg {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg + .chat-msg { margin-top: 4px; }
.chat-msg .who { color: var(--accent); font-weight: 600; margin-right: 6px; }
.chat-msg .at {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
  font-family: Consolas, "Courier New", monospace;
}
.chat-msg.admin { background: #eef4ff; }
.chat-msg.admin .who { color: #1c5bb8; }
.chat-msg.server { color: #6b7280; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.chat-empty { color: var(--muted); text-align: center; padding: 60px 0; font-size: 13px; }

/* ---------------- 在线玩家页：整页不滚动，玩家列表与日志区各自内部滚动 ---------------- */
.main.no-scroll { overflow: hidden; }
.main.no-scroll #content { display: flex; flex-direction: column; height: 100%; }
.main.no-scroll .stats { flex: 0 0 auto; }
.main.no-scroll #panel-players {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.main.no-scroll .players-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.main.no-scroll .players-left { min-height: 0; }
.main.no-scroll .player-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* 日志区撑满剩余高度，不再限制最大高度 */
.main.no-scroll .log-panel { align-self: stretch; position: static; min-height: 0; }
.main.no-scroll .chat-body { flex: 1 1 auto; min-height: 0; max-height: none; }

/* ---------------- 服务器设置：服务器信息卡片 ---------------- */
.server-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}
.server-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f7faff;
  border-bottom: 1px solid var(--card-border);
}
.server-card-head .dot { width: 10px; height: 10px; }
.server-card-title { flex: 1; min-width: 0; }
.server-card-name { font-size: 16px; font-weight: 700; color: var(--text); }
.server-card-addr {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
}
.server-card-status {
  flex-shrink: 0;
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #e8f7ef;
  color: var(--success);
}
.server-card-status.bad { background: #fdebeb; color: var(--danger); }
.server-card .settings-form { padding: 20px; }
/* 卡片内已有内边距，去掉原来贴边的间距 */
.server-card .settings-form .panel-toolbar { margin-bottom: 4px; }
.server-card .settings-form .danger-zone { border-top: 1px solid var(--line); }

/* 窄屏时玩家列表与日志面板改为上下排列，避免日志区被压扁 */
@media (max-width: 1180px) {
  .players-layout { flex-direction: column; }
  .players-left { width: 100%; }
  .log-panel { width: 100%; min-width: 0; position: static; }
  /* 堆叠后无法在一屏内放下，改为整块滚动；玩家列表限制高度、自带滚动条 */
  .main.no-scroll #panel-players { overflow-y: auto; }
  .main.no-scroll .players-left { flex: 0 0 auto; }
  .main.no-scroll .player-list { flex: 0 0 auto; max-height: 320px; }
  .main.no-scroll .log-panel { flex: 0 0 auto; }
  .main.no-scroll .chat-body { min-height: 320px; }
}




