/* 元恒鼎官网新闻后台 · 管理样式 */
:root {
  --navy: #102a43;
  --blue: #0A3C90;
  --gold: #C8963E;
  --line: #e3e8ef;
  --muted: #6b7785;
  --bg: #f5f7fa;
  --ok: #1a7f43;
  --warn: #b4690e;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: #1f2933;
  font: 14.5px/1.65 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: var(--blue); }

/* 顶栏 */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.tp-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 18px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.brand span { color: var(--gold); font-weight: 500; }
.tp-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.tp-nav a { color: #d7e2ee; text-decoration: none; }
.tp-nav a:hover, .tp-nav a.on { color: #fff; }
.tp-nav .btn-sm { border: 1px solid rgba(255,255,255,.45); padding: 5px 12px; border-radius: 4px; }
.tp-nav .btn-sm.on, .tp-nav .btn-sm:hover { background: rgba(255,255,255,.14); }
.tp-user { color: var(--gold); font-weight: 600; }
.tp-out { color: #9fb3c8 !important; }

/* 布局 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 50px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 21px; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 20px 34px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--blue); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: #24384c;
  padding: 8px 16px; border-radius: 5px; font-size: 14px; font-family: inherit;
  text-decoration: none; line-height: 1.4; transition: .18s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #082f72; }
.btn.ghost { background: transparent; }
.btn.warn { color: var(--warn); border-color: #f0d9b5; background: #fdf6e9; }
.btn.danger { color: var(--danger); border-color: #f3cdc9; background: #fdf1f0; }
.btn.tiny { padding: 4px 10px; font-size: 12.5px; border-radius: 4px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
form.inline { display: inline; }

/* 提示条 */
.flash-wrap { max-width: 1180px; margin: 14px auto 0; padding: 0 20px; }
.flash { padding: 11px 15px; border-radius: 5px; margin-bottom: 8px; font-size: 14px; border-left: 3px solid; }
.flash.ok { background: #edf9f1; border-color: var(--ok); color: #14622f; }
.flash.error { background: #fdf1f0; border-color: var(--danger); color: #8e1d16; }
.flash.warn { background: #fdf6e9; border-color: var(--warn); color: #8a5209; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: #f0f4f9; font-size: 12.5px; color: #4a5b6e; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafcfe; }
.t-title { font-weight: 600; color: var(--navy); text-decoration: none; }
.t-title:hover { color: var(--blue); text-decoration: underline; }
.t-live { display: inline-block; margin-left: 10px; font-size: 12px; color: var(--muted); text-decoration: none; }
.t-live:hover { color: var(--blue); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.ops { white-space: nowrap; }
.ops form { margin-left: 4px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #e7f6ec; color: var(--ok); }
.badge.draft { background: #f1f3f6; color: #5b6878; }
.hint-line { color: var(--muted); font-size: 13px; margin-top: 14px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 46px; text-align: center; color: var(--muted); }

/* 卡片与表单 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; }
.card h3 { margin: 0 0 14px; font-size: 15.5px; color: var(--navy); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 .card { margin-bottom: 18px; }
label { display: block; margin-bottom: 14px; font-size: 13px; color: #4a5b6e; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input:not([type]), textarea, select {
  width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid #cfd8e3; border-radius: 5px;
  font: inherit; font-weight: 400; color: #1f2933; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,60,144,.10); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; font-weight: 400; }
.err { color: var(--danger); }
.kv { display: flex; gap: 10px; margin: 0 0 8px; font-size: 14px; }
.kv span { color: var(--muted); min-width: 52px; }

/* 图片 */
.img-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.img-list:empty { display: none; }
.img-item { position: relative; margin: 0; width: 118px; height: 88px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #eef4fb; }
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-tag { position: absolute; left: 0; bottom: 0; background: rgba(16,42,67,.82); color: #fff; font-size: 11px; padding: 2px 7px; }
.img-del { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(179,38,30,.9); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.file-drop { display: block; border: 1px dashed #b9c6d6; border-radius: 6px; padding: 18px; text-align: center;
  color: var(--muted); font-weight: 400; cursor: pointer; background: #fafcfe; }
.file-drop:hover { border-color: var(--blue); color: var(--blue); }
.file-drop input {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.file-drop { position: relative; }

/* 编辑器 */
.editor-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #f0f4f9;
  border: 1px solid #cfd8e3; border-bottom: 0; border-radius: 6px 6px 0 0; }
.editor-bar button { background: #fff; border: 1px solid #d7e0ea; border-radius: 4px; padding: 5px 10px;
  cursor: pointer; font: inherit; font-size: 13px; color: #33465c; }
.editor-bar button:hover { border-color: var(--blue); color: var(--blue); }
.editor-bar .sep { width: 1px; background: #d7e0ea; margin: 2px 4px; }
.editor { min-height: 340px; border: 1px solid #cfd8e3; border-radius: 0 0 6px 6px; padding: 18px 20px;
  background: #fff; font-size: 15px; line-height: 1.8; color: #26313d; }
.editor:empty::before { content: attr(data-placeholder); color: #9aa8b6; }
.editor h2 { font-size: 19px; color: var(--navy); margin: 18px 0 10px; }
.editor h3 { font-size: 16.5px; color: var(--navy); margin: 16px 0 8px; }
.editor blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: #faf7f1; color: #4b5563; }
.editor ul, .editor ol { padding-left: 22px; }
.editor:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(10,60,144,.12); }

/* 登录 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #102a43 0%, #0a3c90 100%); }
.login-card { width: 380px; max-width: calc(100% - 36px); background: #fff; border-radius: 10px;
  padding: 34px 32px 26px; box-shadow: 0 20px 50px rgba(6,20,38,.35); }
.login-card h1 { font-size: 20px; color: var(--navy); margin: 0 0 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-tip { font-size: 12px; color: var(--muted); margin: 14px 0 0; text-align: center; }

@media (max-width: 860px) {
  .grid2, .row2 { grid-template-columns: 1fr; }
  .tp-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .tp-nav { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 12px; }
  .tbl { display: block; overflow-x: auto; }
}

/* ===== 账号头像（后台） ===== */
.tp-user { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 600;
  text-decoration: none; padding: 3px 10px 3px 4px; border-radius: 20px; transition: .18s; }
.tp-user:hover { background: rgba(255,255,255,.12); color: #fff; }
.tp-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block;
  border: 1.5px solid rgba(255,255,255,.55); background: #0A3C90; }
.tp-av-ph { display: flex; align-items: center; justify-content: center; font-size: 13px;
  font-weight: 700; color: #fff; background: #0A3C90; }
.tp-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dot { width: 7px; height: 7px; border-radius: 50%; background: #38d16a; box-shadow: 0 0 0 2px rgba(56,209,106,.25); }

.av-box { display: flex; gap: 18px; align-items: center; margin-bottom: 6px; }
.av-preview { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: 0 0 88px;
  border: 3px solid #eef2f7; box-shadow: 0 2px 10px rgba(15,42,67,.12); }
.av-ph { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #0A3C90, #102a43); }
.av-meta { flex: 1; min-width: 0; }
.av-meta .kv { margin: 0 0 6px; }
.mt { margin-top: 14px; }

@media (max-width: 860px) {
  .tp-name { display: none; }
  .av-box { flex-direction: column; align-items: flex-start; }
}

/* ---------- 图片上传增强 ---------- */
.hint.ok { color: #14622f; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 4px; }

.file-drop.drag-on {
  border-color: var(--blue); background: #eaf2ff; color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(10,60,144,.10);
}
.img-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.img-bar .hint { margin: 0; }
.img-item[data-kind="new"] { border-color: rgba(200,150,62,.65); }
.img-item[data-kind="new"]::after {
  content: '待上传'; position: absolute; right: 0; top: 0;
  background: var(--gold); color: #fff; font-size: 10px; padding: 1px 5px;
  border-bottom-left-radius: 4px; letter-spacing: .02em;
}

/* 上传遮罩 */
.up-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,26,42,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.up-mask[hidden] { display: none; }
.up-box {
  background: #fff; border-radius: 10px; padding: 26px 34px; text-align: center;
  box-shadow: 0 18px 50px rgba(6,20,36,.35); min-width: 260px;
}
.up-box p { margin: 0 0 6px; font-size: 15px; color: #16283c; font-weight: 600; }
.up-box .hint { margin: 0; }
.up-spin {
  width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid #dbe4ef; border-top-color: var(--blue);
  animation: upspin .8s linear infinite;
}
@keyframes upspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .up-spin { animation-duration: 2.4s; } }

/* 头像即时预览 */
.av-new { margin: 12px 0 4px; }
.av-new img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold); background: #eef4fb; display: block; }

/* ---------- 访客统计 ---------- */
.vs-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
@media (max-width: 900px) { .vs-cards { grid-template-columns: repeat(2, 1fr); } }
.vs-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.vs-label { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.vs-num { font-size: 30px; line-height: 1.1; color: var(--navy); font-weight: 700; }
.vs-num em { font-size: 17px; font-style: normal; font-weight: 600; margin-left: 2px; color: var(--muted); }
.vs-sub { font-size: 12px; color: var(--muted); }

/* 24 小时柱状 */
.vs-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin: 10px 0 4px; }
.vs-bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.vs-bar {
  background: linear-gradient(180deg, #2f6fd0, var(--blue)); border-radius: 2px 2px 0 0;
  min-height: 2px; transition: height .3s var(--ease, ease);
}
.vs-bar-wrap:hover .vs-bar { background: var(--gold); }
.vs-hour { font-size: 10px; color: var(--muted); text-align: center; height: 14px; margin-top: 3px; }

/* 表格紧凑 */
.tbl-compact th, .tbl-compact td { padding: 7px 10px; font-size: 13px; }
.vs-path { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-scroll { max-height: 460px; overflow: auto; }
.vs-scroll thead th { position: sticky; top: 0; background: #f6f9fc; z-index: 1; }
.vs-select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px;
  font: inherit; font-size: 13px; background: #fff; color: #26313d;
}
.vs-note { background: #fbfcfe; }
.vs-note .hint { line-height: 1.9; }

.vs-tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.vs-tag.real { background: #e7f6ec; color: #14622f; }
.vs-tag.cloud { background: #f0f2f5; color: #6b7785; }
.vs-cloud-row td { color: #8b96a3; }
.vs-cloud-row .vs-tag.cloud { color: #6b7785; }
.vs-detail { margin-top: 10px; }
.vs-detail summary {
  cursor: pointer; font-size: 12.5px; color: var(--blue);
  padding: 6px 0; user-select: none;
}
.vs-detail summary:hover { text-decoration: underline; }
.vs-detail table { margin-top: 6px; }

/* ===== 官网询盘列表 ===== */
.inq-search { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; align-items: center; }
.inq-search input { flex: 1; min-width: 260px; padding: 9px 12px; border: 1px solid #cfd8e3;
  border-radius: 5px; font-size: 14px; font-family: inherit; }
.inq-search input:focus { outline: none; border-color: var(--blue); }
.inq-tbl td { font-size: 13.5px; }
.inq-tbl .inq-type { color: #6b7a8a; font-size: 12px; }
.inq-msg { max-width: 340px; }
.inq-msg summary { cursor: pointer; color: #37424E; line-height: 1.55; }
.inq-msg summary:hover { color: var(--blue); }
.inq-body { margin-top: 8px; padding: 10px 12px; background: #f7fafd; border: 1px solid #e3ebf3;
  border-radius: 5px; white-space: pre-wrap; word-break: break-word; font-size: 13px;
  line-height: 1.65; color: #37424E; max-height: 280px; overflow: auto; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* ===== 近 N 日国家/语言趋势 ===== */
.vs-trend { margin-top: 18px; }
.vs-trend h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vs-trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 16px; }
.vs-trend-col h4 { font-size: 13.5px; color: var(--navy); margin: 0 0 8px; font-weight: 700; }
.vs-trend-col .tbl { width: 100%; }
.vs-trend-col .tbl td:last-child, .vs-trend-col .tbl th:last-child { text-align: right; }
.vs-trend-dayhead { font-size: 13.5px; color: var(--navy); margin: 22px 0 8px; font-weight: 700; }
.vs-trend-days { width: 100%; max-width: 520px; }
@media (max-width: 900px) { .vs-trend-grid { grid-template-columns: 1fr; gap: 18px; } }
