:root {
  font-family: 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  color: #182b2b;
  background: #f2f5f2;
  font-synthesis: none;
  --muted: #526760;
  --line: #dee7e0;
  --green: #17614b;
  --pale-green: #e2f3e9;
  --ease: cubic-bezier(.2,.75,.25,1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #1c785d; outline-offset: 4px; }
h1, h2, p { margin: 0; }

.shell { width: min(100% - 48px, 812px); margin-inline: auto; padding-bottom: 54px; }
.topbar { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 16px; font-weight: 750; letter-spacing: .04em; }
.brand-mark { width: 30px; height: 30px; position: relative; border-radius: 10px; background: #1c604c; box-shadow: 0 3px 9px #1c604c25; }
.brand-mark::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px solid #e6faf0; }
.brand-mark::after { content: ''; position: absolute; width: 5px; height: 6px; left: 14px; top: 10px; border-left: 1.5px solid #e6faf0; border-bottom: 1.5px solid #e6faf0; }
.settings-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 25px; background: #fbfcfa; color: #374e47; font-size: 13px; font-weight: 650; }
.settings-button:hover { background: white; border-color: #a5b9ac; }
.dot { width: 7px; height: 7px; background: #b16b30; border-radius: 50%; }
[data-connected='true'] .dot { background: #25815d; }

.hero { min-height: 220px; display: flex; position: relative; isolation: isolate; overflow: hidden; align-items: center; padding: 35px 42px; border-radius: 26px; color: #f2faf6; background: radial-gradient(ellipse at 100% 87%, #266259 0%, transparent 62%), linear-gradient(125deg, #102d2c, #194440); box-shadow: 0 9px 25px #1b413722; }
.hero-date { color: #bce5d2; font-size: 14px; font-weight: 650; letter-spacing: .10em; }
.hero h1 { margin: 9px 0 10px; font-size: clamp(34px, 6vw, 57px); letter-spacing: -.04em; line-height: 1.12; }
.hero-text { color: #d5eae2; font-size: 15px; line-height: 1.65; }
.hero-clock { position: absolute; z-index: -1; width: 310px; height: 310px; top: 50%; right: 7px; transform: translateY(-50%); display: grid; place-items: center; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 31px, #a3e5ca1e 31px 32px); mask-image: linear-gradient(90deg, transparent, black 27%); }
.clock-face { position: relative; width: 124px; aspect-ratio: 1; border: 1px solid #c6f9e49a; border-radius: 50%; background: linear-gradient(150deg, #a3f1d736, #a3f1d705); box-shadow: inset 0 0 30px #c7fced1c, 0 0 36px #84cbb319; }
.clock-face::before, .clock-face::after { content: ''; position: absolute; left: 50%; top: 50%; height: 2px; transform-origin: left center; border-radius: 3px; background: #c6f9e4; }
.clock-face::before { width: 34px; transform: rotate(-38deg); }
.clock-face::after { width: 25px; transform: rotate(208deg); }
.clock-face span { position: absolute; left: calc(50% - 3px); top: calc(50% - 2px); width: 6px; height: 6px; border-radius: 50%; background: #dcffef; }

.punch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.punch, .agenda { border: 1px solid var(--line); border-radius: 22px; background: #fcfdfa; }
.punch { padding: 22px; transition: border-color .2s var(--ease), box-shadow .22s var(--ease); }
.punch[data-current='true'] { border-color: #8fbeaa; box-shadow: 0 3px 12px #214e3610; }
.punch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.punch-icon { display: grid; place-items: center; position: relative; flex: none; width: 39px; height: 39px; border-radius: 12px; }
.sun { color: #8f5821; background: #fbefde; }
.sun::before { content: ''; width: 10px; height: 10px; border: 1.6px solid; border-radius: 50%; }
.sun::after { content: ''; position: absolute; width: 2px; height: 2px; border-radius: 50%; background: currentColor; box-shadow: 0 -9px, 0 9px, -9px 0, 9px 0, -6px -6px, 6px -6px, -6px 6px, 6px 6px; }
.moon { color: #4a5c8c; background: #e9edf8; }
.moon::before { content: ''; width: 16px; height: 16px; border-radius: 50%; box-shadow: -4px 3px 0 0 currentColor; transform: translate(2px, -2px); }
.record-state { border-radius: 20px; background: #edf2ed; color: var(--muted); padding: 4px 9px; font-size: 12px; font-weight: 650; }
[data-recorded='true'] .record-state { color: var(--green); background: var(--pale-green); }
.punch h2 { font-size: 23px; letter-spacing: -.03em; }
.record-time { color: var(--muted); margin: 5px 0 17px; font-size: 13px; line-height: 1.5; }
.record-button, .primary, .secondary { min-height: 46px; padding: 7px 13px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; font-weight: 700; transition: background .18s var(--ease), color .18s var(--ease), transform .16s var(--ease); }
.record-button { width: 100%; color: var(--green); background: #e8f3ec; }
.record-button:not(:disabled):hover, .secondary:not(:disabled):hover { background: #d9ece1; }
.primary, [data-current='true'] .record-button:not(:disabled) { color: white; background: var(--green); }
.primary:not(:disabled):hover, [data-current='true'] .record-button:not(:disabled):hover { background: #114d3b; }
.record-button:not(:disabled):active, .primary:not(:disabled):active, .secondary:not(:disabled):active { transform: scale(.985); }
.record-button:disabled, .primary:disabled, .secondary:disabled { color: #5d7268; background: #eef2ee; }

.agenda { padding: 18px 22px 8px; margin-top: 16px; }
.agenda-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.agenda h2 { font-size: 17px; }
.timezone, .agenda-note { color: var(--muted); font-size: 13px; }
.agenda-note { margin-top: 6px; line-height: 1.55; }
.schedule { list-style: none; padding: 0; margin: 9px 0 0; }
.schedule li { display: grid; grid-template-columns: 67px 1fr auto; align-items: baseline; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); color: #395049; font-size: 14px; }
.schedule time { color: #203e37; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-weight: 700; }
.daily-state { color: var(--muted); text-align: right; font-size: 12px; }
.daily-state[data-state='sent'] { color: #196448; }
.daily-state[data-state='failed'], .daily-state[data-state='uncertain'], .message[data-error='true'] { color: #963c25; }
.job-error { display: block; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.message { position: fixed; z-index: 2; inset: auto 16px 19px; width: fit-content; max-width: min(440px, 100% - 32px); margin: auto; padding: 10px 16px; border: 1px solid #b6d5c5; border-radius: 12px; background: #f3fff8; color: var(--green); box-shadow: 0 8px 24px #263d3326; font-size: 13px; animation: appear .20s var(--ease); }
.message[data-error='true'] { background: #fff7f3; border-color: #e7c3af; }

dialog { width: min(460px, 100% - 32px); max-height: calc(100% - 36px); padding: 23px 24px; color: inherit; background: #fcfdfa; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 65px #102d2c38; }
dialog[open] { animation: appear .22s var(--ease); }
dialog::backdrop { background: #152d27a6; }
@keyframes appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; }
.dialog-header h2 { font-size: 23px; }
.close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #edf2ed; color: #3e5c52; font-size: 25px; line-height: 1; }
.close:hover { background: #e3ece4; }
.dialog-note { margin: 7px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
label { display: block; margin-top: 12px; color: #2b423a; font-size: 13px; font-weight: 650; }
label small { color: var(--muted); font-weight: 400; }
input { width: 100%; height: 44px; margin-top: 5px; padding: 0 11px; border: 1px solid #c3d3c8; border-radius: 9px; color: inherit; background: white; font-size: 16px; }
input::placeholder { color: var(--muted); font-size: 13px; }
.settings-status { margin-top: 11px; min-height: 22px; color: #435b52; font-size: 13px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.secondary { color: var(--green); background: #e8f3ec; }
.roster { padding-bottom: 18px; }
.roster .agenda-head { align-items: center; }
.roster .secondary { flex: none; }
.roster-week, .roster-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.roster-week { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.roster-days { list-style: none; padding: 0; margin: 0; }
.roster-days li { border-radius: 9px; background: #e8f3ec; color: #204b3c; padding: 5px 1px; font-weight: 700; }
.roster-days li[data-rest='true'] { background: #eef0ed; color: #54625a; }
.roster-days small { display: block; font-size: 11px; font-weight: 500; }
.roster-edit { margin-top: 14px; border-top: 1px solid #dfe8e0; padding-top: 12px; }
.roster-edit summary { min-height: 44px; padding: 10px 0; color: var(--green); cursor: pointer; font-weight: 700; }
.roster-hint { margin: 5px 0 0; }
.logout { min-height: 44px; margin-right: auto; padding: 4px 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; }
.logout:hover { color: var(--green); text-decoration: underline; }
.dialog-actions { flex-wrap: wrap; }

.login-shell { width: min(100% - 32px, 420px); margin-inline: auto; padding-block: clamp(40px, 15vh, 150px) 30px; }
.login-card { padding: clamp(23px, 5vw, 37px); border: 1px solid var(--line); border-radius: 25px; background: #fcfdfa; box-shadow: 0 10px 32px #1b413713; }
.login-mark { display: block; }
.login-card h1 { margin-top: 12px; font-size: 30px; }
.login-card form { margin-top: 21px; }
.login-card button { width: 100%; }

@media (max-width: 570px) {
  .shell { width: calc(100% - 30px); padding-bottom: 32px; }
  .topbar { min-height: 62px; }
  .hero { min-height: 172px; padding: 25px 21px; border-radius: 21px; }
  .hero-text { max-width: 16em; font-size: 13px; }
  .hero-clock { width: 190px; height: 190px; right: -31px; opacity: .51; }
  .clock-face { width: 86px; }
  .clock-face::before { width: 24px; }
  .clock-face::after { width: 17px; }
  .punch-grid { gap: 9px; margin-top: 12px; }
  .punch { padding: 13px; border-radius: 16px; }
  .punch h2 { font-size: 18px; }
  .record-time { margin-bottom: 12px; font-size: 12px; }
  .record-button { padding-inline: 5px; font-size: 13px; }
  .agenda { padding-inline: 14px; margin-top: 12px; border-radius: 16px; }
  .schedule li { grid-template-columns: 55px 1fr auto; gap: 6px; }
}

@media (max-width: 340px) {
  .punch-grid { grid-template-columns: 1fr; }
  .hero-clock { opacity: .28; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
