@charset "utf-8";
/* dbview 站点样式：简约、留白、单一强调色 */

:root {
  --ink: #1b1f27;
  --ink-2: #414855;
  --muted: #7b8494;
  --line: #e7eaef;
  --line-strong: #d8dde5;
  --bg: #f6f7f9;
  --card: #ffffff;
  --brand: #1e40af;
  --brand-dark: #16327f;
  --brand-soft: #eef3ff;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container { flex: 1 0 auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  /* 必须高于 Handsontable 内部克隆层（.ht_clone_* 的 z-index 在 100~210），
     否则手机上滚动时固定的“序号”列会盖到顶栏上。
     背景用纯白，避免半透明把滚动的内容透出来。 */
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--ink-2);
  font-size: 13.5px;
  padding: 4px 0;
}
.site-nav a:hover { color: var(--brand); }
.site-nav a.is-active { color: var(--brand); font-weight: 600; }

/* ---------- 版心 ---------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px 24px 40px;
}

.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { margin: 0 8px; color: #c3c9d4; }
.crumbs .here { color: var(--ink-2); }

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.2px;
  word-break: break-all;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.meta .dot { color: #cdd3dc; }
.meta .tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef0f4;
  color: var(--ink-2);
  font-size: 12px;
}

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f7f8fa; border-color: #c6ccd6; color: var(--ink); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.notice {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: #fbfcfe;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.notice-label {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  padding-top: 1px;
  letter-spacing: .5px;
}

.notice-body {
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 表格区 ---------- */
.grid-card { margin-bottom: 18px; }

.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
  font-size: 12.5px;
  color: var(--muted);
}
.grid-toolbar .hint { min-width: 0; }
.grid-toolbar .range { flex: none; font-variant-numeric: tabular-nums; }

#handsontable { overflow: hidden; }

/* Handsontable 外观覆盖 */
#handsontable .handsontable,
#handsontable .htCore {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  font-size: 12.5px;
  color: var(--ink-2);
}
#handsontable .handsontable th {
  background: #f7f8fa !important;
  color: #5a6373 !important;
  font-weight: 600;
  font-size: 12.5px;
  border-color: var(--line) !important;
}
#handsontable .htCore td {
  border-color: #f0f2f5 !important;
  padding: 0 8px;
  white-space: nowrap;
}
#handsontable .wtBorder.current { background-color: var(--brand) !important; }
#handsontable .area { background: var(--brand-soft) !important; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fcfcfd;
}

.pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pg-btn:hover { border-color: #bcc4d2; color: var(--ink); }
.pg-btn.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.pg-btn.is-disabled {
  color: #c2c8d2;
  background: #fbfbfc;
  cursor: not-allowed;
}
.pg-gap { color: #b9c0cc; padding: 0 2px; user-select: none; }

.pager-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.pager-jump input {
  width: 56px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  text-align: center;
  outline: none;
}
.pager-jump input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- 数据列表 ---------- */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
}

.search {
  width: 280px;
  max-width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search::placeholder { color: #a7aebb; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.list-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

table.data-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-list th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
  background: #fafbfc;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data-list td {
  padding: 11px 16px;
  border-bottom: 1px solid #f2f4f7;
  color: var(--ink-2);
  vertical-align: middle;
}

table.data-list tbody tr:last-child td { border-bottom: 0; }
table.data-list tbody tr:hover td { background: #fafbfd; }

table.data-list .col-idx { width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.data-list .col-size { width: 110px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
table.data-list th.col-size { text-align: right; }
table.data-list .col-date { width: 160px; font-variant-numeric: tabular-nums; color: var(--muted); }
table.data-list .col-op { width: 110px; text-align: right; }

table.data-list .col-name a { font-weight: 500; word-break: break-all; }
table.data-list .col-name .ext {
  margin-left: 8px;
  font-size: 11.5px;
  color: #9aa2b1;
  font-weight: 400;
}
.link-quiet { color: var(--muted); font-size: 13px; }
.link-quiet:hover { color: var(--brand); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
}
.site-footer .inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }
.site-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- 详情弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 22, 32, .45);
  visibility: hidden;
  opacity: 0;
  transition: opacity .16s ease;
}
.modal.is-open { visibility: visible; opacity: 1; }

.modal-panel {
  width: 860px;
  max-width: 100%;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(12, 18, 30, .28);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.modal-head .tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: #f2f4f7; color: var(--ink); }

.modal-body { flex: 1 1 auto; overflow: auto; min-height: 0; }
#detailTable { height: auto; }

body.modal-open { overflow: hidden; }

/* ---------- 提示页 / 表单 ---------- */
.msg-card {
  max-width: 560px;
  margin: 60px auto;
  padding: 40px 32px;
  text-align: center;
}
.msg-card h1 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.msg-card p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

.form-card { max-width: 720px; padding: 26px 28px; }

.form-row { margin-bottom: 18px; }
.form-row > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.form-row .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.input, .form-row input[type=text], .form-row input[type=password], .form-row input[type=file] {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
}
.form-row input[type=file] { padding: 6px 10px; height: auto; }
.form-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }

.alert {
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: 8px;
  font-size: 13.5px;
  background: #fef2f2;
  border: 1px solid #fbd5d5;
  color: #b42318;
}
.alert ok { color: inherit; }
.alert.is-ok { background: #f0fdf4; border-color: #cdebd5; color: #15803d; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .site-header .inner, .container, .site-footer .inner { padding-left: 16px; padding-right: 16px; }
  .site-nav { gap: 18px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 18px; }
  table.data-list .col-date { display: none; }
  .search { width: 100%; }
  .form-card { padding: 20px; }
}

@media (max-width: 560px) {
  .site-nav { display: none; }
  table.data-list .col-size { display: none; }
  .pager-jump { display: none; }

  /* 手机上一行放不下整串页码，只留「上一页 / 当前页 / 下一页」 */
  .pg-num { display: none; }
  .pg-num.is-current { display: inline-flex; }
  .pg-gap { display: none; }
  .pager { gap: 10px; }

  /* 小屏空间宝贵，提示语收起，保留行区间信息 */
  .grid-toolbar .hint { display: none; }
  .grid-toolbar { justify-content: flex-end; }
}
