/* ===== 后台管理样式 ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: #1f2d3d; background: #eef2f6; }

.admin-top { background: #0f2d44; color: #fff; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; }
.admin-top h1 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 10px; }
.admin-top .sub { color: #f4b41a; font-size: 11px; letter-spacing: 2px; font-weight: 700; }
.admin-top .right { display: flex; align-items: center; gap: 12px; }
.lang-toggle { background: rgba(255,255,255,.1); color: #fff; border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.lang-toggle:hover { background: #f4b41a; color: #2a2200; border-color: #f4b41a; }
.lang-switch { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px; padding: 3px; }
.lang-btn { background: transparent; color: #e6eef6; border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .2s; line-height: 1; }
.lang-btn:hover { color: #fff; }
.lang-btn.active { background: #f4b41a; color: #2a2200; }
.lang-btn.active:hover { color: #2a2200; }
.btn-out { background: #f4b41a; color: #2a2200; border: 0; border-radius: 8px; padding: 7px 16px;
  font-weight: 700; cursor: pointer; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg,#0f2d44,#2e86c1); }
.login-card { background: #fff; border-radius: 16px; padding: 38px; width: min(340px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.login-card h2 { margin: 0 0 6px; color: #0f2d44; }
.login-card p { color: #5b6b7b; font-size: 14px; margin-bottom: 22px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1.5px solid #e1e8ef; border-radius: 10px; font-size: 15px; margin-bottom: 6px; }
.login-card input:focus { outline: none; border-color: #2e86c1; }
.login-card button { width: 100%; margin-top: 10px; background: #0f2d44; color: #fff; border: 0;
  border-radius: 10px; padding: 12px; font-weight: 700; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: #1b4f72; }
.login-err { color: #d64545; font-size: 13px; min-height: 18px; }

/* 布局 */
.admin-body { display: flex; min-height: calc(100vh - 56px); }
.side { width: 210px; background: #13344c; color: #cfe0ee; padding: 18px 0; flex: 0 0 210px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 13px 22px; color: #cfe0ee; cursor: pointer; font-size: 15px; border-left: 3px solid transparent; }
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.active { background: rgba(244,180,26,.14); border-left-color: #f4b41a; color: #fff; }
.side .ico { width: 18px; text-align: center; }
.content { flex: 1; padding: 26px 30px; overflow: auto; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h2 { margin: 0; color: #0f2d44; }
.btn-add { background: #2e86c1; color: #fff; border: 0; border-radius: 9px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.btn-add:hover { background: #1b4f72; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(15,45,68,.08); }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid #eef2f6; }
.tbl th { background: #f5f8fb; color: #5b6b7b; font-weight: 700; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .mini { background: #eaf3fa; color: #1b4f72; border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer; font-size: 13px; margin-right: 6px; }
.tbl td .mini.del { background: #fdeaea; color: #d64545; }
.tbl td .mini:hover { filter: brightness(.96); }
.tag { background: #eaf3fa; color: #1b4f72; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.row-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row-badges span { font-size: 11px; padding: 2px 9px; border-radius: 999px; line-height: 1.6; white-space: nowrap; }
.row-ch { background: #1b4f72; color: #fff; font-weight: 600; }
.row-sub { background: #fff4d6; color: #9a6a00; border: 1px solid #f1d99a; }
.news-views-cell { color: #1b4f72; font-weight: 700; white-space: nowrap; }
.row-st { background: #eaf3fa; color: #1b4f72; }
.empty { color: #5b6b7b; padding: 30px; text-align: center; }

/* 表格内缩略图 */
.tbl td .thumb-img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; vertical-align: middle; border: 1px solid #e1e8ef; background: #f5f8fb; }
.tbl td .thumb-ph { display: inline-flex; width: 64px; height: 44px; align-items: center; justify-content: center; border-radius: 6px; background: #eef2f6; color: #9fb4c4; font-size: 18px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,31,48,.5); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 60; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; padding: 26px; }
.modal h3 { margin: 0 0 18px; color: #0f2d44; }
.modal-hint { margin: -12px 0 16px; font-size: 12px; color: #7c8b99; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sub { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; font-weight: 700;
  color: #2e86c1; border-top: 1px dashed #e1e8ef; padding-top: 12px; }
.form-grid label { font-size: 13px; font-weight: 600; color: #33414f; display: block; margin-bottom: 5px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1.5px solid #e1e8ef; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit; }
.form-grid textarea { resize: vertical; }
.form-grid input[type="file"] { padding: 8px 10px; background: #f5f8fb; cursor: pointer; }

/* 图片上传字段 */
.img-field .img-preview-wrap { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.img-preview { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid #e1e8ef; background: #f5f8fb; }
.btn-clear { background: #fdeaea; color: #d64545; border: 0; border-radius: 8px; padding: 7px 13px; font-size: 13px; cursor: pointer; }
.btn-clear:hover { filter: brightness(.96); }

/* PDF 上传字段 */
.img-field .file-preview-wrap { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.file-preview { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid #e1e8ef;
  border-radius: 10px; background: #f5f8fb; max-width: 100%; }
.file-preview .file-ico { font-size: 22px; line-height: 1; }
.file-preview .file-name { font-size: 13px; color: #1b3a52; max-width: 240px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.file-preview .file-view { font-size: 13px; color: #2e86c1; font-weight: 600; text-decoration: none; }
.file-preview .file-view:hover { text-decoration: underline; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: #2e86c1; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.modal-actions button { border: 0; border-radius: 9px; padding: 10px 20px; font-weight: 700; cursor: pointer; }
.btn-save { background: #f4b41a; color: #2a2200; }
.btn-cancel { background: #eef2f6; color: #5b6b7b; }

/* 提示条 */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #0f2d44; color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: .3s; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #1e8e4e; }
.toast.bad { background: #d64545; }

/* 站点设置表单 */
.panel-tip { color: #7c8b99; font-size: 13px; margin: 4px 0 18px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.set-group { background: #fff; border: 1.5px solid #e7eef4; border-radius: 12px; padding: 16px 18px; }
.set-group h3 { margin: 0 0 12px; font-size: 14px; color: #0f2d44; border-bottom: 2px solid #eef3f8; padding-bottom: 8px; }
.set-field { margin-bottom: 12px; }
.set-field > label { display: block; font-size: 11px; font-family: monospace; color: #2e86c1; background: #eef6fc; padding: 2px 8px; border-radius: 5px; margin-bottom: 6px; width: fit-content; }
.set-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-row input, .set-row textarea { width: 100%; border: 1.5px solid #e1e8ef; border-radius: 9px; padding: 9px 11px; font-size: 13px; font-family: inherit; resize: vertical; }
.set-row input:focus, .set-row textarea:focus { outline: none; border-color: #2e86c1; }
.set-video { display: flex; flex-direction: column; gap: 10px; }
.set-video input[type="file"] { font-size: 13px; color: #1b3a52; }
.set-video-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid #e1e8ef; border-radius: 10px; background: #f5f8fb; }
.set-video-preview video { width: 240px; max-width: 100%; border-radius: 8px; background: #0f2d44; aspect-ratio: 16/9; }
.set-video-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.set-video-meta .fname { font-size: 13px; color: #1b3a52; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.set-video-meta .fview { font-size: 13px; color: #2e86c1; font-weight: 600; text-decoration: none; }
.set-video-meta .fview:hover { text-decoration: underline; }
.set-video-actions { margin-top: 2px; }

@media (max-width: 720px) {
  .admin-body { flex-direction: column; }
  .side { width: 100%; display: flex; flex: none; padding: 0; }
  .side a { flex: 1; justify-content: center; border-left: 0; border-bottom: 3px solid transparent; padding: 12px 6px; font-size: 13px; }
  .side a.active { border-bottom-color: #f4b41a; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-form { grid-template-columns: 1fr; }
  .set-row { grid-template-columns: 1fr; }
}

/* 小手机（≤480px）：概览卡片单列、侧栏字号再缩小，避免文字溢出 */
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .side a { font-size: 12px; padding: 10px 4px; }
  .content { padding: 18px 14px; }
  .admin-top { padding: 12px 14px; }
  .admin-top h1 { font-size: 16px; }
}

/* ===== 概览统计卡片 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1.5px solid #e7eef4; border-radius: 12px; padding: 18px 20px; box-shadow: 0 4px 14px rgba(15,45,68,.06); }
.stat-card .sc-val { font-size: 28px; font-weight: 800; color: #0f2d44; line-height: 1.1; }
.stat-card .sc-lab { font-size: 13px; color: #5b6b7b; margin-top: 6px; }
.stat-card.accent { border-color: #f4b41a; background: linear-gradient(160deg, #fff, #fff8e8); }
@media (max-width: 720px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }

/* ===== 表格搜索 / 排序 ===== */
.tbl-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tbl-search { flex: 1; min-width: 200px; border: 1.5px solid #e1e8ef; border-radius: 9px; padding: 10px 14px; font-size: 14px; }
.tbl-search:focus { outline: none; border-color: #2e86c1; }
.tbl-sort { background: #eaf3fa; color: #1b4f72; border: 1.5px solid #d3e3f0; border-radius: 9px; padding: 10px 16px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; }
.tbl-sort:hover { background: #dbeafa; }

/* ===== 设置：重置 + 多行 ===== */
.btn-reset { background: #eef2f6; color: #5b6b7b; border: 0; border-radius: 9px; padding: 10px 18px; font-weight: 700; cursor: pointer; margin-right: 8px; }
.btn-reset:hover { background: #e2e8ee; }
.set-row textarea { min-height: 72px; }
.set-group { border-left: 3px solid #2e86c1; }

/* ===== 需求详情：快捷联系 ===== */
.quick-contact { grid-column: 1 / -1; display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.qc-btn { display: inline-flex; align-items: center; gap: 6px; background: #eaf3fa; color: #1b4f72; border: 1.5px solid #d3e3f0; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; }
.qc-btn:hover { background: #dbeafa; }

/* ===== 资讯：今日航运行业要闻 Markdown 编辑区 ===== */
.md-field { background: #f7faff; border: 1.5px solid #dce8f3; border-radius: 12px; padding: 16px 18px; margin-top: 4px; }
.md-hint { font-size: 12.5px; color: #5b6b7b; background: #eaf3fb; border: 1px solid #d3e3f0; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.5; }
.btn-ai {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #2e86c1, #1b4f72);
  color: #fff; font-weight: 700; font-size: 13px;
  border: 0; border-radius: 9px; padding: 10px 16px; margin-bottom: 14px;
  cursor: pointer; transition: filter .15s, transform .15s;
}
.btn-ai:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ai:active { transform: translateY(0); }
.md-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.md-row label { font-size: 13px; font-weight: 600; color: #2c3e50; min-width: 130px; }
.md-row input[type=file] { flex: 1; font-size: 13px; }
.md-field textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 13px; line-height: 1.6;
  color: #1b2a36;
  border: 1.5px solid #e1e8ef; border-radius: 10px;
  padding: 12px 14px; resize: vertical; margin-bottom: 14px;
  background: #fff;
}
.md-field textarea:focus { outline: none; border-color: #2e86c1; box-shadow: 0 0 0 3px rgba(46,134,193,.12); }
