/* DS-Digital 原字体已缓存到本地，避免现场显示依赖外部字体服务。 */
@font-face {
    font-family: "DS-Digital";
    font-style: normal;
    font-weight: 400;
    src: local("DS-Digital"), url("assets/fonts/DS-DIGI.woff") format("woff");
}

@font-face {
    font-family: "DS-Digital";
    font-style: italic;
    font-weight: 400;
    src: local("DS-Digital"), url("assets/fonts/DS-DIGII.woff") format("woff");
}

@font-face {
    font-family: "DS-Digital";
    font-style: normal;
    font-weight: 700;
    src: local("DS-Digital"), url("assets/fonts/DS-DIGIB.woff") format("woff");
}

@font-face {
    font-family: "DS-Digital";
    font-style: italic;
    font-weight: 700;
    src: local("DS-Digital"), url("assets/fonts/DS-DIGIT.woff") format("woff");
}

:root {
    --display-font: "DS-Digital", "DSEG7 Classic", "Consolas", "Courier New", monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 基本样式 */
html {
    width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    margin: 0;
    padding: 0; /* 移除body的padding */
    background-color: #000000;
    color: white;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    height: 100vh;
    height: 100svh;
    min-height: 100svh;
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
    overscroll-behavior: none;
}

.container {
    width: calc(100% - 10vmin); /* 两侧各留5vmin间隙 */
    height: calc(100svh - 10vmin); /* 上下各留5vmin间隙 */
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: calc(1vmin); /* 使用vmin保持行间距比例一致 */
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-width: 0;
}

/* 计时器显示区域 */
.timer-display {
    max-width: 100%;
    min-width: 0;
    width: 100%; /* 占满容器宽度 */
    display: flex;
    flex-direction: column;
    gap: calc(2vmin); /* 增加上下间距，原来是1vmin */
    align-items: center;
    container-type: inline-size;
}

/* 计时器行 */
.timer-row {
    max-width: 100%;
    min-width: 0;
    display: flex;
    width: 100%;
    height: calc(0.14 * 94vw); /* 收紧高度，原来是0.16 * 94vw */
    border-radius: calc(0.5vw);
    border-width: calc(0.3vw);
    border-style: solid;
    overflow: hidden;
}

/* 合并标签和时间值的容器 */
.timer-combined {
    max-width: 100%;
    min-width: 0;
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0 calc(0.01 * 94vw); /* 减小左右内边距至1% */
    height: 100%;
}

/* 标签文本样式 */
.label-text {
    margin-right: calc(0.005 * 94vw);
    font-size: calc(0.055 * 94vw); /* 略微减小标签字体大小 */
    letter-spacing: calc(0.003 * 94vw);
    font-weight: bold;
    white-space: nowrap;
}

/* 时间值样式 */
.time-value {
    max-width: 100%;
    min-width: 0;
    flex-grow: 1;
    font-family: var(--display-font);
    font-size: calc(0.16 * 94vw); /* 调整字体大小，与线框高度匹配 */
    letter-spacing: 0; /* 移除字符间距以确保等宽效果 */
    font-weight: normal;
    text-align: right; /* 数字右对齐 */
    font-variant-numeric: tabular-nums; /* 使用等宽数字 */
}

/* 修改时间值样式，确保数字等宽 */
.time-value span {
    display: inline-block;
    width: calc(0.08 * 94vw); /* 调整数字宽度与字体大小匹配 */
    text-align: center;
}

/* 修改时间格式，将时间拆分为单独的数字以确保等宽 */
.timer-colon {
    width: calc(0.035 * 94vw) !important; /* 调整冒号宽度 */
    text-align: center;
}

/* ON AIR 按钮盒子 */
.on-air-box {
    max-width: 100%;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: calc(1vmin);
}

/* ON AIR 按钮 */
.on-air-btn {
    appearance: none;
    box-sizing: border-box;
    padding: 0;
    width: clamp(9rem, 18%, 14rem);
    height: 3rem;
    border-radius: 0.35rem;
    border-width: 2px;
    border-style: solid;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: "Arial Black", Gadget, sans-serif;
    font-size: clamp(0.82rem, 1.5vw, 1.2rem);
    font-weight: bold;
    letter-spacing: 0.12em;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.on-air-status,
.on-air-action {
    line-height: 1;
    white-space: nowrap;
}

.on-air-action {
    padding-left: 0.55rem;
    border-left: 1px solid currentColor;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0;
}

.on-air-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.on-air-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

/* 颜色方案 */
.current-time {
    background-color: rgba(0, 255, 0, 0.15);
    border-color: #00FF00;
}

.current-time .label-text,
.current-time .time-value,
.current-time span {
    color: #00FF00;
}

.on-air-time {
    background-color: rgba(255, 0, 0, 0.15);
    border-color: #FF0000;
}

.on-air-time .label-text,
.on-air-time .time-value,
.on-air-time span {
    color: #FF0000;
}

/* 设置面板样式 */
.settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1110;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.settings-backdrop[hidden] {
    display: none;
}

.settings-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(calc(100% - 2rem), 680px);
    max-width: 100%;
    max-height: min(86svh, 760px);
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    background: linear-gradient(180deg, rgba(24, 27, 29, 0.98), rgba(13, 15, 17, 0.98));
    padding: 0;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    z-index: 1120;
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
}

.settings-kicker {
    margin-bottom: 0.25rem;
    color: rgba(0, 255, 0, 0.82);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.settings-title {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.1;
    color: #fff;
}

.settings-close {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.settings-close:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.settings-close:focus-visible,
.time-picker-close:focus-visible,
.help-close:focus-visible,
.btn:focus-visible,
.picker-chip:focus-visible,
.quick-action-btn:focus-visible,
.time-step-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.settings-section {
    margin: 0;
    padding: 1rem 1.25rem;
}

.settings-time-section {
    display: grid;
    gap: 0.75rem;
}

.settings-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.28fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
}

.settings-label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
}

.settings-label-main {
    font-size: 1rem;
}

.settings-label-sub {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.time-card {
    padding: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid rgba(0, 255, 0, 0.72);
    border-radius: 0.5rem;
    background: rgba(5, 8, 10, 0.56);
}

.time-card + .time-card {
    border-left-color: rgba(255, 58, 48, 0.78);
}

.touch-time-button {
    width: 100%;
    min-width: 0;
    min-height: 3.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.42rem;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    text-align: left;
    touch-action: manipulation;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.16s ease;
}

.touch-time-button:hover,
.touch-time-button:focus-visible {
    outline: none;
    border-color: rgba(0, 255, 0, 0.58);
    background: rgba(0, 0, 0, 0.58);
}

.touch-time-button:active {
    transform: translateY(1px);
}

.touch-time-main {
    min-width: 0;
    color: #fff;
    font-family: var(--display-font);
    font-size: 1.75rem;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.touch-time-date {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.native-time-fields {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.native-time-fields[hidden] {
    display: none !important;
}

.settings-input {
    flex: 1;
    box-sizing: border-box;
    min-height: 2.75rem;
    background-color: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.42rem;
    color: white;
    padding: 0.7rem 0.75rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.settings-input:focus {
    outline: none;
    border-color: rgba(0, 255, 0, 0.64);
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.14);
    background-color: rgba(0, 0, 0, 0.62);
}

.time-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.datetime-input {
    width: 100%;
    min-width: 0;
}

.second-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0.25rem 0.35rem 0.25rem 0.65rem;
    border-radius: 0.42rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    white-space: nowrap;
}

.second-input {
    flex: 0 0 auto;
    width: 3.6rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.45rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: var(--display-font);
    font-size: 1.2rem;
}

.second-input::-webkit-outer-spin-button,
.second-input::-webkit-inner-spin-button {
    margin: 0;
}

.control-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.025);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.45rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background-color 0.16s ease;
    background: rgba(60, 60, 60, 0.8);
    color: white;
    min-width: 0;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-start {
    background: linear-gradient(180deg, #22c55e, #16883f);
}

.btn-end {
    background: linear-gradient(180deg, #ef4444, #aa2424);
}

.btn-reset {
    background: linear-gradient(180deg, #3b82f6, #1d4f9c);
}

.btn-cancel {
    background: rgba(60, 60, 60, 0.8);
}

.broadcast-summary {
    margin: 1rem 1.25rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 255, 0, 0.35);
    background: rgba(0, 255, 0, 0.07);
}

.broadcast-summary-title {
    margin-bottom: 0.75rem;
    color: #00FF00;
    font-weight: 600;
    text-align: center;
}

.broadcast-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.8;
}

.broadcast-summary-row strong {
    color: #fff;
    font-family: var(--display-font);
    font-weight: 400;
    letter-spacing: 0;
}

.settings-actions {
    display: grid;
    grid-template-columns: minmax(7rem, 0.3fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
    margin-top: 0;
}

#saveSettingsBtn {
    background: linear-gradient(180deg, #00d66b, #008f48);
    color: #06130a;
    font-weight: 700;
}

body.time-picker-open {
    overflow: hidden;
}

html.modal-open,
body.modal-open {
    overflow: hidden !important;
    max-width: 100%;
    overscroll-behavior: none;
}

body.modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

.time-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
}

.time-picker-backdrop[hidden] {
    display: none;
}

.time-picker-sheet {
    width: min(100%, 540px);
    max-width: 100%;
    max-height: min(92svh, 760px);
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 0;
    border-radius: 0.75rem 0.75rem 0 0;
    background: linear-gradient(180deg, rgba(25, 28, 31, 0.99), rgba(12, 14, 16, 0.99));
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
    color: #fff;
    -webkit-overflow-scrolling: touch;
}

.time-picker-sheet::before {
    content: "";
    display: block;
    width: 3rem;
    height: 0.25rem;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
}

.time-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.time-picker-kicker {
    color: rgba(0, 255, 0, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.time-picker-title {
    margin-top: 0.15rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.time-picker-close {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
}

.time-picker-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.8rem 1rem 0.35rem;
}

.time-picker-preview span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.86rem;
    font-weight: 700;
}

.time-picker-preview strong {
    justify-self: end;
    color: #00ff00;
    font-family: var(--display-font);
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.time-picker-date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.45rem 1rem 0.75rem;
}

.time-picker-date-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.picker-chip,
.time-picker-date-custom {
    min-height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.42rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    font-weight: 600;
}

.picker-chip {
    cursor: pointer;
}

.picker-chip.is-active {
    border-color: rgba(0, 255, 0, 0.55);
    background: rgba(0, 255, 0, 0.13);
    color: #fff;
}

.time-picker-date-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.45rem;
    white-space: nowrap;
}

.time-picker-date-custom span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.75rem;
}

.time-picker-date-custom input {
    width: 7.4rem;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 0.85rem;
}

.time-picker-time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.2rem 1rem 0.75rem;
}

.time-picker-unit {
    display: grid;
    grid-template-rows: 3rem 3.2rem 3rem auto;
    gap: 0.35rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.35);
}

.time-step-btn {
    width: 100%;
    height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.65rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.time-step-btn:active,
.picker-chip:active,
.quick-action-btn:active {
    transform: translateY(1px);
}

.time-picker-value {
    color: #fff;
    font-family: var(--display-font);
    font-size: 2.25rem;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.time-picker-unit-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.time-picker-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0 1rem 0.8rem;
}

.quick-action-btn {
    min-height: 2.45rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    touch-action: manipulation;
}

.time-picker-footer {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(6rem, 0.45fr) minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(18, 20, 22, 0.94), rgba(12, 14, 16, 0.99));
}

#timePickerConfirmBtn {
    background: linear-gradient(180deg, #00d66b, #008f48);
    color: #06130a;
    font-weight: 800;
}

/* 主计时屏响应式布局：只保留一套纵屏和矮横屏规则。 */
@media (orientation: portrait) {
    .container {
        width: calc(100% - 4vmin);
        height: auto;
        max-height: calc(100svh - 2vmin);
        padding: 1vmin 0;
    }

    .timer-display {
        gap: 0.6rem;
    }

    .timer-row {
        height: auto;
        min-height: 5.25rem;
        min-height: clamp(5.25rem, 22cqw, 11.5rem);
        border-width: 2px;
        border-radius: 0.35rem;
    }

    .timer-combined {
        flex-direction: column;
        justify-content: center;
        padding: 0.35rem;
    }

    .label-text {
        margin: 0 0 0.1rem;
        font-size: clamp(0.85rem, 4.5cqw, 1.8rem);
        letter-spacing: 0;
    }

    .time-value {
        flex-grow: 0;
        width: 100%;
        font-size: 3.25rem;
        font-size: clamp(3.25rem, 20cqw, 8rem);
        line-height: 0.86;
        text-align: center;
    }

    .time-value span {
        width: 0.52em;
    }

    .timer-colon {
        width: 0.28em !important;
    }

    .on-air-box {
        margin-top: 0.35rem;
        align-items: center;
    }

    .on-air-btn {
        width: min(32%, 12rem);
        min-width: 7.5rem;
        min-height: 2.75rem;
        height: auto;
        padding: 0.45rem 0.7rem;
        border-width: 2px;
        border-radius: 0.35rem;
        font-size: clamp(0.72rem, 2.6cqw, 1rem);
        letter-spacing: 0.08em;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 2vmin);
    }

    .timer-display {
        gap: 0.3rem;
    }

    .timer-row {
        min-height: clamp(4.9rem, 26cqw, 6.3rem);
    }

    .time-value {
        font-size: clamp(3rem, 19cqw, 4.2rem);
    }

    .on-air-btn {
        width: calc(50% - 0.35rem);
        min-width: 0;
        min-height: 44px;
        height: 44px;
        padding: 0.4rem 0.55rem;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        gap: 0.4rem;
    }

    .on-air-action {
        padding-left: 0.4rem;
        font-size: 0.78em;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .container {
        width: calc(100% - 2rem);
        height: calc(100svh - 1rem);
        max-height: 100svh;
    }

    .timer-display {
        gap: 0.35rem;
    }

    .timer-row {
        height: clamp(3.8rem, 22svh, 7rem);
        border-width: 2px;
        border-radius: 0.35rem;
    }

    .timer-combined {
        flex-direction: row;
        padding: 0 0.6rem;
    }

    .label-text {
        margin-right: 0.4rem;
        font-size: clamp(1.2rem, 6svh, 3rem);
        letter-spacing: 0;
    }

    .time-value {
        font-size: clamp(3.2rem, 18svh, 7rem);
        line-height: 1;
    }

    .time-value span {
        width: 0.52em;
    }

    .timer-colon {
        width: 0.28em !important;
    }

    .on-air-box {
        margin-top: 0.25rem;
    }

    .on-air-btn {
        width: min(24%, 10rem);
        min-width: 7.5rem;
        min-height: 44px;
        height: 44px;
        padding: 0.35rem 0.65rem;
        border-width: 2px;
        font-size: 0.82rem;
        letter-spacing: 0.08em;
    }
}

/* 闪烁提醒样式 */
.flash-alert {
    position: fixed;
    background-color: rgba(255, 0, 0, 1); /* 修改为完全不透明的红色 */
    z-index: 9999;
    pointer-events: none; /* 允许点击穿透 */
    opacity: 0;
    display: none;
    transition: opacity 0.15s ease; /* 添加过渡效果使闪烁更平滑 */
}

.notice-toast {
    position: fixed;
    left: 50%;
    bottom: 3vmin;
    transform: translate(-50%, 120%);
    z-index: 10000;
    max-width: min(calc(100% - 2rem), 560px);
    padding: 0.85rem 1.1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(28, 28, 28, 0.94);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notice-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.notice-toast.is-error {
    border-color: rgba(255, 70, 70, 0.75);
    background: rgba(80, 0, 0, 0.94);
}

/* 线框闪烁区域 - 这些区域会通过JS动态设置位置 */
.flash-time1, .flash-time2 {
    position: fixed;
}

/* 上部闪烁区域 */
.flash-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 5vmin; /* 与container上边距相同 */
}

/* 下部闪烁区域 */
.flash-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5vmin; /* 与container下边距相同 */
}

