/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}

button { cursor: pointer; }

ol, ul { list-style: none; }

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ========== 页面容器 ========== */
.page {
    position: relative;
    width: 100%;
    max-width: 750px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #f5f5f7;
    padding-bottom: 24px;
    overflow: hidden;
}

/* ========== 顶部标题栏 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 12px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.nav-back:active {
    background: #f2f2f2;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.5px;
}

.nav-placeholder {
    width: 32px;
    height: 32px;
}

/* ========== 顶部 Banner ========== */
.banner {
    position: relative;
    width: 100%;
    line-height: 0;
    background: #ff4f3f;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* ========== 列表卡片 ========== */
.list-card {
    position: relative;
    background: #ffffff;
    margin: 12px 12px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    min-height: 120px;
}

/* 列表局部加载（切换页时） */
.list-card.is-list-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(22, 119, 255, 0.18);
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 2;
}

.list-card.is-list-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    z-index: 1;
    pointer-events: none;
}

/* 列表表头 */
.list-head {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.col-user {
    flex: 1;
    text-align: center;
}

.col-time {
    width: 110px;
    text-align: right;
}

/* ========== 违规列表 ========== */
.violation-list {
    padding: 0 12px;
}

.violation-item {
    display: flex;
    align-items: center;
    padding: 14px 4px;
    border-bottom: 1px solid #f4f4f6;
    transition: background 0.15s ease;
}

.violation-item:last-child {
    border-bottom: none;
}

/* 用户信息区 */
.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.user-text {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 17px;
    color: #222;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-phone {
    font-size: 14px;
    color: #999;
    line-height: 1.3;
}

/* 违规时间 */
.violation-time {
    width: 120px;
    text-align: right;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    flex-shrink: 0;
}

.violation-time .time-date {
    display: block;
    color: #555;
}

.violation-time .time-clock {
    display: block;
    color: #999;
    margin-top: 2px;
}

/* ========== 空状态 ========== */
.list-empty {
    padding: 60px 0;
    text-align: center;
}

.empty-text {
    color: #999;
    font-size: 15px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 12px;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #ececec;
    color: #555;
    font-size: 13px;
    line-height: 30px;
    text-align: center;
    transition: all 0.15s ease;
    user-select: none;
}

.pg-btn:active {
    background: #f5f5f5;
}

.pg-btn.pg-active {
    background: #1677ff;
    border-color: #1677ff;
    color: #ffffff;
    font-weight: 600;
}

.pg-btn:disabled,
.pg-btn.is-disabled {
    color: #c8c8c8;
    background: #fafafa;
    cursor: not-allowed;
}

.pg-ellipsis {
    min-width: 24px;
    height: 32px;
    line-height: 32px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

/* ========== 底部更新时间 ========== */
.update-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 16px 12px 4px;
    color: #b0b0b0;
    font-size: 12px;
}

.update-icon {
    display: inline-flex;
    align-items: center;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show { opacity: 1; }

[hidden] { display: none !important; }

/* ========== 响应式调整 ========== */
@media (max-width: 360px) {
    .nav-title { font-size: 16px; }
    .user-avatar { width: 40px; height: 40px; margin-right: 10px; }
    .user-name { font-size: 16px; }
    .user-phone { font-size: 13px; }
    .violation-time { width: 110px; font-size: 13px; }
    .pg-btn { min-width: 28px; height: 28px; line-height: 26px; font-size: 12px; padding: 0 8px; }
}

@media (min-width: 750px) {
    .page { box-shadow: 0 0 30px rgba(0, 0, 0, 0.06); }

    .list-card { margin: 16px 16px 0; }

    .user-avatar { width: 48px; height: 48px; margin-right: 14px; }

    .user-name { font-size: 18px; }

    .user-phone { font-size: 15px; }

    .violation-time { width: 140px; font-size: 15px; }

    .pg-btn { min-width: 36px; height: 36px; line-height: 34px; font-size: 14px; }
}

/* ========== Loading 转圈遮罩 ========== */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-box {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 10px;
    text-align: center;
    min-width: 110px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(22, 119, 255, 0.25);
    border-top-color: #1677ff;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 13px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页面进入/刷新加载遮罩淡出 */
.page-loading-mask {
    transition: opacity 0.35s ease;
}

.page-loading-mask.is-hidden {
    opacity: 0;
    pointer-events: none;
}

body.is-loading {
    overflow: hidden;
}
