:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
  --ink: #151d33;
  --muted: #696f7c;
  --line: #e4e9f0;
  --accent: #5f5be4;
  --page: #f4f8fb;
  --record-fill: #f8fcff;
  --record-border: #eaedf2;
  --record-title: #08112e;
  --record-label: #9296a8;
  --record-value: #151c2b;
  --closed-fill: #e0f2fe;
  --closed-text: #3f78d9;
  --summary-text: #d6354a;
  --required-text: #cf223d;
  --field-label: #373737;
  --field-input: #383838;
  --field-value: #999999;
  --field-placeholder: #c9c9cb;
  --field-counter: #7f7f7f;
  --field-rule: #f2f2f2;
  --section-marker: #3da0fe;
  --progress-complete: #07bf60;
  --progress-complete-text: #46c287;
  --progress-waiting: #a2a2a4;
  --progress-line: #cfd3d6;
  --material-text: #f1be72;
  --material-border: #d2d3d7;
  --soft: #eeedfc;
  --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .64; }
:focus-visible { outline: 3px solid #5c63d7; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
/* 全端统一手机界面：黑顶栏 + 手机宽度居中，不再分 PC / 手机两套 */
.topbar { position: sticky; top: 0; z-index: 3; background: #000; color: #fff; border: 0; }
.bar-inner { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #384db9; color: #fff; font-size: 15px; }
.mobile-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 480px;
  margin: auto;
  min-height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 13px 0;
}
.mobile-nav { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-self: start; }
#mobile-title { grid-column: 2; background: transparent; border: 0; color: inherit; font-size: 17px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
#mobile-title.title-pulse { animation: title-pulse 0.9s ease-in-out 3; }
@keyframes title-pulse {
  0%, 100% { text-shadow: 0 0 0 transparent; transform: scale(1); }
  50% { text-shadow: 0 0 14px #ffffffcc; transform: scale(1.06); }
}
.title-hint { position: absolute; top: calc(100% + 8px); left: 50%; max-width: min(320px, calc(100vw - 32px)); background: #fff; color: #15192d; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.5; text-align: center; box-shadow: 0 10px 30px #171f4133; z-index: 4; animation: hint-bounce 1s ease-in-out infinite; }
.title-hint::before { content: ''; position: absolute; bottom: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom-color: #fff; }
@keyframes hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}
#mobile-back { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
#mobile-back span { width: 10px; height: 10px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
#mobile-close { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; }
#mobile-close span { font-size: 26px; line-height: 1; font-weight: 400; }
#screen { max-width: 480px; margin: auto; padding: 12px 15px 26px; }
#screen:has(.footer-actions) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.narrow { max-width: 760px; margin-inline: auto; }
.panel, .record { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 24px; min-width: 0; }
.panel h2 { font-size: 18px; margin-bottom: 16px; }
.panel p, .helper { color: var(--muted); line-height: 1.65; font-size: 14px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(27px, 5vw, 36px); line-height: 1.25; margin-top: 8px; }
.back { display: inline-block; padding: 5px 0; color: var(--accent); font-size: 14px; font-weight: 700; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; border-radius: 12px; padding: 14px 17px; background: var(--soft); margin-bottom: 16px; font-size: 14px; }
.stats strong { color: #343c98; margin-left: 5px; }
.leave-list > .stats { color: var(--summary-text); }
.leave-list > .stats strong { color: inherit; }
.record + .record, .panel + .panel { margin-top: 14px; }
.record h2 { font-size: 20px; overflow-wrap: anywhere; color: var(--record-title); }
.record-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-options { position: relative; flex: none; }
.record-options > summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; cursor: pointer; list-style: none; color: var(--muted); }
.record-options > summary::-webkit-details-marker { display: none; }
.record-options > summary span { font-size: 23px; line-height: 1; }
.record-options > summary:hover, .record-options[open] > summary { background: #eef1f8; }
.record-option-list { position: absolute; z-index: 1; top: 100%; right: 0; min-width: max-content; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 6px 18px #171f4120; }
.record-option-list .btn { min-height: 44px; border-color: transparent; }
.record-body { margin-top: 14px; padding: 14px 16px 2px; border: 1px solid var(--record-border); border-radius: 12px; background: var(--record-fill); }
.record-body .meta dt { color: var(--record-label); }
.record-body .meta dd { color: var(--record-value); }
.status { font-size: 13px; font-weight: 700; color: var(--closed-text); background: var(--closed-fill); border-radius: 6px; padding: 5px 8px; white-space: nowrap; }
.status.pending { color: #795615; background: #fff3d5; }
.meta { margin: 14px 0; }
.meta div { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(0, 2.5fr); gap: 12px; padding: 9px 0; }
.meta dt { color: var(--muted); font-size: 14px; }
.meta dd { overflow-wrap: anywhere; }
.date-range { display: grid; gap: .28em; font-variant-numeric: tabular-nums; }
.record .actions { padding-top: 14px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btn { display: inline-flex; min-height: 42px; justify-content: center; align-items: center; padding: 8px 15px; border-radius: 9px; border: 1px solid #c4ccea; background: white; color: #3d439a; font-weight: 700; font-size: 14px; text-align: center; }
.btn:hover { background: #eef0fc; }
.btn.danger { color: #9c3344; border-color: #eccbd2; }
.btn.danger:hover { background: #fff1f3; }
.btn.confirm-danger { color: white; background: #a93144; border-color: #a93144; }
.btn.confirm-danger:hover { background: #912537; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fbfbff; }
.btn.primary:hover { background: #4e4bc6; }
.file-picker { position: relative; cursor: pointer; background: #f7f8fa; }
.file-picker:focus-within { outline: 3px solid #5c63d7; outline-offset: 3px; }
.file-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.end { text-align: center; margin: 18px 0; color: #96989c; font-size: 13px; }
.star-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.star-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 2px; }
.star-heading { font-size: 15px; font-weight: 700; margin: 16px 0 10px; }
.star-links .btn { min-height: 36px; font-size: 13px; }
.star-links .btn svg { width: 16px; height: 16px; margin-right: 6px; flex: none; }
.bonus-link { margin-right: auto; align-self: center; background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font-size: 13px; font-weight: 400; text-decoration: underline; cursor: pointer; }
.bonus-link:hover { background: none; }
.bonus-result { text-align: center; font-size: 17px; line-height: 1.9; }
.bonus-result p { margin: 0; }
.bonus-result strong { font-size: 26px; color: var(--accent); }
.bonus-visits { margin-top: 12px !important; font-size: 13px; color: var(--muted); }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; border: 0; padding: 0; margin: 0; background: transparent; }
#confetti:popover-open { margin: 0; inset: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.full { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field > label, legend { font-size: 14px; font-weight: 700; }
.req { color: var(--required-text); margin-left: 3px; }
.field input, .field select, .field textarea, .time-inputs input { width: 100%; min-height: 44px; border: 1px solid #c8d0e2; border-radius: 9px; background: #fff; padding: 9px 11px; min-width: 0; }
.time-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.time-inputs label { display: grid; gap: 5px; color: var(--muted); font-size: 14px; min-width: 0; }
.time-inputs input { font-size: 16px; }
.time-trigger { display: none; }
.duration-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.field select { appearance: none; padding-right: 28px; }
.field select:required:invalid { color: var(--field-placeholder); }
.field select option { color: var(--ink); }
.select-field { position: relative; }
.select-field::after { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.field textarea { resize: vertical; min-height: 86px; }
.field input::placeholder, .field textarea::placeholder { color: var(--field-placeholder); opacity: 1; }
.field :user-invalid, .time-inputs :user-invalid { border-color: #af343d; background: #fff7f7; }
.field small { justify-self: end; color: var(--field-counter); font-size: 13px; }
fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
.segment { display: flex; gap: 7px; }
.segment label { position: relative; display: flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--accent); border-radius: 8px; padding: 9px 14px; cursor: pointer; color: var(--accent); }
.segment label:has(:checked) { background: var(--accent); color: #fbfbff; }
.segment input { margin: 0; accent-color: var(--accent); }
.segment input:checked { accent-color: var(--card); }
.notice { border-radius: 10px; padding: 11px 13px; background: #fff7e3; color: #664a19; font-size: 14px; margin-bottom: 12px; }
.material-notice { margin: 20px 0 16px; border: 1px solid var(--material-border); background: var(--page); color: var(--material-text); }
.upload-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.attachment { width: 100px; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.attachment img { display: block; width: 100px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.attachment button { margin-block: 5px; color: #8d2c33; border: 0; background: transparent; padding: 4px 0; }
.footer-actions { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 48px)); background: var(--page); border-top: 1px solid var(--line); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); z-index: 2; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; gap: 8px; padding: 0; margin: 0; }
.progress li { padding-bottom: 8px; border-bottom: 2px solid var(--progress-line); color: var(--progress-waiting); text-align: center; font-size: 14px; }
.progress li.done { border-color: var(--progress-complete); color: var(--progress-complete-text); font-weight: 700; }
.detail-status { margin: 14px 0 16px; }
.detail-status .status { display: inline-block; }
.details .meta { margin: 0; }
.details .meta div + div { border-top: 1px solid var(--field-rule); }
.sign-preview { display: block; width: min(100%, 420px); border: 1px solid var(--line); border-radius: 9px; }
dialog { border: 1px solid var(--line); border-radius: 18px; color: var(--ink); width: min(480px, calc(100% - 24px)); padding: 22px; max-height: calc(100dvh - 24px); box-shadow: 0 18px 80px #171f4140; }
dialog h2 { font-size: 21px; margin-bottom: 10px; }
dialog .actions { margin-top: 16px; }
.usage-notice { font-size: 14px; font-weight: 700; color: var(--ink); background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.usage-tip { font-size: 13px; line-height: 1.6; color: #57450a; background: #fef9e7; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.quick-btn { width: 100%; }
.usage-help { display: grid; gap: 12px; }
.usage-help dt { margin-bottom: 3px; font-size: 14px; font-weight: 700; }
.usage-help dd { color: var(--muted); font-size: 14px; line-height: 1.65; }
.copy-link { position: relative; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.copy-link::after { content: '点击复制网址'; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #252b58; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.4; padding: 5px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.copy-link:hover::after, .copy-link:focus-visible::after { opacity: 1; }
.help-steps { margin: 8px 0 8px 20px; padding: 0; display: grid; gap: 4px; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: #191f4390; overflow: hidden; overscroll-behavior: contain; }
canvas { width: 100%; height: 140px; display: block; border: 1px dashed #9da8d7; background: #f8f9ff; border-radius: 10px; touch-action: none; margin: 12px 0 6px; }
.proof { padding: 14px; background: var(--soft); border-radius: 10px; margin-top: 14px; }
#toast:not(:empty) { position: fixed; z-index: 4; bottom: 78px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 10px 16px; border: 0; border-radius: 9px; background: #252b58; color: #fff; font-size: 14px; }
#toast:popover-open { margin: 0; inset: auto auto 78px 50%; }
.title-hint-note { font-size: 12px; opacity: .75; }
@media (min-width: 0px) {
  :root { scroll-padding-top: calc(62px + env(safe-area-inset-top)); }
  .topbar { background: #000; color: #fff; border: 0; }
  .bar-inner { display: none; }
  .mobile-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: calc(48px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 13px 0;
  }
  #mobile-title { grid-column: 2; background: transparent; border: 0; color: inherit; font-size: 17px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
  #mobile-back { grid-column: 1; grid-row: 1; display: grid; place-items: center; justify-self: start; min-width: 44px; min-height: 44px; }
  #mobile-back span { width: 10px; height: 10px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
  #screen { padding: 12px 15px 26px; }
  .page-head { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .page-head .back { display: none; }
  .footer-actions { width: min(480px, 100%); padding: 7px 12px max(7px, env(safe-area-inset-bottom)); background: #fff; }
  .footer-actions .primary { flex: 1; min-height: 44px; font-size: 16px; font-weight: 600; border-radius: 13px; }
  .footer-actions .primary:hover { background: var(--accent); }
  .panel, .record { padding: 14px 15px; border-radius: 12px; }
  .leave-list > .stats { justify-content: center; gap: 4px 10px; margin: 0 0 12px; padding: 0; background: none; }
  .leave-list > .stats strong { font-weight: 500; }
  .record { box-shadow: 0 2px 6px #15204509; }
  .record-heading { position: relative; min-height: 25px; padding-right: 38px; }
  .record-options { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); }
  .record h2 { font-size: 16px; font-weight: 650; }
  .record-body { margin-top: 12px; padding: 10px 14px 7px; border-radius: 14px; }
  .status { font-weight: 550; }
  .record-body .meta { margin: 9px 0 3px; font-size: 14px; line-height: 1.45; }
  .record-body .meta div { grid-template-columns: minmax(75px, 1fr) minmax(0, 2.15fr); gap: 9px; padding: 6px 0; }
  .record .actions { padding-top: 12px; gap: 10px; }
  .record .actions .btn { min-height: 36px; padding-inline: 15px; font-size: 13px; font-weight: 500; }
  .record .actions .btn:not(.danger) { background: var(--accent); border-color: var(--accent); color: #eff1ff; }
  .application-info { padding: 0; border: 0; background: transparent; }
  .application-info > h2, .application-material > h2, .details .panel > h2 { border-left: 3px solid var(--section-marker); padding-left: 8px; font-size: 16px; font-weight: 650; color: #000002; }
  .application-info > h2 { margin-bottom: 8px; }
  .application-info .stats, .form-grid {
    --label-width: clamp(92px, 31%, 132px);
    padding: 0 16px;
    margin: 0 7px;
    background: white;
  }
  .application-info .stats { display: grid; gap: 0; border-radius: 10px 10px 0 0; }
  .application-info .stats span { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--field-rule); color: var(--field-label); }
  .application-info .stats strong { margin: 0; color: var(--field-value); text-align: right; font-weight: 400; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: 0 0 10px 10px; }
  .form-grid > * + * { border-top: 1px solid var(--field-rule); }
  .form-grid .field {
    display: grid;
    grid-template-columns: var(--label-width) minmax(0, 1fr);
    align-items: start;
    gap: 0 6px;
    padding: 5px 0;
  }
  .field > label { padding-top: 12px; font-weight: 400; color: var(--field-label); }
  .field input, .field select, .field textarea { border-color: transparent; border-radius: 5px; padding-left: 5px; color: var(--field-input); }
  .field :user-invalid, .time-inputs :user-invalid { border-color: #af343d; }
  .field select { padding-right: 20px; }
  .select-field::after { right: 5px; }
  .field small { grid-column: 2; padding: 0 3px 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
  .reason-field textarea { min-height: 90px; resize: vertical; }
  .time-range, .choice-field { display: flow-root; padding: 10px 0; }
  .time-range legend, .choice-field legend { float: left; width: var(--label-width); margin: 0 6px 0 0; padding: 10px 0 0; font-weight: 400; color: var(--field-label); }
  .time-inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .time-inputs label { padding-left: 5px; font-size: 12px; }
  .time-inputs input { min-height: 38px; padding: 4px 5px; }
  .time-trigger { display: block; position: relative; width: calc(100% - var(--label-width) - 6px); min-height: 40px; padding: 6px 25px 6px 5px; border: 0; background: none; text-align: left; color: var(--field-input); }
  .time-trigger[data-empty] { color: var(--field-placeholder); }
  .time-trigger::after { content: ""; position: absolute; right: 5px; top: 14px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .time-trigger[aria-expanded="true"]::after { transform: translateY(4px) rotate(225deg); }
  .time-range[data-time-open="false"] .time-inputs { display: none; }
  .duration-row { padding: 14px 0; font-size: 14px; color: var(--field-label); }
  .duration-row output { color: var(--field-value); }
  .material-notice { margin-inline: 7px; }
  .details .panel { padding: 14px; }
  .details .meta div { grid-template-columns: minmax(95px, 1fr) minmax(0, 1.8fr); align-items: start; padding: 11px 0; line-height: 1.45; }
  .details .meta dt { color: var(--field-label); }
  .details .meta dd { text-align: right; color: var(--field-value); font-size: 14px; }
  .progress li { font-size: 13px; }
  .progress li.done { font-weight: 550; }
}
