:root {
  --fg: #222;
  --dim: #777;
  --line: #e6e6e6;
  --line2: #d5d5d5;
  --link: #0b5fd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--fg);
  font: 13px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 14px 22px 80px; }

/* 顶部一行导航，仅此而已 */
.bar {
  display: flex; align-items: center;
  font-size: 12px; color: var(--dim);
  padding-bottom: 8px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.bar .nav a { color: #444; margin-right: 14px; }
.bar .search { margin-left: auto; }
.bar .search input { width: 170px; padding: 2px 6px; font-size: 12px; }
.bar .me { margin-left: 14px; color: var(--dim); }
.bar .me a { color: #444; }

h1 { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: #000; }
h1 a { color: #000; }
h2 { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
h3 { font-size: 13px; font-weight: 700; margin: 16px 0 6px; }

.sub { font-size: 12px; color: var(--dim); margin: 0 0 14px; }
.sub a { color: var(--dim); }

.msg { padding: 5px 9px; font-size: 12px; margin-bottom: 12px; border-left: 3px solid var(--line2); background: #fafafa; }
.msg.err { border-color: #c33; color: #a11; background: #fdf4f4; }
.msg.ok { border-color: #3a8; color: #275; background: #f4faf6; }

/* 唯一的表格样式：全部页面共用 */
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 700; color: #333; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
th a { color: #333; text-decoration: none; }
th a:hover { color: var(--link); }
td { padding: 5px 8px; border-bottom: 1px solid #f2f2f2; vertical-align: middle; }
tbody tr:hover { background: #f7f7f7; }
.num { text-align: right; white-space: nowrap; }
.op { text-align: right; white-space: nowrap; }
.op a, .op button { font-size: 12px; color: #999; margin-left: 10px; }
.op button { border: 0; background: none; padding: 0; cursor: pointer; }
tbody tr:hover .op a, tbody tr:hover .op button { color: var(--link); }
.op .danger:hover, button.danger:hover { color: #b42318; }

.ico {
  display: inline-block; width: 16px; height: 16px;
  margin-right: 6px; vertical-align: -3px;
  background-repeat: no-repeat; background-size: 16px 16px;
}
.ico-dir { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23e0b23c' d='M1 3.5h5l1.2 1.7H15v8.3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-file { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23dcdcdc' d='M3.5 1.5h6l3.5 3.5v10h-9.5z'/%3E%3Cpath fill='%23a8a8a8' d='M9.5 1.5l3.5 3.5h-3.5z'/%3E%3C/svg%3E"); }

.empty { padding: 36px 8px; color: #999; font-size: 13px; }

.tools { font-size: 12px; color: var(--dim); margin: 0 0 10px; }
.tools a { color: var(--link); cursor: pointer; }

.bulk { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--dim); margin: 0 0 8px; }
.bulk button[disabled] { color: #bbb; cursor: default; text-decoration: none; }
th.sel, td.sel { width: 26px; padding-right: 0; }
th.sel input, td.sel input { margin: 0; }

.pager { display: flex; align-items: center; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--dim); }

.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; }
.search-inline { display: flex; align-items: center; gap: 6px; }
.search-inline input { width: 220px; }
.filters { display: flex; gap: 2px; font-size: 12px; margin: 0 0 10px; }
.toolbar .filters { margin: 0; }
.filters a { color: var(--dim); padding: 2px 9px; border: 1px solid transparent; text-decoration: none; }
.filters a:hover { color: var(--fg); }
.filters a.on { color: var(--fg); border-color: var(--line); background: #f6f6f6; }

.preview {
  background: #f2f2f2;
  border: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  overflow: auto;
}
.preview img { max-width: 100%; vertical-align: middle; }
#tiffCanvas { max-width: 100%; height: auto; background: #fff; }
.tiff-bar { margin-top: 8px; font-size: 12px; color: var(--dim); display: flex; gap: 10px; justify-content: center; align-items: center; }
.gds-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 420px;
  border: 1px solid var(--line);
  background: #0b0d12;
}
.kk-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 420px;
  border: 1px solid var(--line);
  background: #fff;
}
.queue { margin-top: 8px; font-size: 12px; }
.qitem {
  display: grid; grid-template-columns: 1fr 140px 90px;
  gap: 8px; align-items: center; padding: 3px 0;
}
.qname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbar { display: block; height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: #4a8bd6; }
.qstatus { font-size: 11px; color: var(--dim); text-align: right; }
.qitem.done .qbar i { background: #4a9d6a; }
.qitem.fail {
  grid-template-columns: 1fr;
}
.qitem.fail .qbar {
  display: none;
}
.qitem.fail .qstatus {
  grid-column: 1;
  text-align: left;
  white-space: normal;
  color: #b42318;
  background: transparent;
  margin-top: 2px;
}

.muted { color: #999; }
.chip {
  display: inline-block; font-size: 11px; line-height: 15px;
  padding: 0 4px; margin-right: 3px;
  border: 1px solid #e0e0e0; color: #555;
}
.tag { font-size: 11px; color: #777; }
.tag.pm { color: #a2610a; }

/* 表单：不搞卡片，就是普通控件 */
form { margin: 0; }
.inline { display: inline; }
label { display: block; font-size: 12px; color: #666; margin-bottom: 10px; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 6px 0; color: var(--fg); font-size: 13px; white-space: nowrap; }
label.check input { margin: 0; }
.row > label.check { flex: 0 0 auto; align-self: flex-end; margin: 0 0 12px; padding-left: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 2px 0; }
.scroll-checks { max-height: 150px; overflow: auto; padding-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; }

input, select, button, textarea {
  font: inherit; font-size: 13px; color: var(--fg);
}
input[type="text"], input[type="password"], input:not([type]), select {
  padding: 4px 7px; border: 1px solid #ccc; border-radius: 2px; background: #fff;
  margin-top: 3px; max-width: 100%;
}
label > input, label > select { display: block; width: 100%; }
input.mini { width: 110px; display: inline-block; margin: 0 4px 0 0; padding: 2px 5px; }

button, .btn {
  padding: 4px 12px; border: 1px solid #bbb; border-radius: 2px;
  background: #f5f5f5; color: var(--fg); cursor: pointer; font-size: 13px;
  display: inline-block;
}
button:hover, .btn:hover { background: #eee; text-decoration: none; }
button.primary { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }
button.primary:hover { background: #245c96; }
button.link {
  border: none; background: none; padding: 0; color: var(--link);
  font-size: 13px; cursor: pointer;
}
button.link:hover { text-decoration: underline; }
button.link.danger, .danger { color: #b42318; }

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 180px; }
.row > button { margin-bottom: 10px; }
fieldset { border: 1px solid var(--line); padding: 8px 10px; margin: 0 0 12px; }
legend { font-size: 12px; color: var(--dim); padding: 0 4px; }

.card { padding: 0; border: 0; background: none; margin-bottom: 18px; }
.card.narrow { max-width: 420px; }
.section { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.page-head .actions { margin-left: auto; font-size: 12px; }
.crumbs { font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.crumbs a { color: var(--dim); }
.notice { padding: 5px 9px; font-size: 12px; color: #8a5a00; background: #fffaef; border-left: 3px solid #e0b23c; margin-bottom: 12px; }

table.kv { width: auto; font-size: 13px; }
table.kv th { border: 0; background: none; font-weight: 400; color: var(--dim); padding: 3px 18px 3px 0; }
table.kv td { border: 0; padding: 3px 0; }

/* 登录页 */
.login { max-width: 260px; margin: 14vh auto 0; }
.login h1 { font-size: 15px; margin-bottom: 16px; }
.login p { margin: 0 0 10px; }
.login button { margin-top: 4px; }
.hint { font-size: 12px; color: #999; margin-top: 14px; }

@media (max-width: 640px) {
  .wrap { padding: 12px 12px 60px; }
  .qitem { grid-template-columns: 1fr 70px; }
  .qstatus { grid-column: 1 / -1; text-align: left; }
}
