* {
    box-sizing: border-box;
}

html {
    min-width: 280px;
    min-height: 100%;
    background: #f7f7f7;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: #f7f7f7;
    color: #171717;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 14px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button,
label,
input {
    touch-action: manipulation;
}

.boot-status {
    max-width: 384px;
    margin: 35vh auto 0;
    padding: 0 24px;
    color: #777777;
    text-align: center;
}

.boot-error {
    color: #c82d25;
}

.page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16vh 24px 0;
    background: #f7f7f7;
}

.container {
    width: 100%;
    max-width: 384px;
    margin: 0 auto;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    overflow: hidden;
    border-radius: 16px;
    background: #ffe600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    color: #171717;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.65px;
    line-height: 1.5;
    white-space: nowrap;
}

.brand-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 数据加载完成前隐藏头像与主标题（保留占位空间，避免布局抖动） */
.brand-mark,
.page-title {
    transition: opacity 0.25s ease;
}

.is-hidden {
    opacity: 0;
    visibility: hidden;
}

/* 加载骨架屏：尺寸与最终内容一致，避免刷新时文字突兀切换或跳动 */
.skeleton {
    border-radius: 8px;
    background: #ececec;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.card-skeleton .skeleton-title {
    width: 45%;
    height: 22.5px;
    margin: 0 0 8px;
}

.card-skeleton .skeleton-input {
    height: 48.5px;
    border-radius: 12px;
}

.card-skeleton .skeleton-button {
    width: 100%;
    height: 48px;
    margin-top: 16px;
    border-radius: 12px;
}

/* 头像区与标题位骨架屏：尺寸与最终内容一致，避免布局偏移 */
.brand-mark.is-loading {
    background: transparent;
    box-shadow: none;
}

.skeleton-avatar {
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.skeleton-title-text {
    display: inline-block;
    width: 150px;
    max-width: 60%;
    height: 20px;
    border-radius: 6px;
    vertical-align: middle;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

/* 统一弹层提示：对齐参考站 .addr-toast（居中深色圆角框、白字、无过渡动画） */
.app-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: clamp(12.5px, 3.3333vw, 14px);
    padding: clamp(10.7px, 2.8571vw, 12px) clamp(21.4px, 5.7143vw, 24px);
    border-radius: clamp(7.1px, 1.9048vw, 8px);
    z-index: 9999;
    display: none;
    text-align: center;
    max-width: min(280px, 66.6667vw);
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
}

.app-toast.show {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

.page-title {
    min-height: 30px;
    margin: 0 0 32px;
    color: #171717;
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
    overflow-wrap: anywhere;
}

.card {
    width: 100%;
    padding: 20px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.card-title {
    margin: 0 0 8px;
    color: #171717;
    font-size: 15px;
    font-weight: 600;
    line-height: 22.5px;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.card-heading .card-title {
    margin-bottom: 0;
}

.description {
    margin: 0 0 16px;
    color: #777777;
    font-size: 13px;
    line-height: 21px;
}

.gate-message {
    margin: 10px 0 0;
    color: #c82d25;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
}

.gate-status {
    color: #777777;
}

.field-label {
    display: block;
    margin: 0 0 8px;
    color: #444444;
    font-size: 14px;
    line-height: 20px;
}

.text-input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    outline: none;
    background: #fafafa;
    color: #171717;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 22.5px;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

.text-input::placeholder {
    color: oklch(70.8% 0 0);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
}

.text-input:focus {
    border-color: #ffcf00;
    background: #ffffff;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
    border: 0;
    cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 46px;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.primary-button {
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    padding: 12px 0;
    background: #ffe600;
    color: #171717;
    font-weight: 700;
    cursor: default;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.secondary-button {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #e3e3e3;
    background: #ffffff;
    color: #555555;
}

.secondary-button:hover:not(:disabled) {
    background: #f7f7f7;
}

.danger-button {
    border: 1px solid #efcbc8;
    background: #ffffff;
    color: #c73b33;
}

.danger-button:hover:not(:disabled) {
    background: #fff6f5;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.text-button {
    min-height: 32px;
    padding: 3px 6px;
    background: transparent;
    color: #7a6a00;
    font-size: 13px;
    line-height: 20px;
}

.form-error,
.form-notice,
.status-message {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 20px;
}

.form-error {
    margin: 8px 0 0;
    color: #fb2c36;
    line-height: 19.5px;
}

.form-notice {
    margin: 12px 0 0;
    color: #357a38;
}

.status-message {
    margin: 0;
    color: #777777;
    text-align: center;
}

.status-message + .secondary-button {
    margin-top: 16px;
}

.page-footer {
    position: relative;
    margin: 16px auto 0;
    color: oklch(70.8% 0 0);
    font-size: 13px;
    line-height: 1.625;
    text-align: center;
    overflow-wrap: anywhere;
}

/* 页脚加载骨架：隐藏文本保留原始高度，骨架绝对覆盖，避免换行差异导致跳动 */
.page-footer.is-loading .footer-text {
    visibility: hidden;
}

.footer-skeleton {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
}

.skeleton-footer-line {
    display: block;
    width: 100%;
    height: 13px;
    border-radius: 4px;
}

.skeleton-footer-line.short {
    width: 62%;
    margin: 0 auto;
}

.confirm-number {
    margin: 4px 0 8px;
    color: #222222;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 8px;
    line-height: 52px;
    text-align: center;
    text-indent: 8px;
    user-select: all;
}

.countdown {
    margin: 0 0 16px;
    color: #777777;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
}

.countdown strong {
    color: #444444;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.request-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.request-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
}

.request-item.is-selected {
    border-color: #d8bf00;
    background: #fffdf0;
}

.request-radio {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: #d8bf00;
}

.request-info {
    min-width: 0;
    flex: 1;
}

.request-device {
    display: block;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.request-time {
    display: block;
    margin-top: 3px;
    color: #888888;
    font-size: 12px;
    line-height: 18px;
    overflow-wrap: anywhere;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.action-row .primary-button,
.action-row .danger-button {
    width: 100%;
    margin-top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 340px) {
    .confirm-number {
        font-size: 34px;
        letter-spacing: 6px;
        text-indent: 6px;
    }
}