/* 左侧闪烁区域 */
.flash-left {
    top: 5vmin;
    left: 0;
    width: 5vmin; /* 与container左边距相同 */
    height: calc(100svh - 10vmin); /* 减去上下边距 */
}

/* 右侧闪烁区域 */
.flash-right {
    top: 5vmin;
    right: 0;
    width: 5vmin; /* 与container右边距相同 */
    height: calc(100svh - 10vmin); /* 减去上下边距 */
}

/* 不同屏幕大小下的闪烁区域调整 */
@media (max-width: 855px) {
    .flash-top, .flash-bottom {
        height: 2vmin;
    }
    
    .flash-left, .flash-right {
        top: 2vmin;
        width: 2vmin;
        height: calc(100svh - 4vmin);
    }
}

@media (max-width: 480px) {
    .flash-top, .flash-bottom {
        height: 1vmin;
    }
    
    .flash-left, .flash-right {
        top: 1vmin;
        width: 1vmin;
        height: calc(100svh - 2vmin);
    }
}

/* 设置区域的时间显示样式 */
.time-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: transparent;
    border-radius: 8px;
}

/* 帮助相关样式 */
.btn-help {
    background-color: #007AFF !important;
    color: white !important;
}

.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    justify-content: center;
    align-items: center;
}

.help-content {
    position: relative;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: calc(90svh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.help-content h2 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
    font-weight: 600;
}

.help-section {
    margin-bottom: 30px;
}

.help-section h3 {
    color: #007AFF;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.help-item {
    margin-bottom: 15px;
    padding-left: 15px;
}

.help-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.help-item-desc {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    padding-left: 8px;
}

#closeHelpBtn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 30px;
    background-color: #007AFF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#closeHelpBtn:hover {
    background-color: #0056b3;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .help-content {
        background-color: #1c1c1e;
        color: #fff;
    }

    .help-content h2 {
        color: #fff;
    }

    .help-section h3 {
        color: #0A84FF;
        border-bottom-color: #333;
    }

    .help-item-title {
        color: #fff;
    }

    .help-item-desc {
        color: #999;
    }

    .settings-panel {
        background-color: rgba(28, 28, 30, 0.95);
    }

    .settings-title {
        color: #fff;
    }

    .settings-label {
        color: #fff;
    }

    .settings-input {
        background-color: rgba(44, 44, 46, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .settings-input:focus {
        background-color: rgba(44, 44, 46, 1);
        border-color: #0A84FF;
        box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
    }

    .btn-cancel {
        background-color: rgba(142, 142, 147, 0.2);
        color: #fff;
    }
}

.help-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    background: inherit;
}

