:root {
  --brand: #0A0080;
  --brand-mid: #2D1BB2;
  --brand-bright: #4141EF;
  --brand-soft: #E7E9FF;
  --accent: #8CD200;
  --text: #36404a;
  --heading: #17233a;
  --muted: #727272;
  --line: #D6D6D6;
  --line-soft: #e8eaf0;
  --bg: #F4F4F4;
  --danger: #c0392b;
  --ok: #287a42;
  --warning: #8a5a00;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(10, 0, 128, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
a { color: var(--brand-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(65,65,239,.25); outline-offset: 2px; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 20px 90px; }
.navbar { background: #fff; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(20,25,50,.04); }
.navbar-inner { max-width: 1440px; min-height: 66px; margin: auto; padding: 8px 24px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--heading); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: auto; height: 40px; }
.brand-portal { border-left: 1px solid var(--line); padding-left: 14px; color: var(--muted); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.nav-links { display: flex; align-self: stretch; align-items: center; }
.nav-links a { padding: 9px 14px; border-radius: 8px; color: var(--muted); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.user-area { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; }
.user-email { color: var(--muted); max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.inline-form { display: inline; }
.link-button { border: 0; background: transparent; color: var(--brand-mid); cursor: pointer; padding: 4px; }
.guest-header { max-width: 1180px; margin: 0 auto; padding: 24px 20px 0; display: flex; justify-content: space-between; align-items: center; }
.guest-tag { color: var(--brand); font-size: 13px; letter-spacing: 2px; }
.site-footer { text-align: center; color: #9297a1; font-size: 12px; padding: 24px 16px; }
.auth-page { background: radial-gradient(circle at 10% 5%, #e7e9ff 0, transparent 36%), radial-gradient(circle at 95% 85%, rgba(140,210,0,.12) 0, transparent 30%), var(--bg); min-height: 100vh; }
.auth-wrap { width: min(480px, calc(100% - 28px)); margin: 46px auto 20px; }
.auth-card { background: #fff; border: 1px solid rgba(10,0,128,.07); border-radius: 18px; padding: 34px 38px; box-shadow: 0 20px 60px rgba(23,25,65,.10); }
.register-card { width: 100%; }
.auth-heading { text-align: center; margin-bottom: 24px; }
.eyebrow { color: var(--brand-bright); font-size: 10px; font-weight: 700; letter-spacing: 2.4px; }
.auth-heading h1 { margin: 5px 0 6px; color: var(--heading); font-size: 25px; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.form-row { margin-bottom: 17px; }
.form-row label { display: block; color: var(--heading); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-row input, .field input, .field select, .field textarea, td input, td select { width: 100%; min-height: 40px; padding: 8px 11px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-row input:focus, .field input:focus, .field select:focus, .field textarea:focus, td input:focus, td select:focus { border-color: var(--brand-bright); box-shadow: 0 0 0 3px rgba(65,65,239,.10); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 4px; }
.optional { color: var(--muted); font-size: 11px; font-weight: 400; }
.req { color: var(--danger); margin-left: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 18px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-mid); }
.btn-accent { background: var(--accent); color: #173000; }
.btn-accent:hover { background: #79bb00; }
.btn-ghost { background: #fff; border-color: var(--line); color: #4f5965; }
.btn-ghost:hover { border-color: var(--brand-bright); color: var(--brand); }
.btn-danger { background: #fff; border-color: #efc5c0; color: var(--danger); }
.btn-block { width: 100%; margin-top: 5px; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.auth-links { display: flex; justify-content: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--muted); }
.privacy-note { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line-soft); color: var(--muted); text-align: center; font-size: 11.5px; }
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.alert-error { background: #fff1ef; color: var(--danger); border-color: #f1c7c2; }
.alert-info { background: var(--brand-soft); color: var(--brand); border-color: #C3C9FF; }
.alert-warning { background: #fff8e5; color: var(--warning); border-color: #ead69e; }
.alert-success { background: #edf8e8; color: var(--ok); border-color: #c9e4bb; }
.dev-code { display: inline-block; padding: 0 7px; font-size: 18px; letter-spacing: 3px; color: var(--brand); }
.steps { list-style: none; display: flex; padding: 0; margin: 0 0 24px; }
.steps li { flex: 1; position: relative; text-align: center; color: #9a9da7; font-size: 11px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; height: 1px; background: var(--line); width: calc(100% - 32px); top: 12px; left: calc(50% + 17px); }
.steps span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; width: 24px; height: 24px; border-radius: 50%; background: #eceef3; color: #777d89; }
.steps .active { color: var(--brand); font-weight: 600; }
.steps .active span, .steps .done span { background: var(--brand); color: #fff; }
.code-input { text-align: center; font-size: 24px !important; letter-spacing: 10px; font-weight: 700; }
.verification-sent { text-align: center; background: #f7f7fb; border-radius: 8px; padding: 10px; margin-bottom: 18px; font-size: 13px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head h1 { color: var(--heading); font-size: 23px; margin: 0 0 4px; }
.page-head p { color: var(--muted); margin: 0; font-size: 13px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-draft { background: #fff4d9; color: #7b5900; }
.status-pending { background: var(--brand-soft); color: var(--brand); }
.status-processing { background: #e5f4ff; color: #12628b; }
.status-completed { background: #eaf6df; color: #387300; }
.status-failed { background: #fff0ed; color: var(--danger); }
.notice { background: var(--brand-soft); border: 1px solid #C3C9FF; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.notice summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.notice ul { margin: 8px 0 0; padding-left: 19px; }
.notice li { margin: 3px 0; }
.section-nav { position: sticky; top: 66px; z-index: 30; background: rgba(255,255,255,.97); border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 16px; padding: 0 10px; overflow-x: auto; white-space: nowrap; box-shadow: 0 4px 16px rgba(20,25,50,.04); }
.section-nav a { display: inline-block; padding: 11px 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.section-nav a:hover { color: var(--brand); text-decoration: none; }
.section-nav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); scroll-margin-top: 130px; }
.card > h2 { font-size: 16px; color: var(--heading); margin: 0 0 5px; display: flex; align-items: center; gap: 9px; }
.card > h2 .no { background: var(--brand); color: #fff; font-size: 12px; border-radius: 6px; padding: 1px 7px; }
.card > .desc { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.card h3 { font-size: 13px; color: var(--heading); margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.card h3:first-of-type { margin-top: 8px; border-top: 0; padding-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 13px 16px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; color: #3c4654; font-weight: 600; }
.field textarea { resize: vertical; min-height: 74px; }
input.invalid, select.invalid, textarea.invalid, .drop.invalid { border-color: var(--danger) !important; background: #fff8f7 !important; }
input:disabled, select:disabled, textarea:disabled { background: #f3f4f6; color: #7e858f; cursor: not-allowed; }
.checks { display: flex; flex-wrap: wrap; gap: 9px 20px; padding: 3px 0; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400; cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--brand); }
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #f5f6fa; text-align: left; font-weight: 600; font-size: 12px; color: #505a68; padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
tbody td { padding: 7px 8px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody td input, tbody td select { min-height: 34px; padding: 5px 8px; font-size: 13px; min-width: 120px; }
tbody td.c { text-align: center; width: 44px; }
tbody td.c input { min-width: 16px; width: 16px; height: 16px; accent-color: var(--brand); }
tbody tr.is-default td { background: #f2f3ff; }
tbody tr.is-default td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.del { border: 0; background: transparent; color: #9299a4; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 7px; border-radius: 5px; }
.del:hover { color: var(--danger); background: #fff0ed; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef0f4; color: var(--muted); margin-left: auto; white-space: nowrap; }
.badge.ok { background: #e9f5df; color: var(--ok); }
.badge.bad { background: #fff0ed; color: var(--danger); }
.hint-inline { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
.err { color: var(--danger); font-size: 12px; margin: 7px 0 0; display: none; }
.err.show { display: block; }
.subgroup { border: 1px solid var(--line-soft); border-radius: 9px; padding: 0 14px; margin-top: 15px; background: #fbfbfe; }
.subgroup > summary { cursor: pointer; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--heading); }
.subgroup > summary small { color: var(--muted); font-weight: 400; }
.subgroup .inner { padding: 2px 0 16px; }
.mat-box { background: #f8f9fc; border: 1px solid var(--line-soft); border-radius: 9px; padding: 13px 15px; margin-bottom: 14px; font-size: 12.5px; }
.mat-title { margin: 0 0 8px; font-weight: 600; color: var(--heading); }
.mat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 5px 24px; }
.mat-sub { margin: 0 0 4px; font-weight: 600; color: var(--brand); }
.mat-box ol { margin: 0; padding-left: 20px; }
.mat-dl { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--line); }
.drop { border: 1.5px dashed #abb1cf; border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); background: #fbfbff; cursor: pointer; }
.drop.over { border-color: var(--brand-bright); background: var(--brand-soft); }
.filelist { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.filelist li { background: var(--brand-soft); border: 1px solid #C3C9FF; border-radius: 7px; padding: 5px 9px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.filelist button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.attachment-list { list-style: none; padding: 0; margin: 10px 0 15px; }
.attachment-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.attachment-list .file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.attachment-list .file-size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(8px); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 45; box-shadow: 0 -5px 22px rgba(20,25,50,.05); }
.action-bar .status { color: var(--muted); font-size: 12.5px; }
.action-bar .status.ok { color: var(--ok); font-weight: 600; }
.action-bar .status.bad { color: var(--danger); font-weight: 600; }
.action-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.error-summary { background: #fff4f2; border: 1px solid #efc5c0; border-radius: 10px; padding: 13px 18px; margin-bottom: 16px; color: var(--danger); }
.error-summary strong { display: block; margin-bottom: 4px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.readonly-panel { background: #f5f6fa; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; color: var(--muted); }
.readonly .edit-only { display: none !important; }
.process-meta { font-size: 12px; color: var(--muted); text-align: right; }
.process-meta p { margin: 2px 0; }
@media (max-width: 760px) {
  .navbar-inner { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .brand { gap: 8px; }
  .brand-logo { height: 32px; }
  .brand-portal { padding-left: 8px; font-size: 11px; letter-spacing: 0; }
  .nav-links { order: 3; width: 100%; }
  .user-email { max-width: 145px; }
  .container { margin: 14px auto; padding: 0 10px 130px; }
  .guest-header { padding: 18px 14px 0; }
  .guest-tag { display: none; }
  .auth-wrap { margin-top: 28px; }
  .auth-card { padding: 26px 22px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .page-head { flex-direction: column; }
  .process-meta { text-align: left; }
  .card { padding: 15px 14px; }
  .span2 { grid-column: auto; }
  .section-nav { top: 113px; }
  .action-bar { padding: 10px 12px; flex-direction: column; align-items: stretch; }
  .action-bar .actions { width: 100%; }
  .action-bar .actions .btn { flex: 1; }
  .mat-cols { grid-template-columns: 1fr; }
}
