/* ============================================================
   changedetection.io 个性化 UI —— 从零重写
   原则：纯白背景 / 纯黑文字 / 灰色分隔 / 蓝色主按钮
   ============================================================ */

/* ---------- 基础 ---------- */
body {
    background: #ffffff !important;
    color: #111111 !important;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}
body::before, body::after { background: #ffffff !important; }
a { color: #1d4ed8; }
* { box-sizing: border-box; }

/* ---------- 顶栏：无背景，仅分割线 ---------- */
.header {
    background: #ffffff !important;
    border-bottom: 1px solid #dddddd;
    padding: .3rem .8rem;
}
#top-right-menu a, #top-right-menu button { color: #111111 !important; }
.status-pill {
    background: #f0f0f0 !important;
    border: 1px solid #bbbbbb !important;
    color: #111111 !important;
}
.status-pill .live-dot { background: #2563eb !important; }

/* ---------- 操作按钮：3 个完全一致 ---------- */
.watchlist-actions {
    display: flex;
    gap: .5rem;
    margin: .4rem 0 .9rem;
}
.cd-action-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: .85rem;
    font-weight: 600;
    padding: 0 1.1rem;
    height: 38px;
    min-width: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    vertical-align: middle;
    font-family: inherit;
    box-sizing: border-box;
    overflow: visible;
}
.cd-action-btn:hover { background: #1d4ed8; color: #ffffff; }
.watchlist-actions .cd-action-btn { align-self: stretch; }

/* ---------- 行内按钮：编辑 / 查看变化 统一 ---------- */
.watch-row-btn, .cd-row-btn {
    background: #ffffff;
    border: 1px solid #999999;
    color: #111111;
    border-radius: 3px;
    font-size: .78rem;
    font-weight: 500;
    padding: .28rem .6rem;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}
.cd-row-btn:hover { background: #f0f0f0; color: #111111; }
.cd-row-btn--primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
}
.cd-row-btn--primary:hover { background: #1d4ed8; color: #ffffff; }

/* ---------- 表格：清晰对齐 ---------- */
.watch-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}
.watch-table th {
    border-bottom: 2px solid #111111;
    padding: .5rem .6rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    color: #111111;
    white-space: nowrap;
}
.watch-table td {
    border-bottom: 1px solid #e5e5e5;
    padding: .55rem .6rem;
    vertical-align: middle;
    color: #111111;
}
/* 列宽：网页自适应 | 检查 100 | 变更 100 | 操作 190 */
.watch-table th:nth-child(1), .watch-table td:nth-child(1) { width: auto; }
.watch-table th:nth-child(2), .watch-table td:nth-child(2) { width: 100px; white-space: nowrap; }
.watch-table th:nth-child(3), .watch-table td:nth-child(3) { width: 100px; white-space: nowrap; }
.watch-table th:nth-child(4), .watch-table td:nth-child(4) { width: 190px; white-space: nowrap; text-align: right; }
.watch-table th:nth-child(4) { text-align: right; }

/* 标题列：图标 | 文本 | 状态 */
.title-col { width: auto !important; }
.grid-wrapper {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
}
.favicon { grid-column: 1; }
.favicon img { width: 36px; height: 36px; border-radius: 4px; }
.watch-text-info { grid-column: 2; min-width: 0; }
.status-icons { grid-column: 3; }
.watch-title { font-size: .9rem; font-weight: 500; color: #111111; word-break: break-all; }
.watch-title .external { text-decoration: none; }

/* 未读：浅蓝高亮 + 前置 */
.unviewed td { background: #e0eaff !important; }
.unviewed .watch-title { font-weight: 700; }

/* 检查中：左侧蓝条 */
.checking-now td:first-child { position: relative; }
.checking-now td:first-child::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: #2563eb;
}

/* 变化内容第二行：只显示本次新增 */
.watch-change-row td {
    padding: .4rem .8rem .7rem 1rem !important;
    background: #fafafa !important;
}
.watch-change-content {
    background: #f5f5f5;
    border-left: 4px solid #2563eb;
    color: #111111;
    font-size: .8rem;
    line-height: 1.5;
    padding: .5rem .7rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 空状态 */
.watchlist-empty-card {
    border: 1px dashed #aaaaaa;
    background: #fafafa;
    border-radius: 6px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
}
.watchlist-empty-card p { color: #333333; }
.watchlist-empty-hint { color: #555555 !important; font-size: .8rem; }

/* ---------- 表单（编辑页 / 设置页） ---------- */
.edit-form input[type="text"],
.edit-form input[type="url"],
.edit-form input[type="password"],
.edit-form textarea,
.edit-form select {
    border: 1px solid #999999 !important;
    border-radius: 3px !important;
    background: #ffffff !important;
    color: #111111 !important;
    padding: .35rem .5rem !important;
    font-size: .85rem !important;
}
.edit-form label { color: #111111 !important; font-weight: 600; }
.pure-form-message-inline, .pure-form-message { color: #333333 !important; font-size: .8rem; }
.pure-button-primary {
    background: #2563eb !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 3px !important;
    padding: .45rem 1rem !important;
    font-weight: 600 !important;
}
.pure-button-primary:hover { background: #1d4ed8 !important; }
.pure-button.button-error, .button-error {
    background: #dc2626 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 3px !important;
    padding: .45rem 1rem !important;
}
.settings-section-title { font-size: 1rem; font-weight: 700; color: #111111; margin: .6rem 0; }
.settings-divider { border: none; border-top: 1px solid #dddddd; margin: 1rem 0; }

/* ---------- 分页 ---------- */
.pagination { margin: .8rem 0; color: #333333; }
.pagination a, .pagination .page-link { color: #1d4ed8; text-decoration: none; }

/* ---------- 杂项清理 ---------- */
.seg, #stats_row, .records-selected { display: none !important; }
.beta-logo, .inline-warning { display: none !important; }