.help-header h2 {
    flex: 1;
    margin: 0;
}

.help-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 0.45rem;
    background: rgba(128, 128, 128, 0.12);
    color: inherit;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.help-contact {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eeeeee;
    color: #666666;
    font-size: 14px;
    text-align: center;
}

.help-contact a {
    color: #007aff;
    text-decoration: none;
}

.help-contact a:hover {
    text-decoration: underline;
}

#closeHelpBtn {
    min-height: 44px;
}

body.time-picker-open .settings-panel {
    visibility: hidden;
}

/* 手机设置和触摸时间选择器 */
@media (max-width: 480px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        overscroll-behavior-x: none;
        touch-action: pan-y;
    }

    .settings-backdrop,
    .settings-panel,
    .time-picker-backdrop,
    .time-picker-sheet,
    .help-modal,
    .help-content {
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    .settings-panel,
    .time-picker-sheet,
    .help-content {
        touch-action: pan-y;
    }

    .settings-panel {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: min(82svh, calc(100svh - 0.75rem));
        margin: 0;
        padding: 0;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0.65rem 0.65rem 0 0;
        transform: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .settings-panel::before {
        content: "";
        display: block;
        width: 2.75rem;
        height: 0.25rem;
        margin: 0.45rem auto 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.26);
    }

    .settings-header {
        padding: 0.45rem 0.9rem 0.65rem;
    }

    .settings-kicker {
        display: none;
    }

    .settings-title {
        font-size: 1.15rem;
    }

    .settings-close,
    .time-picker-close {
        width: 44px;
        height: 44px;
    }

    .settings-time-section {
        gap: 0.5rem;
        padding: 0.65rem 0.75rem 0.55rem;
    }

    .settings-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.45rem;
    }

    .settings-label {
        width: auto;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }

    .time-card {
        padding: 0.65rem;
        border-radius: 0.45rem;
    }

    .touch-time-button {
        min-height: 3.05rem;
        padding: 0.45rem 0.6rem;
        gap: 0.55rem;
    }

    .touch-time-main {
        font-size: 1.55rem;
    }

    .touch-time-date {
        font-size: 0.76rem;
    }

    .settings-label-main {
        font-size: 0.95rem;
    }

    .settings-label-sub {
        font-size: 0.65rem;
    }

    .control-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.65rem 0.75rem;
    }

    .btn {
        min-height: 44px;
        padding: 0.6rem 0.45rem;
        font-size: 0.9rem;
        white-space: normal;
        touch-action: manipulation;
    }

    .broadcast-summary {
        margin: 0.6rem 0.75rem 0;
        padding: 0.65rem;
    }

    .settings-actions {
        position: sticky;
        bottom: 0;
        grid-template-columns: 5.8rem minmax(0, 1fr);
        gap: 0.55rem;
        margin: 0;
        padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255, 255, 255, 0.09);
        background: linear-gradient(180deg, rgba(18, 20, 22, 0.94), rgba(12, 14, 16, 0.99));
    }

    .time-picker-backdrop {
        align-items: flex-end;
    }

    .time-picker-sheet {
        width: 100%;
        max-height: calc(100svh - 0.5rem);
        margin: 0;
    }

    .time-picker-header {
        padding: 0.62rem 0.85rem 0.7rem;
    }

    .time-picker-preview {
        padding: 0.65rem 0.85rem 0.25rem;
    }

    .time-picker-preview strong {
        font-size: 2rem;
    }

    .time-picker-date-row {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.35rem 0.85rem 0.6rem;
    }

    .picker-chip,
    .time-picker-date-custom,
    .quick-action-btn {
        min-height: 44px;
    }

    .time-picker-date-custom {
        justify-content: space-between;
    }

    .time-picker-date-custom input {
        width: 8.4rem;
        min-height: 44px;
        text-align: right;
    }

    .time-picker-time-grid {
        gap: 0.45rem;
        padding: 0.15rem 0.85rem 0.65rem;
    }

    .time-picker-unit {
        grid-template-rows: 44px 2.85rem 44px auto;
        gap: 0.3rem;
        padding: 0.45rem;
    }

    .time-step-btn {
        min-height: 44px;
        height: 44px;
    }

    .time-picker-value {
        font-size: 1.95rem;
    }

    .time-picker-quick-actions {
        gap: 0.45rem;
        padding: 0 0.85rem 0.7rem;
    }

    .quick-action-btn {
        font-size: 0.86rem;
    }

    .time-picker-footer {
        padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
    }

    .help-content {
        width: calc(100% - 1rem);
        max-height: calc(100svh - 1rem);
        margin: 0 auto;
        padding: 0 1rem 1rem;
        border-radius: 0.5rem;
    }

    .help-header {
        margin: 0 -1rem 0.8rem;
        padding: 0.75rem 1rem;
    }

    .help-header h2 {
        font-size: 1.2rem;
    }

    .help-section {
        margin-bottom: 1.25rem;
    }

    .help-section h3 {
        font-size: 1rem;
    }

    .help-item {
        padding-left: 0.5rem;
    }

    .help-item-desc,
    .help-contact {
        font-size: 0.82rem;
    }
}

