:root {
    --ink: #29383d;
    --muted: #6b7b80;
    --line: #dce3e1;
    --page: #f8faf9;
    --paper: #fff;
    --maple: #9d5149;
    --maple-dark: #824139;
    --maple-soft: #f7eeeb;
    --blue: #4a6d81;
    --green: #477666;
    --amber: #9a752f;
    --red: #af4448;
    --graphite: #354950;
    --bs-primary-rgb: 157, 81, 73;
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-link-color: var(--maple);
    --bs-link-hover-color: var(--maple-dark);
}

body { letter-spacing: 0; }
::selection { background: #ead1c9; color: #29383d; }
:focus-visible { outline: 2px solid #547984; outline-offset: 3px; }
.btn, .icon-btn, .password-toggle, .fc-button, .fc-icon-button {
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.6; }
.btn-sm { min-height: 33px; padding: 6px 10px; font-size: 12px; }
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--maple);
    --bs-btn-border-color: var(--maple);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--maple-dark);
    --bs-btn-hover-border-color: var(--maple-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #713a35;
    --bs-btn-active-border-color: #713a35;
    --bs-btn-focus-shadow-rgb: 157, 81, 73;
    --bs-btn-disabled-color: #687774;
    --bs-btn-disabled-bg: #e2e8e5;
    --bs-btn-disabled-border-color: #e2e8e5;
    --bs-btn-disabled-opacity: 1;
}
.btn-outline-secondary {
    --bs-btn-color: #536b72;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #ccd8d7;
    --bs-btn-hover-color: #304c54;
    --bs-btn-hover-bg: #edf3f2;
    --bs-btn-hover-border-color: #a5bab9;
    --bs-btn-active-color: #304c54;
    --bs-btn-active-bg: #e4eeec;
    --bs-btn-active-border-color: #a5bab9;
    --bs-btn-focus-shadow-rgb: 83, 107, 114;
}
.btn-outline-danger {
    --bs-btn-color: #a1504b;
    --bs-btn-border-color: #dfc9c5;
    --bs-btn-hover-bg: #a1504b;
    --bs-btn-hover-border-color: #a1504b;
    --bs-btn-active-bg: #824139;
    --bs-btn-active-border-color: #824139;
}
.btn-icon, .job-action-icon { width: 34px; height: 34px; min-height: 34px; padding: 0; flex-shrink: 0; }
.form-control, .form-select, .operator-profile input {
    border-color: #cfdad7;
    border-radius: 4px;
    min-height: 40px;
    font-size: 13px;
    color: var(--ink);
}
.form-control::placeholder { color: #889692; opacity: 1; }
.form-control:focus, .form-select:focus, .operator-profile input:focus {
    border-color: #72938f;
    box-shadow: 0 0 0 3px #527c7414;
    outline: none;
}
.form-check-input:checked, input[type="checkbox"] { accent-color: var(--maple); }

.app-shell { background: #ffffffed; border-color: var(--line); backdrop-filter: blur(10px); }
.nav-inner { max-width: 1320px; min-height: 70px; padding: 12px 24px; gap: 14px; }
.brand { color: var(--ink); font-size: 16px; font-weight: 650; gap: 8px; white-space: nowrap; }
.brand-mark { background: none; width: 30px; height: 30px; border-radius: 0; }
.brand-mark img { width: 29px; height: 29px; object-fit: contain; filter: saturate(.55); }
.nav-links { gap: 4px; }
.nav-links > a, .nav-links a.nav-special, .nav-menu > summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 3px;
    color: #63767b;
    background: transparent;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 500;
    filter: none;
}
.nav-links svg { width: 16px; height: 16px; stroke-width: 1.6; }
.nav-links > a:hover, .nav-links a.nav-special:hover, .nav-menu > summary:hover { background: #f0f4f2; color: #344e55; filter: none; }
.nav-links > a[aria-current="page"], .nav-menu > summary.is-active { color: var(--maple); }
.nav-links > a[aria-current="page"]::after, .nav-menu > summary.is-active::after {
    content: "";
    position: absolute;
    bottom: 1px;
    height: 2px;
    left: 10px;
    right: 10px;
    background: var(--maple);
}
.nav-menu .nav-caret { width: 11px; height: 11px; }
.nav-menu[open] .nav-caret { transform: rotate(180deg); }
.operator-profile { border-color: var(--line); padding-left: 12px; }
.operator-profile summary { padding: 3px 6px; }
.operator-avatar { width: 28px; height: 28px; flex-basis: 28px; }
.operator-profile .operator-label { font-size: 12px; }
.operator-profile form, .nav-dropdown { border-radius: 5px; border-color: var(--line); box-shadow: 0 10px 28px #29383d10; }
.nav-dropdown a { font-size: 12px; border-radius: 3px; }
.nav-logout { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; color: #75858a; }
.nav-logout:hover { background: var(--maple-soft); color: var(--maple); }
.page { max-width: 1320px; padding: 26px 24px 50px; }

.hero-band { min-height: 190px; border-radius: 0; background: #f0f4f4; align-items: center; margin-bottom: 24px; isolation: isolate; }
.hero-image { opacity: 1; object-position: center; }
.hero-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #f8faf9c9 0%, #f8faf96b 40%, transparent 70%); pointer-events: none; }
.hero-content { z-index: 1; padding: 30px 34px; color: var(--ink); }
.hero-content .mini-label { color: #64797d; font-size: 10px; font-weight: 500; }
.hero-content h1 { font-family: "Yu Mincho", "Songti SC", SimSun, serif; font-weight: 500; font-size: 32px; line-height: 1.4; margin: 9px 0 10px; }
.hero-content p { color: #596f75; font-size: 12px; margin: 0; }
.metric-grid { gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.metric { background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 15px 24px; }
.metric:last-child { border-right: 0; }
.metric span { font-size: 27px; font-weight: 500; color: #3d5963; font-variant-numeric: tabular-nums; }
.metric:nth-child(2) span { color: #9a752f; }
.metric:nth-child(3) span { color: #477666; }
.metric:nth-child(4) span { color: var(--maple); }
.metric small { font-size: 11px; }
.layout-grid { gap: 28px; }
.panel { background: transparent; border: 0; border-radius: 0; padding: 22px 0; box-shadow: none; min-width: 0; }
.panel + .panel { margin-top: 24px; border-top: 1px solid var(--line); }
.layout-grid > .panel { padding: 0; }
.layout-grid > .panel + .panel { margin-top: 0; border-top: 0; border-left: 1px solid var(--line); padding-left: 28px; }
.panel-head h1, .panel-head h2 { color: #334c53; font-weight: 600; font-size: 18px; line-height: 1.6; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-head h2 > svg { width: 17px; height: 17px; stroke-width: 1.6; color: #7e8e88; }
.panel-head p { font-size: 12px; line-height: 1.8; }
.panel > h2 { font-size: 17px; line-height: 1.6; margin-bottom: 16px; font-weight: 600; }
.inline-head { flex-wrap: wrap; }
.drop-zone { position: relative; border: 1px dashed #b9ccc6; border-radius: 4px; background: #f0f5f2; min-height: 200px; padding: 25px 16px; align-content: center; gap: 5px; }
.drop-zone:hover, .drop-zone.dragover, .drop-zone:focus-within { border-color: var(--maple); background: #f7efeb; }
.drop-symbol { width: 30px; height: 30px; color: #7b9890; stroke-width: 1.1; margin-bottom: 13px; }
.drop-title { font-size: 15px; font-weight: 550; color: #48625e; }
.drop-subtitle { font-size: 11px; margin-top: 2px; }
.drop-zone input { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.precheck-card { border-radius: 4px; border-left-width: 2px; font-size: 12px; }
.precheck-title { font-size: 12px; overflow-wrap: anywhere; }
.precheck-meta { font-size: 11px; line-height: 1.7; }
.precheck-busy { background: #f0f5f2; }
.precheck-busy > svg, .precheck-busy strong { color: #54786d; }
#submitBtn { justify-content: space-between; min-height: 43px; }
.job-row { padding: 16px; border-radius: 4px; border-color: #dee6e2; background: #fff; }
.job-row[data-job-status="running"] { border-color: #d7b9b1; }
.job-title { font-size: 13px; font-weight: 550; line-height: 1.6; }
.job-title > svg { color: #6f8c80; margin-top: 2px; }
.job-row .job-meta { color: #798a8e; font-size: 10px; line-height: 1.7; }
.job-row .operator-avatar { width: 23px; height: 23px; flex-basis: 23px; }
.job-row .operator-label { font-size: 10px; }
.empty-state { font-size: 12px; padding: 32px 18px; border-radius: 4px; line-height: 1.8; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: #e2e8e5; font-size: 12px; }
.table > thead > tr > th { background: #eef3f1; color: #5b7372; font-size: 11px; font-weight: 600; padding: 12px; }
.table > tbody > tr > td { padding: 12px; }
.table > tbody > tr:hover > td { background-color: #f1f6f3; }
.table-responsive, .preview-scroll { border-radius: 4px; }
.preview-scroll table { min-width: max-content; }
.shortage-preview thead th { background: #4a6e64; color: #fff; }
.table .shortage-overdue-row td, .table .shortage-overdue-row:hover td { background: #f9e7e5; color: #9b353a; }
.status-pill { font-size: 10px; min-width: 52px; border-radius: 3px; padding: 4px 7px; font-weight: 500; }
.status-running, .status-queued { background: #f6eddc; color: #896722; }
.status-succeeded, .rule-enabled { background: #e6f0e9; color: #3f705c; }
.status-failed, .status-expired { background: #f7e6e4; color: #9d4c48; }
.rule-disabled { background: #eaf0ef; color: #778681; }
.rule-table code { border-radius: 3px; background: #eef3f1; font-size: 11px; }
.rule-actions .btn { width: 33px; height: 33px; padding: 0; }
.change-row { color: #72827f; font-size: 11px; line-height: 1.8; }
.info-box { border-radius: 4px; background: #fff; }
.info-box span { color: #526d7a; font-size: 25px; font-weight: 500; }
.info-box small { font-size: 11px; }
.pager-link { color: #647a77; border-radius: 3px; font-size: 12px; }
.pager-link.active { background: var(--maple); border-color: var(--maple); color: #fff; }
.shortage-hero { border-bottom: 1px solid var(--line); }
.mini-label { color: #718a80; font-weight: 500; font-size: 10px; }
.fc-shell { --fc-green: #477666; --fc-line: #dce3e1; --fc-ink: #29383d; --fc-muted: #6b7b80; }
.fc-button { background: var(--maple); border-radius: 4px; }
.fc-button:hover { background: var(--maple-dark); color: #fff; }
.fc-sidebar nav a.selected { background: #f6ebe7; color: var(--maple); box-shadow: inset 2px 0 var(--maple); }

/* The real task value positions the leaf; only the leaf's tilt is decorative. */
.task-progress--compact { margin-top: 12px; padding-top: 0; border-color: #edf1ee; }
.task-progress-track { height: 46px; margin: 0; }
.task-progress-track > .progress { top: 25px; height: 3px; border-radius: 1px; background: #e9eeeb; }
.task-progress .progress-bar { background: #af7164; border-radius: 1px; }
.progress-cursor { top: 8px; width: 34px; height: 34px; left: clamp(17px, var(--progress), calc(100% - 17px)); }
.progress-cursor::before { display: none; }
.progress-leaf { width: 34px; height: 34px; object-fit: contain; filter: saturate(.45) brightness(.9); }
[data-job-status="running"] .progress-leaf { animation: maple-tilt 4.8s ease-in-out infinite; }
[data-job-status="queued"] .progress-leaf { filter: saturate(.2) opacity(.7); }
[data-job-status="failed"] .progress-leaf, [data-job-status="expired"] .progress-leaf { filter: grayscale(.8) opacity(.65); }
.task-progress--detail { padding: 14px 0; border-color: var(--line); }
.task-progress--detail .task-progress-track { height: 72px; margin: 0; }
.task-progress--detail .progress { top: 39px; height: 3px; }
.task-progress--detail .progress-cursor { width: 48px; height: 48px; top: 15px; left: clamp(24px, var(--progress), calc(100% - 24px)); }
.task-progress--detail .progress-leaf { width: 48px; height: 48px; }
.task-progress-error:not([hidden]) { color: var(--red); padding: 4px 0 10px; }
@keyframes maple-tilt {
    0%, 100% { transform: translateY(1px) rotate(-20deg) rotateY(0deg); }
    50% { transform: translateY(-3px) rotate(17deg) rotateY(40deg); }
}

.maple-fall { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.maple-fall > span { position: absolute; top: -50px; left: 52%; width: 22px; height: 22px; opacity: 0; animation: maple-fall 24s linear infinite; }
.maple-fall img { width: 100%; height: 100%; filter: saturate(.35); animation: maple-tilt 6s ease-in-out infinite; }
.maple-fall > span:nth-child(2) { left: 76%; width: 16px; height: 16px; animation-duration: 31s; animation-delay: -8s; }
.maple-fall > span:nth-child(3) { left: 91%; width: 25px; height: 25px; animation-duration: 28s; animation-delay: -19s; }
.maple-fall > span:nth-child(4) { left: 63%; width: 13px; height: 13px; animation-duration: 35s; animation-delay: -25s; }
.maple-fall > span:nth-child(5) { left: 86%; width: 18px; height: 18px; animation-duration: 26s; animation-delay: -14s; }
.maple-fall > span:nth-child(6) { left: 43%; width: 15px; height: 15px; animation-duration: 33s; animation-delay: -4s; }
.hero-band .maple-fall > span { animation-duration: 22s; }
.hero-band .maple-fall > span:nth-child(n+4) { display: none; }
@keyframes maple-fall {
    0% { transform: translate3d(0, -20px, 0) rotate(-30deg); opacity: 0; }
    12% { opacity: .45; }
    45% { transform: translate3d(-50px, 44vh, 0) rotate(75deg); }
    85% { opacity: .4; }
    100% { transform: translate3d(30px, 110vh, 0) rotate(160deg); opacity: 0; }
}

.access-screen { min-height: 100svh; padding: 24px 40px 18px; background: #f6f8f7; color: var(--ink); }
.access-art { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.access-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.access-screen::before { position: fixed; inset: 0; width: auto; height: auto; transform: none; background: linear-gradient(90deg, #f8faf9f7 0%, #f8faf9eb 25%, #f8faf9c9 37%, #f8faf930 62%, transparent 80%); z-index: -1; }
.access-screen::after { display: none; }
.access-screen > .maple-fall { position: fixed; z-index: 0; }
.access-masthead, .access-layout, .access-footer { position: relative; z-index: 1; }
.access-masthead { width: min(1160px, 100%); color: #465d61; gap: 8px; font-size: 16px; }
.access-masthead img { width: 27px; height: 27px; object-fit: contain; filter: saturate(.45); }
.access-layout { display: flex; width: min(1160px, 100%); align-items: center; justify-content: flex-start; margin: 25px auto; }
.access-form { width: 350px; max-width: 100%; padding: 0; }
.access-heading { margin-bottom: 22px; }
.access-overline { color: #7b8987; font-size: 11px; }
.access-heading h1 { font-family: "Yu Mincho", "Songti SC", SimSun, serif; font-size: 32px; font-weight: 500; line-height: 1.5; margin: 5px 0 0; white-space: nowrap; }
.access-heading::after { content: ""; display: block; width: 32px; height: 2px; margin-top: 14px; background: #b68577; }
.access-form > label, .access-form .captcha-label > label { font-size: 12px; color: #5e7375; margin: 11px 0 6px; }
.access-form .form-control { min-height: 43px; border-color: #c9d6d2; border-radius: 4px; background: #ffffffc9; color: #334b51; padding: 9px 12px; font-size: 13px; }
.access-form .form-control:hover { border-color: #9fb6af; }
.access-form .form-control:focus { border-color: #658b83; box-shadow: 0 0 0 3px #658b8314; background: #fff; }
.access-form .password-toggle { color: #7a938c; }
.access-form .password-toggle:hover { color: var(--maple); background: #f7eeeb; }
.access-form .captcha-label { margin-top: 3px; }
.access-form .captcha-label .icon-btn { color: #7a8f87; }
.access-form .captcha-label .icon-btn:hover { background: #e7efeb; }
.captcha-instruction { color: #6e8185; font-size: 10px; margin-bottom: 7px; }
.access-form .captcha-selection { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 10px; align-items: stretch; }
.access-form .captcha-image-button { border-color: #ccd8d4; border-radius: 4px; overflow: hidden; }
.access-form .captcha-image-button img { height: 100%; width: 100%; object-fit: contain; aspect-ratio: 360 / 112; }
.access-form .captcha-selection input { min-width: 0; text-align: center; font-size: 16px; font-weight: 550; padding: 8px 5px; }
.access-form .captcha-selection input::placeholder { font-size: 11px; font-weight: 400; }
.access-form .captcha-status { min-height: 22px; color: #9a514a; }
.access-form .check-row { margin: 2px 0 18px; color: #5e7375; font-size: 12px; }
.access-form .check-row input { accent-color: var(--maple); width: 14px; height: 14px; }
.access-submit { background: var(--maple); border-color: var(--maple); color: #fff; justify-content: space-between; padding: 12px 16px; min-height: 45px; border-radius: 4px; }
.access-submit:hover, .access-submit:focus-visible { background: var(--maple-dark); border-color: var(--maple-dark); color: #fff; }
.access-submit:disabled { color: #fff; background: #a8918b; border-color: #a8918b; }
.access-footer { width: min(1160px, 100%); color: #718682; font-size: 9px; }

@media (max-width: 1040px) {
    .nav-inner { align-items: flex-start; flex-direction: column; }
    .nav-links { width: 100%; }
    .operator-profile { margin-left: auto; }
    .access-screen { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 900px) {
    .layout-grid > .panel + .panel { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
}
@media (max-width: 700px) {
    .nav-inner { position: relative; padding: 12px 16px; gap: 8px; }
    .nav-links { gap: 3px; }
    .nav-links > a, .nav-links a.nav-special, .nav-menu > summary { font-size: 11px; padding: 8px 7px; gap: 5px; }
    .nav-links svg { width: 14px; height: 14px; }
    .nav-links .operator-profile { position: static; margin-left: 0; padding-left: 0; border: 0; }
    .nav-menu .nav-dropdown { left: 0; right: auto; }
    .operator-profile form { left: 16px; right: 16px; width: auto; max-width: none; top: calc(100% + 4px); }
    .page { padding: 18px 16px 32px; }
    .hero-band { min-height: 164px; margin-bottom: 20px; }
    .hero-image { object-position: 62% center; }
    .hero-content { padding: 22px; }
    .hero-content h1 { font-size: 27px; }
    .hero-content p { font-size: 11px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
    .metric { padding: 12px 18px; }
    .metric:nth-child(2) { border-right: 0; }
    .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .metric span { font-size: 24px; }
    .panel { padding: 16px 0; }
    .panel-head h1, .panel-head h2 { font-size: 17px; }
    .drop-zone { min-height: 180px; }
    .job-row { padding: 13px; }
    .access-screen { padding: 20px 25px 16px; }
    .access-screen::before { background: linear-gradient(90deg, #f8faf9eb, #f8faf9c9 55%, #f8faf999); }
    .access-art img { object-position: center; }
    .access-layout { width: min(350px, 100%); margin: 24px auto; }
    .access-heading h1 { font-size: 29px; }
    .access-heading { margin-bottom: 18px; }
    .access-screen .maple-fall > span:nth-child(n+4) { display: none; }
    .access-screen .maple-fall > span { left: 92%; }
    .access-screen .maple-fall > span:nth-child(2) { left: 80%; }
    .access-screen .maple-fall > span:nth-child(3) { left: 97%; }
}
@media (max-width: 360px) {
    .access-screen { padding: 18px 20px 14px; }
    .access-layout { margin: 20px auto; }
    .access-heading h1 { font-size: 27px; }
    .access-form .captcha-selection { grid-template-columns: minmax(0, 1fr) 94px; gap: 8px; }
    .access-form .captcha-selection input { font-size: 14px; }
    .hero-content { padding: 20px 16px; }
    .hero-content h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
    .maple-fall { display: none; }
    .progress-leaf, .maple-fall *, .btn, .icon-btn, .access-submit svg { animation: none !important; transition: none !important; }
}
