:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color-scheme:light;--bg:#f6f6f6;--surface:#fff;--surface-2:#f0f0f0;--ink:#262626;--muted:#747474;--line:#e4e4e4;--line-strong:#d3d3d3;--digit-top:#fff;--digit-bottom:#f1f1f1;--digit-ink:#242424;--accent:#171717;--on-accent:#fff;--hover:#ebebeb;--shadow:0 6px 10px #23292106,0 2px 2px #23292104;--heat0:#eeeeea;--heat1:#daddd6;--heat2:#bec5b9;--heat3:#9ba795;--heat4:#74836d;--heat5:#52654a;--heat6:#344b2e}
html[data-theme="dark"]{color-scheme:dark;--bg:#191919;--surface:#222;--surface-2:#2b2b2b;--ink:#e8e8e8;--muted:#a0a0a0;--line:#353535;--line-strong:#505050;--digit-top:#212121;--digit-bottom:#272727;--digit-ink:#ededed;--accent:#ededed;--on-accent:#232323;--hover:#303030;--shadow:0 7px 12px #0002,0 2px 2px #0002;--heat0:#303630;--heat1:#485044;--heat2:#616e58;--heat3:#7c926f;--heat4:#9eb68d;--heat5:#bdd5a9;--heat6:#ddedcd}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);min-height:100vh;transition:background .2s,color .2s}button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:not-allowed;opacity:.35}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--control-accent);outline-offset:4px}button{touch-action:manipulation}button, a,input{-webkit-tap-highlight-color:transparent}button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}a{color:inherit;text-decoration:none}.header-actions{display:flex;align-items:center;gap:10px}.local-status{font-size:11px;color:var(--muted);margin-right:20px;display:flex;align-items:center;gap:7px}.status-dot{width:5px;height:5px;background:var(--control-accent);border-radius:50%}.icon-button{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:8px;font-size:24px;line-height:1;color:var(--muted);flex-shrink:0}.icon-button:hover{background:var(--hover);color:var(--ink)}.icon-button.enabled{color:var(--control-accent)}.eyebrow{font-size:9px;letter-spacing:2.3px;font-weight:600;color:var(--muted)}h1{font-size:32px;line-height:1.6;font-weight:500;letter-spacing:2px;margin:17px 0 12px}.intro{font-size:12px;line-height:1.8;color:var(--muted);margin:0 0 35px}h2{font-size:15px;letter-spacing:.3px;font-weight:600;margin:0}.activity-card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:22px 20px 0;box-shadow:0 2px 2px #23292102}.section-title{display:flex;align-items:center;justify-content:space-between}.small-label{font-size:9px;color:var(--muted)}.heat-nav{display:flex;align-items:center;justify-content:space-between;margin:21px -5px 12px;font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}.icon-button.small{width:24px;height:24px;font-size:22px}.heat-calendar{display:flex;flex-direction:column;gap:18px}.heat-month{display:grid;grid-template-columns:32px repeat(7,1fr);gap:6px;align-items:center}.month-label{grid-row:2 / span 6;align-self:start;font-size:10px;color:var(--muted);padding-top:4px}.weekday{font-size:8px;text-align:center;color:var(--muted);padding-bottom:3px}.heat-cell{background:var(--heat0);border-radius:3px;border:none;padding:0;aspect-ratio:1;min-width:0}.heat-month .heat-cell{width:100%;position:relative;transition:transform .12s,box-shadow .12s}.heat-month .heat-cell:hover{transform:scale(1.15);z-index:1;box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--muted)}.heat-cell.level-0{background:var(--heat0)}.heat-cell.level-1{background:var(--heat1)}.heat-cell.level-2{background:var(--heat2)}.heat-cell.level-3{background:var(--heat3)}.heat-cell.level-4{background:var(--heat4)}.heat-cell.level-5{background:var(--heat5)}.heat-cell.level-6{background:var(--heat6)}.heat-cell.selected{box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--clock-accent)!important;z-index:1}.heat-cell.today:after{content:"";position:absolute;width:3px;height:3px;border-radius:50%;background:var(--ink);left:calc(50% - 1.5px);bottom:3px}.heat-cell.today.level-6:after{background:var(--surface)}.heat-cell.future{opacity:.35;cursor:default}.heat-blank{aspect-ratio:1}.heat-legend{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-top:19px;color:var(--muted);font-size:8px}.heat-legend .heat-cell{width:11px;height:11px;aspect-ratio:auto}.heat-legend>span:first-child{margin-right:3px}.heat-legend>span:nth-last-child(2){margin-left:3px}.legend-help{width:14px;height:14px;padding:0;border:1px solid var(--line-strong);border-radius:50%;font-size:9px;background:transparent;color:var(--muted);margin-left:4px}.heat-tip{text-align:right;font-size:9px;color:var(--muted);margin:10px 0 22px}.activity-stats{border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(3,1fr);padding:21px 0 22px}.activity-stats>div{display:flex;flex-direction:column;align-items:center;gap:6px;border-right:1px solid var(--line)}.activity-stats>div:last-child{border:none}.stat-number{font-size:24px;font-weight:500;font-variant-numeric:tabular-nums}.stat-label{font-size:9px;color:var(--muted)}.side-note{display:flex;gap:12px;margin:27px 3px 0;align-items:center}.note-line{width:23px;height:1px;background:var(--line-strong)}.side-note p{font-size:10px;color:var(--muted);line-height:2;margin:0}.back-today{margin-top:12px}.main-panel{min-width:0}.flip-digit.flipping .flip-leaf{display:block;animation:flip-down .45s cubic-bezier(.37,.1,.35,1) forwards}@keyframes flip-down{0%{transform:rotateX(0deg)}100%{transform:rotateX(-90deg)}}.timer-actions{margin-top:25px;display:flex;gap:12px;justify-content:center;position:relative}.primary-button{background:var(--accent);color:var(--on-accent);border:none;border-radius:8px;padding:0 34px;min-width:172px;height:48px;display:flex;align-items:center;justify-content:center;gap:11px;font-size:12px;letter-spacing:1px;box-shadow:0 2px 3px #0000000c;transition:transform .15s,opacity .15s}.primary-button:hover{transform:translateY(-1px);opacity:.9}.primary-button svg{width:16px;height:16px;fill:currentColor;stroke-width:0}.primary-button.is-running svg{stroke:currentColor;fill:none;stroke-width:3}.reset-button{position:absolute;left:calc(50% + 99px);top:6px}.timer-hint{font-size:10px;color:var(--muted);margin:16px 0 0;min-height:15px}.completion-banner{border:1px solid var(--line);background:var(--surface);padding:12px 18px;font-size:11px;line-height:1.7;border-radius:8px;margin:18px auto 0;max-width:450px}.tasks-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.tasks-heading>div{display:flex;align-items:center;gap:12px}.tasks-heading h2{font-size:16px}.tasks-heading #task-summary{font-size:10px;color:var(--muted)}.add-button{display:flex;gap:5px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:7px;padding:8px 12px;font-size:11px}.add-button:hover{border-color:var(--line-strong)}.add-button>span{font-size:17px;line-height:1}.text-button{font-size:inherit;color:var(--muted);border:0;background:none;padding:2px 0;cursor:pointer}.text-button:hover{color:var(--ink)}.add-form{margin-top:16px;background:var(--surface);border:1px solid var(--line-strong);border-radius:8px;padding:15px}.add-form input{display:block;width:100%;background:transparent;color:var(--ink);font-size:13px;border:0;padding:4px 0 13px;outline:none}.form-actions{display:flex;align-items:center;gap:15px;font-size:10px}.compact-button{border:0;background:var(--accent);color:var(--on-accent);border-radius:6px;padding:8px 16px;font-size:11px}.task-row{display:flex;align-items:center;gap:12px;position:relative;border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-bottom:8px;padding:15px 12px 15px 15px;min-height:72px;cursor:pointer}.task-row:hover{border-color:var(--line-strong)}.task-toggle{width:19px;height:19px;flex-shrink:0;border:1.5px solid var(--line-strong);background:transparent;border-radius:50%;padding:0;display:grid;place-items:center;color:var(--muted);font-size:12px}.task-toggle:hover{border-color:var(--ink);background:var(--hover)}.task-info{min-width:0;flex:1}.task-title{font-size:12px;line-height:1.7;overflow-wrap:anywhere;display:block}.task-meta{display:flex;gap:8px;font-size:9px;color:var(--muted);margin-top:3px;align-items:center}.task-row.completed{opacity:.58;cursor:default}.task-row.completed .task-title{text-decoration:line-through}.task-row.completed .task-toggle{background:var(--surface-2)}.task-count{font-size:13px;display:flex;align-items:center;gap:5px;flex-shrink:0;font-variant-numeric:tabular-nums}.task-count .tomato-text{font-size:11px;filter:saturate(.65)}.task-more{position:relative}.more-button{font-size:18px;width:25px;height:28px;letter-spacing:1px}.task-menu{position:absolute;right:0;top:30px;background:var(--surface);padding:4px;border:1px solid var(--line);box-shadow:0 5px 20px #0002;border-radius:7px;width:116px;z-index:20}.task-menu button{border:0;background:transparent;width:100%;padding:9px 7px;text-align:left;font-size:11px;color:var(--danger);border-radius:4px}.task-menu button:hover{background:var(--hover)}.completed-divider{display:flex;gap:10px;align-items:center;font-size:9px;color:var(--muted);margin:20px 0 12px}.completed-divider:after{content:"";height:1px;background:var(--line);flex:1}.empty-state{text-align:center;padding:31px 15px 24px;color:var(--muted)}.empty-symbol{display:grid;place-items:center;margin:auto;width:38px;height:38px;border:1px dashed var(--line-strong);border-radius:10px;font-size:22px;font-weight:300}.empty-state p{font-size:12px;color:var(--ink);margin:15px 0 8px}.empty-state>span:last-child{font-size:10px;line-height:1.8}.task-footer{display:flex;justify-content:space-between;gap:12px;font-size:9px;color:var(--muted);padding-top:5px}.tomato-text{font-size:12px}.heat-tooltip{position:fixed;padding:9px 13px;background:var(--ink);color:var(--bg);font-size:10px;border-radius:6px;z-index:100;pointer-events:none;box-shadow:0 3px 15px #0002;white-space:nowrap}dialog{color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:29px;width:480px;max-width:calc(100vw - 32px);max-height:85vh;box-shadow:0 20px 70px #0003}dialog::backdrop{background:color-mix(in srgb,var(--clock-accent) 14%,#10141063);backdrop-filter:blur(5px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.dialog-heading h2{font-size:20px;margin-top:9px}.dialog-heading .icon-button{align-self:start}.settings-section{padding:17px 0;border-top:1px solid var(--line)}.settings-section h3{font-size:12px;font-weight:600;margin:0 0 12px}.settings-section p,dialog>p{font-size:11px;color:var(--muted);line-height:1.9}.theme-options{display:flex;gap:8px}.theme-options button{padding:9px 15px;font-size:11px;background:var(--surface-2);border:1px solid transparent;border-radius:7px}.theme-options button.active{border-color:var(--ink)}.secondary-button{font-size:11px;border:1px solid var(--line-strong);background:var(--surface);border-radius:6px;padding:9px 13px}.secondary-button:hover{background:var(--hover)}#test-sound{font-size:11px;margin-left:15px}.backup-actions{display:flex;flex-wrap:wrap;gap:9px}.small-note{font-size:10px!important}.instructions p{font-size:10px}.confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}#confirm-dialog h2{font-size:18px}.legend-table{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:24px 0}.legend-table>div{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--muted)}.legend-table .heat-cell{width:20px;height:20px}

@media(max-width:1100px){.activity-card{padding:18px 15px 0}.tasks-heading>div{display:block}#task-summary{display:block;margin-top:5px}.heat-month{gap:5px}}
@media(max-width:820px){.main-panel{order:0}.activity-card{padding:22px 20px 0}.heat-calendar{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.heat-month{grid-template-columns:repeat(7,1fr);gap:4px}.month-label{grid-row:1;grid-column:1 / -1;padding:0 0 5px;text-align:center}.weekday{grid-row:2;font-size:7px}.heat-cell{border-radius:2px}.heat-tip{margin-bottom:17px}.heat-legend{margin-top:20px}.activity-stats{padding:17px 0}.local-status{font-size:9px;margin-right:8px}.header-actions{gap:3px}.header-actions .icon-button{width:32px;height:32px}}
@media(max-width:420px){.local-status{display:none}.task-row{padding:13px 9px 13px 12px;gap:9px}.tasks-heading h2{font-size:15px}.heat-calendar{gap:8px}.heat-month{gap:3px}.activity-card{padding:18px 12px 0}.heat-legend .heat-cell{width:10px;height:10px}.heat-cell.today:after{width:2px;height:2px;left:calc(50% - 1px);bottom:2px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* 三个月共用一张周历，保留清晰的GitHub式周列与每日方格。 */
.heat-calendar{display:grid;grid-template-columns:16px repeat(var(--weeks,14),minmax(0,1fr));gap:5px 4px;align-items:center}
.heat-calendar .month-label{font-size:9px;color:var(--muted);padding:0 0 7px;white-space:nowrap;align-self:center}
.heat-calendar .weekday{font-size:8px;padding:0;text-align:left}
.heat-calendar .heat-cell{width:100%;position:relative;transition:transform .12s,box-shadow .12s}
.heat-calendar .heat-cell:not(:disabled):hover{transform:scale(1.15);z-index:1;box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--muted)}
.heat-calendar .heat-blank{width:100%}
@media(max-width:820px){.heat-calendar{display:grid;grid-template-columns:18px repeat(var(--weeks,14),minmax(0,1fr));gap:6px}.heat-calendar .heat-cell{aspect-ratio:1;width:100%}.heat-calendar .month-label{grid-column:auto;grid-row:1;text-align:left}.heat-calendar .weekday{grid-row:auto;font-size:9px}}
@media(max-width:420px){.heat-calendar{gap:4px;grid-template-columns:14px repeat(var(--weeks,14),minmax(0,1fr))}.heat-calendar .weekday{font-size:7px}.heat-calendar .month-label{font-size:8px}}
.tomato-flat{display:inline-block;width:16px;height:16px;vertical-align:-3px;flex-shrink:0}
.task-count .tomato-flat{width:16px;height:16px;filter:none}
.heat-tooltip .tomato-flat{width:13px;height:13px;vertical-align:-2px}
.task-meta{flex-wrap:wrap;row-gap:3px;column-gap:10px}
.timer-actions{align-items:center}.reset-button,.finish-button{position:static;inset:auto;width:36px;height:36px}
.reset-button,.finish-button{border:1px solid var(--line-strong);color:var(--ink)}.finish-button:hover{border-color:var(--clock-accent);color:var(--clock-accent)}
:root{--heat0:#ececec;--heat1:#dedede;--heat2:#c7c7c7;--heat3:#a9a9a9;--heat4:#7b7b7b;--heat5:#565656;--heat6:#303030}
html[data-theme="dark"]{--heat0:#303030;--heat1:#474747;--heat2:#606060;--heat3:#828282;--heat4:#a1a1a1;--heat5:#c6c6c6;--heat6:#e7e7e7}
.heat-calendar .heat-cell{display:block;appearance:none;-webkit-appearance:none;width:100%;min-width:0;min-height:12px;aspect-ratio:1/1;padding:0;border:0;border-radius:3px;background:var(--cell-fill,var(--heat0));box-sizing:border-box}
.heat-cell.today:after{content:none}.heat-cell.today{outline:1px solid var(--ink);outline-offset:2px}.heat-cell.future{opacity:.65;cursor:pointer}.heat-calendar .heat-cell:hover{transform:scale(1.08);z-index:1}
.heat-preview{display:grid;grid-template-columns:repeat(11,1fr);gap:7px;margin:20px 0}.heat-preview>div{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:10px;color:var(--muted)}.heat-preview .heat-cell{width:100%;display:block;aspect-ratio:1/1}.preview-heading{font-size:12px;font-weight:500;margin-top:24px}
.task-menu{width:145px}.task-menu .edit-date-option,.task-menu .edit-task-option{color:var(--ink)}.date-label{display:block;font-size:11px;color:var(--muted);margin-bottom:8px}#task-date-input,#task-name-input{border:1px solid var(--line-strong);background:var(--surface-2);padding:11px 13px;border-radius:6px;color:var(--ink);width:100%;font-size:14px}
.sound-group{border-top:1px solid var(--line);margin-top:22px;padding-top:15px}.sound-group h3{font-size:12px;margin:0 0 12px}.sound-candidate{display:flex;flex-direction:column;text-align:left;width:100%;gap:7px;border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:12px 14px;margin:8px 0}.sound-candidate strong{font-size:12px;font-weight:500}.sound-candidate span{font-size:10px;color:var(--muted)}.sound-candidate:hover,.sound-candidate.auditioning{background:var(--surface-2);border-color:var(--line-strong)}.sound-candidate.auditioning strong{color:var(--clock-accent)}#sound-dialog>p{font-size:11px;line-height:1.8;color:var(--muted)}

@media(max-width:820px){.heat-calendar .heat-cell{min-height:12px}}
@media(max-width:420px){.timer-actions{gap:8px}.primary-button{min-width:154px;padding:0 24px}.heat-preview{gap:4px}.heat-calendar .heat-cell{border-radius:2px}}
/* 单选框与试听内容共同置于一个列表方框内。 */
.sound-option{display:flex;align-items:center;gap:12px;margin:8px 0;padding:12px 14px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
.sound-option:hover{background:var(--surface-2);border-color:var(--line-strong)}
.sound-option .sound-candidate{flex:1;min-width:0;width:auto;margin:0;padding:0;border:0;border-radius:3px;background:transparent}
.sound-option .sound-candidate:hover,.sound-option .sound-candidate.auditioning{border:0;background:transparent}
.sound-radio{appearance:auto;width:16px;height:16px;flex:0 0 16px;margin:0;accent-color:var(--clock-accent);cursor:pointer}
.sound-radio:disabled{cursor:wait;opacity:.4}
.sound-option.chosen{border-color:var(--control-accent);background:color-mix(in srgb,var(--surface) 91%,var(--clock-accent))}
@media(max-width:420px){.sound-option{gap:10px;padding:11px 12px}}

/* 左右固定等宽轨道，侧边按钮隐藏时主按钮依然保持正中。 */
.timer-actions{display:grid;grid-template-columns:36px auto 36px;justify-content:center;align-items:center;gap:12px}
#discard-button{grid-column:1;grid-row:1;justify-self:center}
#start-button{grid-column:2;grid-row:1;justify-self:center}
#finish-button{grid-column:3;grid-row:1;justify-self:center}
@media(max-width:420px){.timer-actions{gap:8px}}

body{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}

/* 数量与状态切换合为同一入口，窄屏自动换行。 */
.tasks-heading>.task-heading-main{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px}
#task-summary.task-status-filters{display:flex;align-items:center;gap:4px;margin-top:0}
.task-status-filter{border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted);font-size:10px;line-height:1.5;min-height:28px;padding:5px 9px;white-space:nowrap;font-variant-numeric:tabular-nums}
.task-status-filter:hover{background:var(--hover);color:var(--ink)}
.task-status-filter.active{color:var(--ink);background:var(--surface-2);border-color:var(--line-strong)}
.tasks-heading .add-button{flex-shrink:0}
@media(max-width:420px){.tasks-heading>.task-heading-main{gap:7px}.task-status-filter{padding:4px 7px}.task-status-filters{gap:2px}}


/* 使用热力图的浅绿色提示可操作按钮，保持缓慢明暗变化。 */
:root{--action-hint-fill:var(--heat1);--action-hint-border:var(--heat2)}
html[data-theme="dark"]{--action-hint-fill:var(--heat6);--action-hint-border:var(--heat5)}
.timer-actions .action-hint{background:var(--action-hint-fill);border-color:var(--action-hint-border);color:var(--action-hint-ink,#292929);animation:timer-action-hint 1.2s ease-in-out infinite}
@keyframes timer-action-hint{0%,100%{background:var(--action-hint-fill);box-shadow:0 0 0 0 transparent}50%{background:color-mix(in srgb,var(--action-hint-fill) 76%,var(--surface));box-shadow:0 0 0 5px color-mix(in srgb,var(--action-hint-fill) 30%,transparent)}}
@media(prefers-reduced-motion:reduce){.timer-actions .action-hint{animation:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--action-hint-fill) 30%,transparent)}}
/* 原生语言菜单保留可抓取链接，不依赖脚本生成语言入口。 */
.language-switcher,.palette-switcher{position:relative;flex-shrink:0}
.language-switcher summary,.palette-switcher summary{list-style:none;cursor:pointer;user-select:none}
.language-switcher summary::-webkit-details-marker,.palette-switcher summary::-webkit-details-marker{display:none}
.language-switcher summary:focus-visible,.palette-switcher summary:focus-visible{outline:2px solid var(--control-accent);outline-offset:3px}
.language-switcher svg,.palette-switcher svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.language-switcher nav{position:absolute;right:0;top:calc(100% + 8px);z-index:150;width:180px;max-width:calc(100vw - 32px);padding:5px;background:var(--surface);border:1px solid var(--line);border-radius:9px;box-shadow:0 8px 30px #0002}
.language-switcher ul{list-style:none;margin:0;padding:0}
.language-switcher a{display:block;padding:8px 12px;border-radius:5px;font-size:12px;line-height:1.5;color:var(--ink)}
.language-switcher a:hover{background:var(--hover)}
.language-switcher a[aria-current="page"]{background:var(--surface-2);font-weight:600;box-shadow:inset 3px 0 var(--line-strong)}
.tasks-heading>.task-heading-main{min-width:0;flex:1}

@media(max-width:820px){.language-switcher summary{width:32px;height:32px}.local-status{max-width:100px;line-height:1.5}}
@media(max-width:380px){.header-actions .icon-button,.language-switcher summary{width:28px;height:32px}.header-actions{gap:0}}

/* 通知开关可使用键盘操作，并随当前外观调整颜色。 */
.notification-setting{display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:12px;line-height:1.7;cursor:pointer}
.notification-toggle{appearance:none;position:relative;flex-shrink:0;width:40px;height:24px;margin:0;border:1px solid var(--line-strong);border-radius:20px;background:var(--surface-2);cursor:pointer;transition:background .2s}
.notification-toggle::before{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:transform .2s,background .2s}
.notification-toggle:checked{background:var(--clock-accent);border-color:var(--clock-accent)}
.notification-toggle:checked::before{transform:translateX(16px);background:var(--on-clock-accent)}
.notification-toggle:disabled{cursor:not-allowed;opacity:.4}
#notification-state{margin:10px 0 14px}
@media(prefers-reduced-motion:reduce){.notification-toggle,.notification-toggle::before{transition:none}}

/* 移动端输入字号至少16px，避免聚焦时自动放大，同时保留手动缩放。 */
@media(max-width:820px),(pointer:coarse){
  #task-input,#task-name-input,#task-date-input{font-size:16px}
}

.continuation-note{color:var(--muted);line-height:1.7;overflow-wrap:anywhere}
.task-row.completed:has(.continuation-note){opacity:.78}

.task-slot{display:flow-root;position:relative}

.drive-status{display:flex;align-items:center;gap:3px;min-width:0;color:var(--muted);font-size:11px;line-height:1.35}
@media(max-width:420px){
  .drive-status{font-size:10px}
}

/* 各组件共用当前外观的界面颜色。 */
:root {
  background: var(--bg);
  --clock-accent: var(--accent);
  --on-clock-accent: var(--on-accent);
  --control-accent: color-mix(in srgb, var(--clock-accent) 76%, var(--muted));
  --danger: color-mix(in srgb, light-dark(#973d30, #edaa9e) 82%, var(--clock-accent));
  accent-color: var(--clock-accent);
}
/* 根据 FlipClock 实测的日夜钟面色微调，并衍生本页各组件用色。 */
html[data-palette]:not([data-palette="default"]) {
  --bg: var(--palette-bg);
  --surface: var(--palette-face);
  --surface-2: color-mix(in srgb, var(--surface) 93%, var(--palette-digit));
  --ink: color-mix(in srgb, var(--palette-digit) 56%, light-dark(#1f241f, #f2f1ee));
  --muted: color-mix(in srgb, var(--ink) 72%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 16%, var(--surface));
  --line-strong: color-mix(in srgb, var(--ink) 34%, var(--surface));
  --hover: color-mix(in srgb, var(--surface) 87%, var(--palette-digit));
  --digit-top: var(--palette-face);
  --digit-bottom: color-mix(in srgb, var(--palette-face) 94%, var(--palette-digit));
  --digit-ink: var(--palette-digit);
  --accent: var(--palette-digit);
  --on-accent: light-dark(#fff, var(--palette-bg));
  --heat0: color-mix(in srgb, var(--surface) 94%, var(--palette-digit));
  --heat1: color-mix(in srgb, var(--surface) 80%, var(--palette-digit));
  --heat2: color-mix(in srgb, var(--surface) 66%, var(--palette-digit));
  --heat3: color-mix(in srgb, var(--surface) 52%, var(--palette-digit));
  --heat4: color-mix(in srgb, var(--surface) 38%, var(--palette-digit));
  --heat5: color-mix(in srgb, var(--surface) 22%, var(--palette-digit));
  --heat6: var(--palette-digit);
  --action-hint-fill: var(--clock-accent);
  --action-hint-border: var(--clock-accent);
  --action-hint-ink: var(--on-clock-accent);
}
[data-palette-choice="default"] {
  --palette-face: light-dark(#f1f1f1, #272727);
  --palette-swatch: light-dark(#333, #ededed);
}
html[data-theme="light"][data-palette="default"] {--day-selection-fill: var(--surface-2)}
[data-palette="green"], [data-palette-choice="green"] {
  --palette-bg: light-dark(#edf9ed, #131a14);
  --palette-face: light-dark(#dcefdc, #202923);
  --palette-digit: light-dark(#465c47, #c6e8c0);
  --palette-swatch: #a9d6a6;
}
[data-palette="violet"], [data-palette-choice="violet"] {
  --palette-bg: light-dark(#f1f2fd, #17171e);
  --palette-face: light-dark(#e6e8f9, #22232e);
  --palette-digit: light-dark(#343953, #c6c9f2);
  --palette-swatch: #afb4ed;
}
[data-palette="red"], [data-palette-choice="red"] {
  --palette-bg: light-dark(#fdf2f1, #211818);
  --palette-face: light-dark(#fae9e7, #2d2122);
  --palette-digit: light-dark(#9c3936, #f08180);
  --palette-swatch: #f2918a;
}
[data-palette="yellow"], [data-palette-choice="yellow"] {
  --palette-bg: light-dark(#fff9ea, #151617);
  --palette-face: light-dark(#f9eed2, #222225);
  --palette-digit: light-dark(#79590d, #f2ce67);
  --palette-swatch: #edc65b;
}
[data-palette="teal"], [data-palette-choice="teal"] {
  --palette-bg: light-dark(#edf8f5, #111a19);
  --palette-face: light-dark(#dceee9, #192724);
  --palette-digit: light-dark(#195656, #82c6c3);
  --palette-swatch: #7cbdbb;
}
[data-palette="pink"], [data-palette-choice="pink"] {
  --palette-bg: light-dark(#fcf1f5, #201419);
  --palette-face: light-dark(#f6e4ec, #2c1d25);
  --palette-digit: light-dark(#763c57, #e8a8bf);
  --palette-swatch: #df9bb6;
}
[data-palette="sand"], [data-palette-choice="sand"] {
  --palette-bg: light-dark(#faf3e5, #201910);
  --palette-face: light-dark(#f0e5cb, #2e2418);
  --palette-digit: light-dark(#594b2e, #c9bb98);
  --palette-swatch: #c2ad83;
}

/* 全屏主视图 */
body {
  --page-gutter: clamp(16px, 3.5vw, 48px);
  --clock-width: min(79.35vw, 1288px, 123svh);
  --clock-neighbor-gap: clamp(16px, calc(var(--clock-width) * .026), 28px);
  --picker-width: min(100%, 683px, var(--clock-width));
  min-height: 100svh;
}
.site-header {
  width: 100%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 3.3svh, 30px) var(--page-gutter);
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, .85vw, 12px);
  min-width: 0;
  font-size: clamp(15px, 1.36vw, 19px);
  line-height: 1.2;
  font-weight: 600;
}
.brand-symbol {
  position: relative;
  flex: none;
  width: clamp(31px, 3.25vw, 42px);
  aspect-ratio: 1;
  overflow: hidden;
}
.brand-logo {
  position: absolute;
  inset: -17.76% auto auto -18.73%;
  width: 137.36%;
  height: auto;
  max-width: none;
  filter: url("#brand-tint");
}
.brand-filter {position: absolute; pointer-events: none}
.brand-paint {flood-color: var(--day-selection-fill, var(--clock-accent))}
.site-header .icon-button {
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
}
.site-header .icon-button:hover {background: var(--hover); color: var(--ink)}
.drive-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--clock-accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-align: start;
  overflow-wrap: anywhere;
}
.drive-button:not(:disabled):hover {background: var(--hover); border-color: var(--clock-accent)}
.drive-button:disabled {cursor: default; opacity: .72}
.drive-status-text {display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere}
.drive-logo {display: block; flex: none}
#drive-status-message {margin-top: 12px}
#drive-disconnect {margin-top: 12px}
.palette-switcher summary {color: var(--clock-accent)}
.palette-options {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 150;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.palette-options button {
  position: relative;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(to right, var(--palette-face) 50%, var(--palette-swatch) 50%);
}
.palette-options button[aria-pressed="true"] {
  outline: 2px solid var(--clock-accent);
  outline-offset: 2px;
}
.palette-options button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* 页眉下方预留空间，提示从屏幕上缘滑入。 */
.feedback-area {min-height: max(32px, var(--feedback-height, 0px))}
.toast[data-visible] {
  position: fixed;
  inset: var(--toast-top, 8px) 0 auto;
  z-index: 180;
  width: var(--picker-width);
  max-width: calc(100% - 2 * var(--page-gutter));
  margin: 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--clock-accent);
  border-radius: 8px;
  background: var(--clock-accent);
  color: var(--on-clock-accent);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  animation: toast-drop .24s ease-out both;
}
.toast:not([data-visible]) {display: none}
@keyframes toast-drop {
  from {transform: translateY(calc(-100% - var(--toast-top, 8px))); opacity: 0}
  to {transform: translateY(0); opacity: 1}
}

.workspace {
  flex: 1 0 auto;
  width: 100%;
  display: grid;
  align-items: center;
  padding: 10px var(--page-gutter) clamp(20px, 3.6svh, 32px);
}
.main-panel {width: 100%; min-width: 0}
.timer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--clock-width) minmax(0, 1fr);
  align-items: center;
  text-align: center;
}
.clock-layout {
  grid-area: 1 / 2;
  container-type: inline-size;
  --clock-gap: clamp(8px, 1.75cqw, 20px);
  --clock-stage-height: calc((100cqw - var(--clock-gap)) / 2 / 1.185);
  --clock-radius: clamp(10px, 2.5cqw, 28px);
  --clock-face: linear-gradient(var(--digit-top) 50%, var(--digit-bottom) 50%);
  --clock-seam: light-dark(var(--line), var(--bg));
  --clock-hardware: var(--line-strong);
}
.timer-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: var(--clock-stage-height);
  gap: var(--clock-gap);
  perspective: 1000px;
}
.flip-pair {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding-inline: 8%;
}
.flip-pair,
.timer-stage[data-clock-style="pr4"] .flip-digit {
  border: 1px solid var(--line);
  border-radius: var(--clock-radius);
  background: var(--clock-face);
  box-shadow: var(--shadow);
}
.flip-pair::after,
.timer-stage[data-clock-style="pr4"] .flip-digit::after {
  position: absolute;
  inset: 50% 0 auto;
  content: "";
  height: clamp(1px, .27cqw, 3px);
  background: var(--clock-seam);
  z-index: 3;
  pointer-events: none;
}
.flip-digit {
  flex: 0 0 47%;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--digit-ink);
  font: 650 33.5cqw / 1 "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  perspective: 1000px;
}
.digit-text, .flip-leaf span {transform: translateY(-6%) scaleX(.9)}
.flip-leaf {
  position: absolute;
  inset: 0 0 auto;
  height: 50%;
  overflow: hidden;
  background: var(--digit-top);
  transform-origin: center bottom;
  backface-visibility: hidden;
  z-index: 2;
  display: none;
}
.flip-leaf span {
  position: absolute;
  inset: 0;
  height: 200%;
  display: grid;
  place-items: center;
}
/* PR #4 沿用同一钟面尺寸和主题，增加独立卡片、冒号与铰链。 */
.clock-colon {display: none}
.timer-stage[data-clock-style="pr4"] {
  grid-template-columns: minmax(0, 1fr) var(--clock-gap) minmax(0, 1fr);
  column-gap: 0;
}
.timer-stage[data-clock-style="pr4"] .flip-pair {
  gap: var(--clock-gap);
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.timer-stage[data-clock-style="pr4"] .flip-pair::after {content: none}
.timer-stage[data-clock-style="pr4"] .flip-digit {
  flex: 1;
  min-width: 0;
  isolation: isolate;
}
.timer-stage[data-clock-style="pr4"] .flip-digit::before {
  content: "";
  position: absolute;
  inset-inline: -1px;
  top: 50%;
  height: clamp(5px, 1.2cqw, 12px);
  transform: translateY(-50%);
  border-inline: clamp(2px, .28cqw, 3px) solid var(--clock-hardware);
  z-index: 4;
  pointer-events: none;
}
.timer-stage[data-clock-style="pr4"] .flip-leaf {
  border-radius: var(--clock-radius) var(--clock-radius) 0 0;
}
.timer-stage[data-clock-style="pr4"] .clock-colon {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(14px, 3.5cqw, 36px);
}
.clock-colon i {
  width: clamp(3px, .75cqw, 8px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--clock-hardware);
}

.activity-entry {
  grid-area: 1 / 1;
  justify-self: start;
  margin-inline-start: calc(clamp(12px, 2vw, 32px) - var(--page-gutter));
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(80px, 8vw);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--clock-accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.activity-entry-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--clock-accent);
  background: var(--clock-accent);
  color: var(--on-clock-accent);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.activity-entry svg {width: 24px; height: 24px; stroke-width: 3.5}
.activity-entry[aria-expanded="true"] svg {transform: rotate(180deg)}
.activity-entry:hover .activity-entry-icon {opacity: .82}
.palette-tip {
  grid-area: 1 / 3;
  justify-self: end;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 6px;
  max-width: min(112px, calc(100% + var(--page-gutter) - 16px));
  min-height: 44px;
  margin-inline-end: calc(10px - var(--page-gutter));
  border: 0;
  border-radius: 8px;
  padding: 4px;
  background: transparent;
  color: var(--clock-accent);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.palette-tip svg {width: 21px; height: 21px}
.palette-tip:hover {background: var(--hover)}
.timer-actions {
  grid-area: 2 / 1 / auto / -1;
  --side-action: clamp(36px, 5svh, 42px);
  grid-template-columns: var(--side-action) auto var(--side-action);
  margin-top: var(--clock-neighbor-gap);
}
.timer-actions .reset-button, .timer-actions .finish-button {
  width: var(--side-action);
  height: var(--side-action);
}
.timer-panel .primary-button {
  min-width: clamp(172px, 17vw, 198px);
  height: clamp(48px, 6.1svh, 55px);
  padding-inline: clamp(18px, 2.5vw, 38px);
  font-size: 13px;
  background: var(--clock-accent);
  color: var(--on-clock-accent);
}
.timer-panel .completion-banner {grid-column: 1 / -1}
.site-footer {
  display: grid;
  justify-items: center;
  gap: 6px;
  flex: none;
  padding: 12px var(--page-gutter) clamp(14px, 2.7svh, 26px);
  color: var(--muted);
  font-size: 10px;
}
.fullscreen-button {
  position: fixed;
  z-index: 90;
  inset-inline-end: max(var(--page-gutter), env(safe-area-inset-right));
  inset-block-end: max(14px, env(safe-area-inset-bottom));
  width: clamp(38px, 4vw, 44px);
  height: clamp(38px, 4vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--clock-accent);
}
.fullscreen-button svg {width: 20px; height: 20px}
.fullscreen-button:hover, .fullscreen-button[aria-pressed="true"] {
  background: var(--clock-accent);
  border-color: var(--clock-accent);
  color: var(--on-clock-accent);
}
.fullscreen-button[aria-pressed="false"] .exit-fullscreen,
.fullscreen-button[aria-pressed="true"] .enter-fullscreen {display: none}
#local-clock {font-size: 18px; font-variant-numeric: tabular-nums}
label.sound-candidate {cursor: pointer}

.duration-fields {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px}
.duration-fields label {display: flex; flex-direction: column; justify-content: space-between; gap: 6px; font-size: 12px}
.duration-fields input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.duration-actions {display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px}
#timer-duration-status {color: var(--muted); font-size: 11px}

/* 备注编辑和列表备注都沿用当前主题色。 */
.form-actions {justify-content: flex-end; flex-wrap: wrap; gap: 8px 14px}
.add-form-hint {
  flex: 1 1 190px;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.note-action {
  flex-shrink: 0;
  color: var(--clock-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.task-note-input {
  display: block;
  width: 100%;
  max-width: 100%;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.task-note-input:focus-visible,
.task-note:focus-visible {outline: 2px solid var(--control-accent); outline-offset: 2px}
.add-form .task-note-input {margin-bottom: 10px}
#edit-note-field, #edit-note-button {margin-top: 14px}
.task-note {
  margin-top: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.current-task .task-note {
  max-height: min(18svh, 6rem);
  overflow: auto;
}
@media (max-width: 820px), (pointer: coarse) {
  .task-note-input {font-size: 16px}
}

/* 固定在滚动区上方的当前任务与列表。 */
.task-picker {
  position: relative;
  width: var(--picker-width);
  margin: 0 auto var(--clock-neighbor-gap);
}
.tasks-open .task-picker {z-index: 111}
.task-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  backdrop-filter: blur(9px);
  touch-action: none;
}
.current-task.task-row {
  --current-task-title-size: clamp(14px, 1.25vw, 17px);
  margin: 0;
  min-height: clamp(74px, 9.2svh, 83px);
  border-radius: 18px;
  padding: 13px clamp(10px, 1.7vw, 23px);
  cursor: pointer;
}
.current-task.is-focusing {
  background: color-mix(in srgb, var(--surface) 80%, var(--clock-accent));
  border-color: color-mix(in srgb, var(--line) 45%, var(--clock-accent));
}
html[data-theme="light"][data-palette="default"] :is(.current-task[data-task-id]:not([data-task-id=""]), .task-row[aria-pressed="true"]) {
  background: var(--day-selection-fill);
}
.current-task-heading {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
#current-task-prefix {
  flex: none;
  color: var(--muted);
  font-size: var(--current-task-title-size);
  white-space: nowrap;
}
.current-task .task-title {
  font-size: var(--current-task-title-size);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.current-task .task-meta {column-gap: 6px; font-size: clamp(10px, .82vw, 11px); line-height: 1.35}
#phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--clock-accent);
  font-weight: 600;
}
#phase-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.current-task .task-toggle {border-color: var(--control-accent)}
#current-task-toggle:empty, #current-task-count:empty {display: none}
.task-picker-button {width: 36px; height: 36px}
.task-picker-button svg {width: 18px; height: 18px; transition: transform .2s ease}
.task-picker-button[aria-expanded="true"] svg {transform: rotate(180deg)}
.tasks-panel {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.tasks-panel > :not(.task-list) {flex: none}
.task-list {
  --fold-gutter: 18px;
  position: relative;
  isolation: isolate;
  margin-top: 8px;
  height: calc(5 * 80px + var(--fold-gutter));
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding-bottom: var(--fold-gutter);
  scroll-padding-bottom: var(--fold-gutter);
}
.task-list:empty {display: none}
.task-list .task-row {z-index: var(--fold-order, 3)}
.task-list .task-row[data-folded] {pointer-events: none}
.task-list .task-row:has(.task-menu) {z-index: 4}
.task-list .task-row:focus-visible {outline-offset: -3px}
.task-menu.opens-up {top: auto; bottom: 30px}
.current-task .task-more {z-index: 1}
.task-slot {min-height: 80px}
/* 两块内容共用翻页钟的外框尺寸，任务栏与左侧足迹等宽。 */
.history-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: var(--clock-gap);
  height: var(--clock-stage-height);
  text-align: start;
}
.history-layout > section {
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 1.9cqw, 22px);
  border-radius: var(--clock-radius);
}
.history-layout .activity-card {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.history-layout .activity-card > :not(.heat-scroll) {flex: none}
.history-layout .heat-scroll {
  display: grid;
  align-items: center;
  flex: 1 1 0;
  min-height: 132px;
  container-type: size;
}
.history-layout .heat-calendar {
  --heat-square: max(12px, calc((100cqh - 55px) / 7));
  width: min(100%, calc(16px + var(--weeks, 14) * (var(--heat-square) + 4px)));
  margin-inline: auto;
}
.history-layout .section-title {gap: 8px}
.history-layout .section-title h2 {font-size: 16px; margin: 0}
.history-layout .heat-nav {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  margin: 12px -5px 8px;
  text-align: center;
}
.heat-nav-actions {display: flex; justify-content: flex-end}
.filter-date {display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 10px 0 2px; font-size: 11px}
#pending-on-date strong {color: var(--control-accent); font-weight: 700}
.filter-date button:hover {text-decoration: underline}
.history-layout .heat-legend {margin-top: 12px}
.history-layout .heat-tip {margin: 8px 0 12px}
.history-layout .activity-stats {padding: 12px 0 0}
.history-layout .tasks-panel {
  position: static;
  background: var(--surface);
  overflow: auto;
}
.history-layout .task-list {flex: 1 1 auto; height: 0}
.history-layout .task-row[aria-pressed="true"] {border-color: var(--control-accent)}

@media (min-width: 701px) and (max-width: 880px) {
  .palette-tip {
    grid-area: 2 / 2;
    display: flex;
    z-index: 1;
    max-width: min(155px, calc(50% - 155px));
    margin: var(--clock-neighbor-gap) 0 0;
    text-align: start;
  }
  .palette-tip svg {flex: none; width: 18px; height: 18px}
}
@media (max-width: 700px) {
  body {--clock-width: min(100%, 105svh)}
  .workspace {padding-bottom: 30px}
  .timer-panel {grid-template-columns: minmax(0, 1fr)}
  .clock-layout {
    grid-area: 1 / 1;
    justify-self: center;
    width: var(--clock-width);
  }
  .activity-entry {
    grid-area: 3 / 1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    max-width: 100%;
  }
  .activity-entry-icon {width: 38px; height: 38px; flex: none}
  .activity-entry svg {width: 21px; height: 21px}
  .timer-panel:has(.palette-tip:not([hidden])) .activity-entry {max-width: 48%; text-align: start}
  .palette-tip {
    grid-area: 3 / 1;
    display: flex;
    gap: 6px;
    max-width: 49%;
    margin: 8px 0 0;
    text-align: start;
  }
  .palette-tip svg {flex: none; width: 18px; height: 18px}
  .timer-panel:has(.activity-entry[aria-expanded="true"]) .clock-layout {grid-row: 2}
  .activity-entry[aria-expanded="true"] {
    grid-area: 1 / 1;
    margin: 0 0 8px;
  }
  .history-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, max(350px, var(--clock-stage-height)));
    height: auto;
  }
  .timer-panel .primary-button {min-width: 0; padding-inline: 16px; letter-spacing: 0}
}
@media (max-width: 480px) {
  .site-header {flex-wrap: wrap; gap: 8px}
  .site-header .header-actions {width: 100%; justify-content: flex-end; gap: 4px}
  .site-footer {padding-inline: 60px; text-align: center; overflow-wrap: anywhere}
}
@media (max-width: 420px) {
  .drive-button {padding-inline: 7px}
  .current-task.task-row {gap: 6px; --current-task-title-size: 13px}
  .tasks-panel {padding: 8px}
  .tasks-heading {gap: 6px}
  .tasks-heading .add-button {padding-inline: 8px}
}
@media (prefers-reduced-motion: reduce) {
  .flip-digit.flipping .flip-leaf {display: none}
  .task-list {--fold-gutter: 0px}
}

/* 双向翻转仅作用于中部视图。 */
:root[data-scene-motion] {
  --scene-side: 1;
  --scene-edge: left center;
  --scene-duration: 540ms;
  --scene-easing: cubic-bezier(.22, .72, .24, 1);
}
:root[data-scene-direction="history"] {
  --scene-side: -1;
  --scene-edge: right center;
}
:root[data-scene-motion="native"] .clock-layout {view-transition-name: pomodoro-stage}
::view-transition {pointer-events: none}
:root[data-scene-motion="native"]::view-transition-group(root) {animation: none}
:root[data-scene-motion="native"]::view-transition-old(root) {display: none}
:root[data-scene-motion="native"]::view-transition-new(root) {animation: none; mix-blend-mode: normal}
::view-transition-group(pomodoro-stage) {
  animation-duration: var(--scene-duration);
  animation-timing-function: var(--scene-easing);
}
::view-transition-image-pair(pomodoro-stage) {overflow: clip; isolation: isolate}
::view-transition-old(pomodoro-stage),
::view-transition-new(pomodoro-stage) {
  block-size: 100%;
  object-fit: contain;
  object-position: center top;
  mix-blend-mode: normal;
  transform-origin: var(--scene-edge);
}
::view-transition-old(pomodoro-stage) {
  animation: scene-flip-out var(--scene-duration) var(--scene-easing) both;
}
::view-transition-new(pomodoro-stage) {
  animation: scene-flip-in var(--scene-duration) var(--scene-easing) both;
}
:root:is([data-scene-motion="leaving"], [data-scene-motion="entering"]) .clock-layout {overflow: clip}
:root[data-scene-motion="leaving"] .clock-layout > :not([hidden]) {
  transform-origin: var(--scene-edge);
  animation: scene-flip-out calc(var(--scene-duration) * .6) var(--scene-easing) both;
}
:root[data-scene-motion="entering"] .clock-layout > :not([hidden]) {
  transform-origin: var(--scene-edge);
  animation: scene-flip-in calc(var(--scene-duration) * .75) var(--scene-easing) both;
}
@keyframes scene-flip-in {
  from {opacity: 0; transform: perspective(1000px) translateX(calc(20% * var(--scene-side))) rotateY(calc(-62deg * var(--scene-side)))}
  to {opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0)}
}
@keyframes scene-flip-out {
  from {opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0)}
  to {opacity: 0; transform: perspective(1000px) translateX(calc(-20% * var(--scene-side))) rotateY(calc(62deg * var(--scene-side)))}
}