@media (max-width: 360px) {
    .touch-time-main {
        font-size: 1.42rem;
    }

    .control-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .control-buttons .btn-reset {
        grid-column: 1 / -1;
    }

    .time-picker-date-row {
        padding-right: 0.65rem;
        padding-left: 0.65rem;
    }

    .time-picker-time-grid,
    .time-picker-quick-actions,
    .time-picker-footer {
        padding-right: 0.65rem;
        padding-left: 0.65rem;
    }

    .time-picker-unit {
        padding: 0.35rem;
    }
}

/* 矮横屏使用单层滚动，并把时、分、秒压缩到同一行。 */
@media (orientation: landscape) and (max-height: 600px) {
    .settings-panel {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: min(calc(100% - 1rem), 720px);
        max-height: calc(100svh - 1rem);
        padding: 0;
        transform: translate(-50%, -50%);
    }

    .settings-panel::before {
        display: none;
    }

    .settings-header {
        padding: 0.55rem 0.85rem;
    }

    .settings-time-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        padding: 0.55rem 0.75rem;
    }

    .time-card {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.55rem;
    }

    .touch-time-button {
        min-height: 44px;
    }

    .control-buttons {
        padding: 0.55rem 0.75rem;
    }

    .settings-actions {
        position: sticky;
        bottom: 0;
        padding: 0.55rem 0.75rem;
    }

    .time-picker-backdrop {
        align-items: center;
        padding: 0.5rem;
    }

    .time-picker-sheet {
        width: min(calc(100% - 1rem), 760px);
        max-height: calc(100svh - 1rem);
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 0.65rem;
    }

    .time-picker-sheet::before {
        display: none;
    }

    .time-picker-header {
        padding: 0.45rem 0.75rem;
    }

    .time-picker-kicker {
        font-size: 0.68rem;
    }

    .time-picker-title {
        font-size: 1rem;
    }

    .time-picker-preview {
        padding: 0.35rem 0.75rem 0.15rem;
    }

    .time-picker-preview strong {
        font-size: 1.75rem;
    }

    .time-picker-date-row {
        padding: 0.25rem 0.75rem 0.4rem;
    }

    .picker-chip,
    .time-picker-date-custom,
    .quick-action-btn {
        min-height: 44px;
    }

    .time-picker-time-grid {
        gap: 0.4rem;
        padding: 0.15rem 0.75rem 0.4rem;
    }

    .time-picker-unit {
        grid-template-columns: 44px minmax(2.5rem, 1fr) 44px 1.25rem;
        grid-template-rows: 44px;
        gap: 0.25rem;
        padding: 0.3rem;
    }

    .time-step-btn {
        width: 44px;
        height: 44px;
    }

    .time-picker-value {
        font-size: 1.55rem;
    }

    .time-picker-unit-label {
        align-self: center;
    }

    .time-picker-quick-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.4rem;
        padding: 0 0.75rem 0.4rem;
    }

    .time-picker-footer {
        padding: 0.45rem 0.75rem;
    }

    .help-content {
        width: min(calc(100% - 1rem), 680px);
        max-height: calc(100svh - 1rem);
        transform: none;
    }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 680px) {
    .time-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
    }

    .settings-label {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }

    .touch-time-main {
        font-size: 1.42rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .settings-panel,
    .time-picker-backdrop,
    .time-picker-sheet,
    .help-modal,
    .help-content {
        touch-action: pan-y;
        overscroll-behavior-x: none;
    }
}

