/* ===== 全局 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --sub-text: #6b7280;

    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;

    --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --radius: 20px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
}

button,
input {
    font-family: inherit;
}

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px 50px;
}

/* ===== 公告 ===== */

.notice-section {
    margin-bottom: 30px;
}

.notice-box {
    position: relative;
    height: 56px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.notice-track {
    position: absolute;
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    /* animation: marquee 10s linear infinite; */
}

.notice-track span {
    padding-left: 150%;
    font-size: 15px;
    color: var(--sub-text);
}

.notice-box:hover .notice-track {
    animation-play-state: paused;
}

@keyframes marquee {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

/* ===== 网站卡片 ===== */

.site-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.site-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all .25s ease;
}

.site-card:hover {
    transform: translateY(-5px);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.card-top h3 {
    font-size: 32px;
    font-weight: 700;
}

.site-card p {
    min-height: 88px;
    line-height: 1.8;
    color: var(--sub-text);
    margin-bottom: 24px;
}

/* ===== 状态 ===== */

.status {
    font-size: 14px;
    font-weight: 600;
}

.online {
    color: var(--green);
}

.offline {
    color: var(--red);
}

.checking {
    color: var(--yellow);
}

/* ===== 按钮 ===== */

.site-card button,
.pagination button,
.modal-actions button {
    border: none;
    cursor: pointer;
    transition: .2s;
}

.site-card button {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-size: 15px;
}

.site-card button:hover {
    opacity: .9;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 28px;
    cursor: pointer;
}

/* ===== 观影记录 ===== */

.record-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 40px;
}

/* ===== 搜索 ===== */

.search-box {
    margin: 24px 0;
}

.search-box input {
    width: 320px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--green);
}

/* ===== 表头 ===== */

.record-head,
.record-row {
    display: grid;
    grid-template-columns:
        1.2fr 2fr 1fr 1fr 1fr;

    gap: 14px;
    align-items: center;
}

.record-head {
    padding: 0 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

/* ===== 数据行 ===== */

.record-row {
    margin-top: 16px;
    padding: 16px 12px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.record-cell {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.record-actions {
    display: flex;
    gap: 10px;
}

.record-actions button {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.edit-btn {
    background: #3b82f6;
    color: #fff;
}

.delete-btn {
    background: #ef4444;
    color: #fff;
}

/* ===== 分页 ===== */

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.pagination button {
    width: 120px;
    height: 46px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pagination button:hover {
    background: #f3f4f6;
}

/* ===== 弹窗 ===== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 520px;
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .2);
}

.modal-content h3 {
    margin-bottom: 24px;
}

.modal-content input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.modal-content input:focus {
    border-color: var(--green);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 12px 24px;
    border-radius: 12px;
}

#cancelBtn {
    background: #f3f4f6;
}

#saveBtn {
    background: var(--green);
    color: #fff;
}

/* ===== 骨架屏 ===== */

.site-skeleton,
.record-skeleton {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.site-skeleton::before,
.record-skeleton::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, .7),
            transparent);
    animation: skeleton 1.5s infinite;
}

.site-skeleton {
    height: 260px;
    border-radius: 20px;
    background: #e5e7eb;
}

.record-skeleton {
    height: 72px;
    margin-top: 16px;
    border-radius: 16px;
    background: #e5e7eb;
}

@keyframes skeleton {

    100% {
        transform: translateX(100%);
    }
}

/* ===== 响应式 ===== */

@media (max-width: 992px) {

    .site-grid {
        grid-template-columns: 1fr;
    }

    .record-head {
        display: none;
    }

    .record-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .record-actions {
        justify-content: flex-end;
    }

    .search-box input {
        width: 100%;
    }

    .modal-content {
        width: calc(100% - 30px);
    }

    .section-header h2 {
        font-size: 32px;
    }

    .card-top h3 {
        font-size: 24px;
    }
}