﻿:root {
  --blue: #002fa7;
  --deep: #001b6b;
  --ink: #15181e;
  --text: #3a3f4a;
  --tint: #eef2fb;
  --canvas: #fafbfc;
  --line: #e8e9ef;
  --white: #ffffff;
  --red: #b42318;
  --green: #177245;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
}
.hidden {
  display: none !important;
}
button,
input,
select {
  font: inherit;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--deep), var(--blue));
}
.login-panel {
  width: min(420px, calc(100% - 32px));
  background: var(--white);
  padding: 42px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 54px #001b6b33;
}
.login-panel img {
  width: 188px;
  height: auto;
}
.login-panel h1 {
  margin: 34px 0 28px;
  font-size: 25px;
}
.login-panel label,
.form-grid label {
  display: block;
  color: var(--text);
  font-size: 13px;
}
.login-panel label + label {
  margin-top: 18px;
}
input,
select {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #002fa712;
}
.login-panel button,
.actions button {
  border: 0;
  background: var(--blue);
  color: var(--white);
  height: 44px;
  padding: 0 22px;
  font-weight: 700;
}
.login-panel button {
  width: 100%;
}
.error {
  height: 24px;
  color: var(--red);
  font-size: 12px;
}
.portal header {
  height: 72px;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.portal header img {
  width: 174px;
}
.account {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
.account button {
  border: 0;
  background: none;
  color: var(--blue);
}
nav {
  height: 48px;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  display: flex;
  gap: 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
}
.tab.active {
  color: var(--blue);
}
.tab.active:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--blue);
}
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.dropzone {
  height: 138px;
  border: 1px dashed #aeb8cc;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.drag {
  border-color: var(--blue);
  background: var(--tint);
}
.dropzone span {
  font-size: 13px;
  color: var(--text);
}
.dropzone a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}
.dropzone a:hover {
  text-decoration: underline;
}
.dropzone strong {
  font-size: 15px;
  color: var(--blue);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropzone input {
  display: none;
}
.actions {
  min-height: 76px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.actions span {
  margin-right: auto;
  font-size: 13px;
  color: var(--text);
}
.actions span.pending {
  color: var(--blue);
}
.actions span.success {
  color: var(--green);
  font-weight: 700;
}
.actions span.failure {
  color: var(--red);
  font-weight: 700;
}
.actions button:disabled {
  background: #aab2c3;
  cursor: not-allowed;
}
.actions #parse {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue);
}
.preview {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.metrics div {
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}
.metrics div:last-child {
  border: 0;
}
.metrics span {
  font-size: 12px;
  color: var(--text);
}
.metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
  color: var(--blue);
}
.table-wrap {
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--text);
  background: var(--canvas);
  font-weight: 600;
}
.ok {
  color: var(--green);
}
.bad {
  color: var(--red);
}
.data-link {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.data-link:hover {
  text-decoration: underline;
}
dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 20px 70px #001b6b33;
}
dialog::backdrop {
  background: #15181e66;
}
.submission-dialog {
  width: min(420px, calc(100% - 32px));
  background: var(--white);
}
.submission-result {
  padding: 34px;
  text-align: center;
}
.submission-result strong {
  display: block;
  color: var(--green);
  font-size: 18px;
}
.submission-result b {
  display: block;
  margin: 12px 0 28px;
  color: var(--blue);
  font-size: 25px;
}
.submission-result div {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.submission-result button {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  background: var(--white);
  color: var(--blue);
  font-weight: 700;
}
.submission-result #viewSubmission {
  background: var(--blue);
  color: var(--white);
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin: 0;
  font-size: 18px;
}
.dialog-head button {
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 26px;
}
.dialog-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px;
  background: var(--white);
  border: 1px solid var(--line);
}
.dialog-summary div {
  padding: 15px;
  border-right: 1px solid var(--line);
}
.dialog-summary div:last-child {
  border: 0;
}
.dialog-summary small {
  display: block;
  color: var(--text);
  font-size: 11px;
}
.dialog-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 18px;
}
.dialog-section {
  margin: 18px;
}
.dialog-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.billing-editor {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}
.entry-mode { display: inline-flex; margin: 16px 0 12px; border: 1px solid var(--line); }
.entry-mode button { border: 0; background: var(--white); padding: 10px 16px; }
.entry-mode button.active { background: var(--blue); color: var(--white); }
.direct-entry { margin-bottom: 16px; }
.bulk-text-entry { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.bulk-text-entry textarea { width: 100%; resize: vertical; border: 1px solid var(--line); padding: 10px 12px; font: inherit; }
.bulk-text-entry button { height: 40px; border: 0; background: var(--blue); color: var(--white); padding: 0 16px; }
.bulk-text-entry span { grid-column: 1 / -1; min-height: 18px; font-size: 12px; }
.bulk-text-entry span.bad { color: var(--red); }
.bulk-text-entry span.ok { color: var(--green); }
.direct-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 10px; }
.direct-toolbar input { max-width: 360px; margin: 0; }
.direct-toolbar span { color: var(--text); font-size: 12px; padding-bottom: 10px; }
.direct-toolbar label { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.direct-toolbar select { width: 90px; margin: 0; padding: 8px; }
.direct-amount { min-width: 130px; padding: 8px 10px; margin: 0; }
.direct-pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 0; font-size: 13px; }
.direct-pager span { margin-right: 2px; color: var(--text); }
.direct-pager button { border: 1px solid var(--line); background: var(--white); padding: 9px 14px; border-radius: 4px; }
.direct-pager button:disabled { opacity: .45; cursor: default; }
.task-actions { position: sticky; top: 0; z-index: 4; margin: 0 -1px 12px; border: 1px solid var(--line); background: var(--white); padding: 12px; }
.top-validation { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 12px; background: var(--white); }
.top-validation div { padding: 11px 14px; border-right: 1px solid var(--line); }
.top-validation div:last-child { border: 0; }
.top-validation span { display: block; font-size: 11px; color: var(--text); }
.top-validation strong { display: block; margin-top: 4px; color: var(--blue); }
.top-validation { display: none !important; }
.preview > .metrics { display: none; }
.preview { margin-bottom: 18px; }
.preview .billing-editor { margin-top: 0; }
.billing-editor h3, .preview-detail-title { margin: 0 0 12px; font-size: 14px; }
.preview-detail-title { margin-top: 16px; }
.preview-amount { min-width: 130px; margin: 0; padding: 8px 10px; }
.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.billing-grid label { font-size: 12px; }
.billing-grid input { width: 100%; margin-top: 6px; }
.billing-status { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; }
.billing-status .bad { color: var(--red); }
.billing-status .ok { color: var(--green); }
@media (max-width: 820px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .dialog-summary {
    grid-template-columns: 1fr 1fr;
  }
  .billing-grid { grid-template-columns: 1fr 1fr; }
  .portal header {
    padding: 0 18px;
  }
  .portal header img {
    width: 148px;
  }
  nav {
    padding: 0 18px;
  }
  main {
    padding: 22px 16px 48px;
  }
}
@media (max-width: 600px) {
  .login-panel {
    padding: 30px 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .metrics div:nth-child(2) {
    border-right: 0;
  }
  .account span {
    display: none;
  }
}