@media (prefers-color-scheme: dark) {
    .help-contact {
        border-top-color: #333333;
        color: #999999;
    }

    .help-contact a {
        color: #0a84ff;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.clock-status {
    margin-top: 0.3rem;
    color: rgba(210, 232, 212, 0.62);
    font-size: clamp(0.68rem, 1.2vw, 0.86rem);
    line-height: 1.1;
    text-align: center;
}

.clock-status.is-warning { color: #e7be6a; }

.settings-section.status-section {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.8rem;
    line-height: 1.65;
}

.settings-section.share-section { padding-top: 0.4rem; }

.share-trigger {
    width: 100%;
    min-height: 2.65rem;
    background: rgba(0, 210, 112, 0.12);
    border-color: rgba(0, 255, 120, 0.28);
    color: #eaffef;
}

.share-panel {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem 0;
    justify-items: stretch;
}

.share-panel[hidden] { display: none; }

.share-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    line-height: 1.5;
}

.share-qr {
    display: grid;
    place-items: center;
    justify-self: center;
    width: min(60vw, 230px);
    aspect-ratio: 1;
    padding: 0.55rem;
    background: #fff;
    border-radius: 0.35rem;
}

.share-qr svg { width: 100%; height: 100%; }

#shareLink {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.3rem;
    background: #101315;
    color: #eaffef;
    font-size: 0.75rem;
}

