:root {
  --brand: #1e3a5f;
  --brand-2: #2c5282;
  --accent: #c45c26;
  --bg: #eef2f6;
  --card: #fff;
  --text: #1a2332;
  --muted: #6b7785;
  --line: #d8e0ea;
  --ok: #166534;
  --warn: #92400e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.portal-top {
  background: linear-gradient(120deg, #152a45 0%, var(--brand) 55%, #3d6a9a 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.portal-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.portal-brand span { opacity: 0.75; font-weight: 500; font-size: 0.85rem; margin-left: 8px; }
.portal-user { font-size: 0.9rem; opacity: 0.9; }

.portal-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
}
.portal-nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 0.92rem;
}
.portal-nav a.active, .portal-nav a:hover {
  background: #e8eef6;
  color: var(--brand);
  text-decoration: none;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.wrap-narrow { max-width: 720px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.88rem; }
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.alert-warn { background: #fff7ed; color: var(--warn); }
.alert-ok { background: #ecfdf3; color: var(--ok); }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }
.btn-secondary { background: #64748b; }
.btn-warn { background: #b45309; }
.btn-outline {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
.btn-block { width: 100%; display: block; text-align: center; }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.btn-wechat {
  background: #07c160;
  margin-bottom: 4px;
  text-decoration: none;
}
.btn-wechat:hover { color: #fff; filter: brightness(1.05); }
.mp-launch-wrap { margin-bottom: 4px; }
.mp-launch-wrap wx-open-launch-weapp { display: block; width: 100%; }
.login-or {
  text-align: center;
  margin: 12px 0 10px;
  position: relative;
}

.form-label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.9rem; }
.form-control, .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 10px;
  background: #fff;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #e8eef6;
  color: var(--brand);
}
.pill.warn { background: #ffedd5; color: #9a3412; }
.pill.ok { background: #dcfce7; color: #166534; }

/* login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #0f1c2e;
}
.login-hero {
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(196,92,38,0.25), transparent 50%),
    linear-gradient(145deg, #152a45, #1e3a5f 40%, #0f1c2e);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.login-hero h1 { font-size: 2.2rem; margin: 0 0 8px; letter-spacing: 0.06em; }
.login-hero p { opacity: 0.8; max-width: 28rem; line-height: 1.6; }
.login-box {
  background: #f7f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(15, 28, 46, 0.12);
}
.login-card h2 { margin: 0 0 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.form-section {
  margin: 18px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--brand);
}
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.req { color: #b91c1c; }
.mb-10 { margin-bottom: 10px; }
.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
  -webkit-overflow-scrolling: touch;
}
.form-table th, .form-table td { min-width: 110px; }
.form-table .form-control { margin-bottom: 0; padding: 8px; font-size: 0.92rem; }
.dispatch-attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.file-preview-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  text-decoration: none;
  color: var(--text);
}
.file-preview-card img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  background: #e2e8f0;
}
.file-preview-card span {
  display: block;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-preview-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}
.file-preview-video {
  width: 100%;
  max-height: 160px;
  border-radius: 6px;
  background: #0f172a;
}

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 20px 20px; min-height: 180px; }
  .login-hero h1 { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-table th, .form-table td { min-width: 140px; }
}

/* mobile shell extras */
body.is-mobile .wrap { padding: 12px; }
body.is-mobile .btn { font-size: 1.05rem; padding: 12px; }
body.is-mobile .card { border-radius: 14px; }