/* 弹窗统一采用固定首尾和独立滚动区，窄屏也始终保留关闭入口。 */
.settings-panel,
.time-picker-sheet {
    flex-direction: column;
    overflow: hidden;
}

.settings-panel { max-height: min(92svh, 760px); }
.time-picker-sheet { display: flex; }

.settings-header,
.time-picker-header,
.settings-actions,
.time-picker-footer {
    flex: 0 0 auto;
}

.settings-header,
.time-picker-header {
    position: relative;
    z-index: 1;
}

.settings-scroll,
.time-picker-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.settings-scroll { padding-bottom: 0.5rem; }
.time-picker-scroll { padding-bottom: 0.5rem; }
.settings-actions,
.time-picker-footer { position: relative; bottom: auto; }

.settings-dirty {
    margin-top: 0.28rem;
    color: #f6cf7e;
    font-size: 0.82rem;
    font-weight: 600;
}

.settings-dirty[hidden],
.share-hint[hidden],
.external-change[hidden],
.undo-bar[hidden],
.share-modal[hidden],
.confirm-modal[hidden] { display: none !important; }

.share-hint {
    margin: 0.55rem 0 0;
    color: #f6cf7e;
    font-size: 0.88rem;
    line-height: 1.45;
}

.external-change {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin: 0.75rem 1.25rem 0;
    padding: 0.7rem;
    border: 1px solid rgba(246, 207, 126, 0.48);
    border-radius: 0.45rem;
    background: #332818;
    color: #ffe3a7;
    font-size: 0.88rem;
    line-height: 1.4;
}

.external-change button {
    min-height: 40px;
    flex: 0 0 auto;
    border: 1px solid #f6cf7e;
    border-radius: 0.35rem;
    background: transparent;
    color: #ffe3a7;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.control-heading {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.btn-reset { background: #30383d; }
.btn-end { background: #8c2929; }
.btn-help {
    background: #30383d !important;
    color: #e8ebed !important;
}

.settings-section.status-section {
    font-size: 0.875rem;
    line-height: 1.55;
}

.share-modal,
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.74);
}

.share-content,
.confirm-content {
    display: flex;
    flex-direction: column;
    width: min(100%, 460px);
    max-height: calc(100svh - 1rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.65rem;
    background: #181c1f;
    color: #f5f6f6;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.6);
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-header h2,
.confirm-content h2 {
    margin: 0;
    font-size: 1.2rem;
}

.share-body {
    display: grid;
    justify-items: stretch;
    gap: 0.6rem;
    min-height: 0;
    overflow-y: auto;
    padding: 0.8rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.share-body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    line-height: 1.45;
}

.share-body .share-summary { color: #fff; font-weight: 600; }
.share-body .share-qr { width: min(48vw, 195px); }
.share-actions {
    flex: 0 0 auto;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.share-actions .btn { width: 100%; background: #197949; }

.confirm-modal { z-index: 1450; }
.confirm-content { padding: 1.25rem; }
.confirm-content p { margin: 0.8rem 0 1.15rem; color: #cbd0d2; line-height: 1.55; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.confirm-actions .btn { min-height: 44px; }

.undo-bar {
    position: fixed;
    z-index: 1600;
    top: max(0.45rem, env(safe-area-inset-top));
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: max-content;
    max-width: calc(100% - 1rem);
    transform: translateX(-50%);
    padding: 0.35rem 0.45rem 0.35rem 0.75rem;
    border: 1px solid #6fbf84;
    border-radius: 0.5rem;
    background: #183322;
    color: #f0fff3;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
    font-size: 0.82rem;
}

.undo-bar button {
    min-height: 34px;
    border: 0;
    border-radius: 0.35rem;
    background: #4cbb74;
    color: #06160a;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.summary-undo {
    display: block;
    width: calc(100% - 2.5rem);
    min-height: 44px;
    margin: 0.7rem 1.25rem;
    border: 1px solid #73c28b;
    border-radius: 0.4rem;
    background: #244c31;
    color: #effff2;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.summary-undo[hidden] { display: none; }

.notice-toast { bottom: max(5rem, calc(4rem + env(safe-area-inset-bottom))); }

/* 帮助与设置使用同一套深色、短段落样式。 */
.help-content {
    background: #1b2023;
    color: #f3f5f5;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 1.25rem 1.25rem;
}
.help-header { padding: 0.85rem 0; }
.help-content h2 { color: #fff; font-size: 1.2rem; }
.help-section { margin-bottom: 1.2rem; }
.help-section h3 {
    margin: 0 0 0.4rem;
    padding: 0;
    border: 0;
    color: #8ee5a3;
    font-size: 0.98rem;
}
.help-section p { margin: 0; color: #d3d9db; font-size: 0.9rem; line-height: 1.65; }
.help-contact { border-color: rgba(255,255,255,0.14); color: #cbd0d2; }
#copyWechatLink {
    border: 0;
    background: none;
    color: #a8e9b9;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
#closeHelpBtn { background: #30383d; }

@media (max-width: 480px) {
    .settings-panel,
    .time-picker-sheet { overflow: hidden; }
    .settings-panel { max-height: min(82svh, calc(100svh - 0.75rem)); }
    .settings-actions,
    .time-picker-footer { position: relative; bottom: auto; }
    .external-change { margin: 0.65rem 0.75rem 0; flex-wrap: wrap; }
    .share-modal { align-items: flex-end; padding: 0; }
    .share-content { width: 100%; max-height: calc(100svh - 0.5rem); border-radius: 0.65rem 0.65rem 0 0; }
    .share-body .share-qr { width: min(52vw, 180px); }
    .confirm-content { width: min(calc(100% - 1rem), 420px); }
}

@media (orientation: landscape) and (max-height: 600px) {
    .settings-panel,
    .time-picker-sheet { overflow: hidden; }
    .settings-panel { max-height: calc(100svh - 1rem); }
    .settings-actions,
    .time-picker-footer { position: relative; bottom: auto; }
}
