/* ===============================================================
   引流宝 - 后台 + 登录专属样式
   =============================================================== */

/* ---------- Login ---------- */
.login-body {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f7fb 50%, #fef3c7 100%);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 40px rgba(31, 41, 55, .08);
    border: 1px solid var(--color-border);
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .brand {
    justify-content: center;
}
.login-head p { color: var(--color-sub); margin: 8px 0 0; font-size: 13px; }
.login-foot { margin-top: 16px; color: var(--color-muted); text-align: center; font-size: 12px; }

/* brand style */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.logo-mark {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--color-primary);
    color: white;
    display: grid; place-items: center;
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, .25);
}
.brand-name { font-weight: 700; font-size: 16px; }

/* ---------- Admin Layout ---------- */
.admin-body { background: var(--color-bg); }
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 220px;
    background: #1f2937;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}
.sidebar-head {
    padding: 20px;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-head .logo-mark { background: var(--color-primary); }
.sidebar-head .brand-name { color: white; font-size: 15px; }
.side-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #d1d5db;
    transition: all var(--transition);
    font-size: 13px;
}
.nav-item .ic {
    width: 18px; height: 18px;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nav-item:hover {
    background: #374151;
    color: white;
}
.nav-item:hover .ic { color: white; }
.nav-item.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}
.nav-item.active .ic { color: white; }
.sidebar-foot {
    padding: 12px;
    border-top: 1px solid #374151;
}
.sidebar-foot .nav-item {
    color: #fca5a5;
}
.sidebar-foot .nav-item:hover {
    background: rgba(239, 68, 68, .2);
    color: #fecaca;
}

/* ---------- Main ---------- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.crumbs .crumb {
    font-weight: 600;
    font-size: 15px;
    color: #374151;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-sub);
}
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-bg);
    border-radius: 999px;
    color: #374151;
}
.avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: grid; place-items: center;
    font-size: 12px;
    font-weight: 600;
}
.page {
    padding: 24px;
    flex: 1;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title { font-size: 20px; }
.page-sub { color: var(--color-sub); font-size: 13px; margin: 4px 0 0; }
.page-tools { display: flex; gap: 8px; }

/* ---------- Card ---------- */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; }
.card-head .hint { color: var(--color-muted); font-size: 12px; }

.card .form { margin-top: 8px; }

/* ---------- KPI ---------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.kpi-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 18px;
    transition: all var(--transition);
}
.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.kpi-label {
    color: var(--color-sub);
    font-size: 12px;
    margin-bottom: 6px;
}
.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.5px;
}
.kpi-meta {
    color: var(--color-muted);
    font-size: 11px;
    margin-top: 4px;
}

/* ---------- Chart ---------- */
.chart-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.chart-head h3 { font-size: 15px; }
.chart-wrap {
    width: 100%;
    height: 220px;
}
.chart-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}
.chart-legend {
    display: flex;
    gap: 12px;
    color: var(--color-sub);
    font-size: 12px;
    margin-top: 8px;
    justify-content: flex-end;
}
.chart-legend .legend-uv::before {
    content: "";
    display: inline-block;
    width: 10px; height: 2px;
    background: var(--color-primary);
    margin-right: 4px;
    vertical-align: middle;
}
.chart-legend .legend-grid::before {
    content: "";
    display: inline-block;
    width: 10px; height: 0;
    border-top: 1.5px dashed #9ca3af;
    margin-right: 4px;
    vertical-align: middle;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    background: white;
    min-width: 160px;
}
.filter-bar input:focus, .filter-bar select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 960px) {
    .sidebar {
        width: 64px;
    }
    .sidebar-head .brand-name,
    .nav-item span,
    .sidebar-foot .nav-item span {
        display: none;
    }
    .sidebar-head {
        justify-content: center;
    }
    .nav-item, .sidebar-foot .nav-item {
        justify-content: center;
    }
}
@media (max-width: 600px) {
    .topbar { padding: 0 12px; }
    .page { padding: 12px; }
    .page-tools { flex-direction: column; align-items: stretch; }
}

/* ---------- Dashboard: UV tooltip ---------- */
.uv-tip {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    background: #1f2937;
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.4;
    box-shadow: var(--shadow);
    white-space: nowrap;
}
.uv-tip strong { color: #c7d2fe; }
.chart-wrap { position: relative; width: 100%; height: 220px; }

/* ---------- Dashboard: tabs ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--color-bg); padding: 3px; border-radius: var(--radius-sm); }
.tab {
    border: none; background: transparent; cursor: pointer;
    padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--color-sub);
    transition: all var(--transition);
}
.tab:hover { color: var(--color-text); }
.tab.active { background: white; color: var(--color-primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Dashboard: 排行榜 ---------- */
.rank-panel { display: none; }
.rank-panel.active { display: block; }
.rank-badge {
    display: inline-grid; place-items: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--color-bg); color: var(--color-sub);
    font-size: 12px; font-weight: 600;
}
.rank-badge.top { background: var(--color-primary); color: #fff; }

/* ---------- Dashboard: 报表横向滚动 ---------- */
/* ---------- Table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.data-table thead th {
    background: #FAFBFC;
    color: var(--color-sub);
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: #F8FAFC; }
.table-scroll { overflow-x: auto; }
.table-scroll .data-table { min-width: 100%; }
.report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.report-table th, .report-table td {
    padding: 9px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
/* v1.3.0 修复: .data-table thead th(0,1,2) 的 text-align:left 会覆盖 .report-table th(0,1,1),
   造成"表头左对齐 / 表体右对齐"错位。这里提高选择器权重(0,2,2)确保表头与表体一致右对齐。 */
.data-table.report-table thead th,
.report-table thead th {
    background: #FAFBFC;
    font-weight: 500;
    color: var(--color-sub);
    text-align: right;
}
.data-table.report-table thead th:first-child,
.report-table thead th:first-child { text-align: right; }
.report-table td { text-align: right; font-variant-numeric: tabular-nums; }
.report-table td:first-child { text-align: right; color: var(--color-text); font-variant-numeric: tabular-nums; }
.report-table tbody tr:nth-child(odd) { background: var(--color-bg); }

/* ---------- Tag / inline field ---------- */
.tag.indigo { background: var(--color-primary-light); color: var(--color-primary); }
.field-inline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #374151; }
.field-inline .field-label { font-size: 13px; color: #374151; }
.field-inline .switch { width: 38px; }

/* ---------- 配置中心: 分隔标题 ---------- */
.form-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--color-muted); font-size: 13px; font-weight: 600; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; background: var(--color-border); flex: 1; }
.form-divider span { white-space: nowrap; }

/* ---------- 访问日志: 工具条 / 清理 ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.toolbar .field-inline { flex-direction: row; align-items: center; gap: 8px; }
.toolbar input[type="text"] { min-width: 240px; }
.actions.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.inline-form { display: inline-block; }

/* ---------- 通用 ---------- */
.nowrap { white-space: nowrap; }
.mb-2 { margin-bottom: 14px; }
.mt-2 { margin-top: 18px; }

/* ---------- 工具条 / 内联表单 / 分割标题 ---------- */
.form-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--color-muted); font-size: 13px; font-weight: 600; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; background: var(--color-border); flex: 1; }
.form-divider span { white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.toolbar .field-inline { flex-direction: row; align-items: center; gap: 8px; }
.toolbar input[type="text"] { min-width: 240px; }
.actions.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.inline-form { display: inline-block; }

/* ============================================================
   Dashboard: 浅色趋势图(顶部工具栏整合图例/切换/刷新)
   ============================================================ */
.chart-card-light {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    color: #0F172A;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 18px 12px 16px;
    margin-top: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.chart-card-light .chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.chart-card-light .chart-head h3 {
    color: #0F172A;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1 1 auto;
}
.chart-card-light .chart-toolbar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}
.chart-card-light .chart-legend-inline {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #475569;
}
.chart-card-light .chart-legend-inline .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-card-light .chart-legend-inline .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.chart-card-light .chart-legend-inline .lg-uv i { background: #22D3EE; box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); }
.chart-card-light .chart-legend-inline .lg-ip i { background: #A78BFA; box-shadow: 0 0 0 3px rgba(167, 139, 250, .18); }

.chart-card-light .chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}
.chart-card-light #uvChart { width: 100%; height: 320px; display: block; }
.chart-card-light .uv-tip {
    position: absolute;
    background: #FFFFFF;
    color: #0F172A;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
    border: 1px solid #E2E8F0;
    min-width: 170px;
    z-index: 10;
}
.chart-card-light .uv-tip-day { font-weight: 700; margin-bottom: 6px; color: #0F172A; font-size: 12px; }
.chart-card-light .uv-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; }
.chart-card-light .uv-tip-row b { font-weight: 600; color: #4F46E5; }
.chart-card-light circle.uv-dot { transition: r .15s ease; }
.chart-card-light circle.uv-dot:hover { r: 5; }

/* 分段按钮(UV / 独立IP) */
.seg-toggle {
    display: inline-flex;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}
.seg-toggle .seg {
    border: 0;
    background: transparent;
    color: #64748B;
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg-toggle .seg:hover { color: #0F172A; }
.seg-toggle .seg.active {
    background: #FFFFFF;
    color: #4F46E5;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

/* 兼容历史别名 */
.chart-card-dark { display: none; } /* 旧样式隐藏,新样式接管 */

/* ============================================================
   Dashboard: 排行榜(四列等宽卡片,空数据保留占位)
   ============================================================ */
.rank-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.rank-col {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.rank-col.is-empty {
    background: #FAFBFC;
}
.rank-col.is-empty .rank-head {
    background: #F1F5F9;
}
.rank-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #EEF2FF 0%, #F0FDFA 100%);
    border-bottom: 1px solid var(--color-border);
}
.rank-icon {
    display: inline-grid; place-items: center;
    width: 26px; height: 26px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    color: var(--color-primary);
    flex-shrink: 0;
}
.rank-icon svg { width: 15px; height: 15px; }
.rank-title { font-size: 13px; font-weight: 600; color: #0F172A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-body { padding: 2px 0; flex: 1; overflow-x: auto; }
.rank-empty { padding: 32px 12px; text-align: center; color: var(--color-muted); font-size: 13px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-table thead th {
    text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 500;
    color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.4px;
    border-bottom: 1px solid var(--color-border);
    background: #FAFBFC;
}
.rank-table tbody td { padding: 6px 10px; border-bottom: 1px solid #F1F5F9; }
.rank-table tbody tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover { background: #F8FAFC; }
.rank-table .num {
    display: inline-grid; place-items: center;
    width: 20px; height: 20px; border-radius: 5px;
    background: #F1F5F9; color: var(--color-muted);
    font-size: 11px; font-weight: 700;
}
.rank-table .num.top {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%); color: #fff;
}
.rank-table .rk-link code { background: var(--color-bg); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--color-primary); }
.rank-table .rk-link a { text-decoration: none; }
.rank-table .rk-title-small {
    font-size: 11px; color: var(--color-muted);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 160px;
}
.rank-table td.num-col { width: 28px; }
.rank-table td.ip-col, .rank-table td.uv-col, .rank-table td.pv-col {
    text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rank-table td.ip-col { width: 56px; }
.rank-table td.uv-col { width: 48px; }
.rank-table td.pv-col { width: 48px; }
/* v1.3.0 修复: 排行榜表头未设置列宽与对齐, 导致 thead 与 tbody 数值列错位 */
.rank-table thead th.num-col { width: 28px; }
.rank-table thead th.ip-col { width: 56px; }
.rank-table thead th.uv-col { width: 48px; }
.rank-table thead th.pv-col { width: 48px; }
.rank-table thead th.ip-col,
.rank-table thead th.uv-col,
.rank-table thead th.pv-col { text-align: right; white-space: nowrap; }
@media (max-width: 1100px) {
    .rank-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .rank-grid { grid-template-columns: 1fr; }
    .rank-table .rk-title-small { max-width: 130px; }
    /* —— 短网址页专用 —— */
    .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-head .actions,
    .page-head .page-tools { width: 100%; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar > * { flex: 1 1 100%; }
    /* 表格设最小宽度,窄屏改横向滚动,避免列被压扁重叠 */
    .table-scroll .dwz-table { min-width: 760px; }
}

/* ============================================================
   日志中心: tab + panel
   ============================================================ */
#logTabs { display: flex; gap: 4px; }
#logTabs .tab {
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-sub);
    border-radius: 8px 8px 0 0;
    border-bottom: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}
#logTabs .tab:hover { color: var(--color-primary); }
#logTabs .tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.log-panel { margin-top: 0; border-top-left-radius: 0; }
.log-panel .pager { padding: 12px 0 0; border-top: 1px solid var(--color-border); margin-top: 8px; }
.log-panel[hidden] { display: none; }

/* 日志中心双面板:固定列宽 + UA 列单行截断,杜绝"列间距不合理 / 列表间隙很大" */
.log-table-fixed { table-layout: fixed; }
.log-table-fixed th,
.log-table-fixed td {
    padding: 8px 10px;
    font-size: 13px;
    vertical-align: top;
}
.log-table-fixed th {
    font-size: 12px;
    white-space: nowrap;
    background: #FAFBFC;
}
.log-table-fixed td code { font-size: 12px; word-break: break-all; }
.log-table-fixed td.ellipsis {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.log-table-fixed td.ua {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px;
    color: #475569;
}
.log-panel .actions.row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 0 0;
}
.log-panel .actions.row .inline-form { margin: 0; }
.log-panel .actions.row .hint {
    font-size: 12px; color: #94A3B8;
}

/* ============================================================
   短网址列表: 紧凑列宽 + 统计胶囊 + 目标地址可点击 + 短链单行布局
   ============================================================ */
.dwz-table { table-layout: fixed; width: 100%; }
/* 全局兜底:任何单元格内容都不得溢出固定列宽,确保 .table-scroll 不出现横向滚动条 */
.dwz-table th,
.dwz-table td { overflow: hidden; padding: 9px 8px; }
.dwz-table th:first-child,
.dwz-table td:first-child { padding-left: 10px; padding-right: 2px; text-align: center; }
/* 表头允许换行(覆盖全局 nowrap),否则长表头会撑出横向滚动条 */
.dwz-table thead th {
    font-size: 12px;
    white-space: normal;
    line-height: 1.35;
    word-break: keep-all;
}
.dwz-table thead th .th-sub {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--color-muted);
    letter-spacing: 0;
    margin-top: 1px;
}
/* 统计列:内容超出时裁剪,绝不撑宽表格 */
.dwz-table .stat-cell { overflow: hidden; }
.dwz-table .stat-pill {
    display: inline-block;
    max-width: 100%;
    background: #F1F5F9;
    color: #0F172A;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.dwz-table tbody tr:hover .stat-pill { background: #E0E7FF; color: var(--color-primary); }
.dwz-table .target-url {
    color: var(--color-sub);
    text-decoration: none;
    display: block;
    max-width: 100%;
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dwz-table .target-url:hover { color: var(--color-primary); text-decoration: underline; }

/* 短链单元格: flex + 单行 + 长短链自动 ellipsis */
.dwz-table .url-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}
/* v1.3.0: 由 1 1 auto 改为 0 1 auto —— 文本不再抢占剩余空间,
   短链较短时复制按钮紧跟文本右侧, 长链时仍可收缩并 ellipsis */
.dwz-table .url-cell .url-text {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-sub);
    text-decoration: none;
    cursor: pointer;
}
.dwz-table .url-cell .url-text:hover { color: var(--color-primary); text-decoration: underline; }
.dwz-table .url-cell .url-text strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* 复制图标按钮 */
.copy-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.copy-icon-btn:hover { background: #F1F5F9; color: var(--color-primary); }
.copy-icon-btn:active { background: #E2E8F0; }
.copy-icon-btn .ic-check { display: none; }
.copy-icon-btn svg { width: 14px; height: 14px; }
.copy-icon-btn.is-copied { background: #D1FAE5; color: #059669; }
.copy-icon-btn.is-copied .ic-copy { display: none; }
.copy-icon-btn.is-copied .ic-check { display: inline-flex; }

/* 操作列:裁剪兜底(绝不撑宽表格);单个链接 nowrap 不被拦腰截断,窄屏整组自动换行 */
.dwz-table .op-cell {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 6px;
    padding-right: 6px;
}
.dwz-table .op-cell .op {
    display: inline-block;
    white-space: nowrap;
    padding: 0;
    margin: 0 8px 0 0;
    font-size: 12px;
    line-height: 1.8;
}
.dwz-table .op-cell .op:last-child { margin-right: 0; }
/* 创建时间列:允许在空格处换行,避免长日期把固定列宽撑破
   v1.3.0: 第 5 列插入"存活状态"后, 创建时间由第 9 列后移到第 10 列 */
.dwz-table td:nth-child(10) { white-space: normal; font-size: 12px; }
.dwz-table .switch { margin: 0; }

/* ============================================================
   v1.3.0 链接存活检测: 状态徽标 / 侧栏红点 / 异常 KPI / 提示条
   ============================================================ */

/* —— 左侧菜单红色角标(异常链接数) —— */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 9px;
    background: #EF4444;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    flex: 0 0 auto;
}
.nav-badge[hidden] { display: none; }

/* —— 存活状态徽标 —— */
.link-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
    max-width: 100%;
}
.link-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
.link-badge .txt { overflow: hidden; text-overflow: ellipsis; }
.link-badge.is-ok       { background: #ECFDF5; border-color: #A7F3D0; color: #059669; }
.link-badge.is-broken   { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }
.link-badge.is-unknown  { background: #F8FAFC; border-color: var(--color-border); color: #94A3B8; }
.link-badge.is-checking { background: #EEF2FF; border-color: #C7D2FE; color: var(--color-primary); }
.link-badge.is-checking .dot { animation: ylb-blink 0.9s ease-in-out infinite; }
@keyframes ylb-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.dwz-table .check-cell { white-space: nowrap; }
.dwz-table .check-cell .check-meta {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}
.dwz-table .op-cell .op.check .op-ic { display: none; }
.dwz-table .op-cell .op.is-busy { opacity: 0.5; pointer-events: none; }

/* —— 页头"当前异常链接有 X 个" —— */
.broken-tip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 1px 9px;
    border-radius: 999px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    font-size: 12px;
}
.broken-tip strong { font-weight: 700; }
.broken-tip.is-clear {
    background: #F8FAFC;
    border-color: var(--color-border);
    color: var(--color-muted);
}

/* —— 仪表盘"异常链接"KPI 卡 —— */
.kpi-card.kpi-broken.is-alert {
    border-color: #FECACA;
    background: linear-gradient(180deg, #FFF8F8 0%, #FFFFFF 62%);
}
.kpi-card.kpi-broken.is-alert .kpi-value { color: #DC2626; }
.kpi-card.kpi-broken .kpi-link { color: #DC2626; text-decoration: none; }
.kpi-card.kpi-broken .kpi-link:hover { text-decoration: underline; }

/* ---------- v1.4.1 仪表盘：异常监测概况（美化版） ---------- */
.card.is-alert { border-color: #FECACA; }
.card.is-alert .card-head h3 { color: #DC2626; }
.monitor-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}
.monitor-stat {
    background: #F8FAFC;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: left;
    transition: transform .15s ease, box-shadow .15s ease;
}
.monitor-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.monitor-stat .monitor-num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.monitor-stat .monitor-label {
    font-size: 13px;
    color: var(--color-muted);
}
.monitor-stat .monitor-label strong {
    color: var(--color-text);
    font-weight: 600;
    margin-left: 2px;
}
.monitor-stat.ok { background: #F0FDF4; border-color: #BBF7D0; }
.monitor-stat.ok .monitor-num { color: #16A34A; }
.monitor-stat.broken { background: #FEF2F2; border-color: #FECACA; }
.monitor-stat.broken .monitor-num { color: #DC2626; }
.monitor-stat.unknown { background: #F1F5F9; border-color: #E2E8F0; }
.monitor-stat.unknown .monitor-num { color: #64748B; }
.monitor-bar-section { margin-bottom: 22px; }
.monitor-bar-label {
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 8px;
}
.monitor-bar-inner {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #E2E8F0;
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.bar-seg { height: 100%; transition: width .4s ease; }
.bar-seg.ok { background: linear-gradient(90deg, #22C55E 0%, #16A34A 100%); }
.bar-seg.broken { background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%); }
.bar-seg.unknown { background: linear-gradient(90deg, #CBD5E1 0%, #94A3B8 100%); }
.monitor-table { margin-top: 0; }
.monitor-table .col-key { width: 90px; }
.monitor-table .col-title { width: 16%; }
.monitor-table .col-url { width: 26%; }
.monitor-table .col-msg { width: 14%; }
.monitor-table .col-time { width: 130px; }
.monitor-table .col-action { width: 70px; text-align: center; }
.monitor-empty {
    padding: 28px;
    text-align: center;
    color: var(--color-success);
    font-size: 14px;
    background: #F0FDF4;
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.monitor-foot {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
@media (max-width: 860px) {
    .monitor-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .monitor-row { grid-template-columns: 1fr; }
}
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #F1F5F9;
    color: var(--color-muted);
}
.status-badge.broken { background: #FEF2F2; color: #DC2626; }
.status-badge.ok { background: #F0FDF4; color: #16A34A; }

/* ---------- v1.3.0 窄屏适配 ---------- */
@media (max-width: 640px) {
    /* 短网址列表新增"存活状态"列后需要更宽的横向滚动区 */
    .table-scroll .dwz-table { min-width: 880px; }
    /* 日志中心两张表在窄屏被压扁重叠, 改为横向滚动 */
    .table-scroll .log-table-fixed { min-width: 720px; }
    /* 近 30 日报表: 固定列宽在窄屏会挤压数字, 同样给最小宽度 */
    .table-scroll .report-table { min-width: 460px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-card { padding: 14px; }
    .kpi-value { font-size: 22px; }
    .page-head .page-tools { display: flex; gap: 8px; }
    .page-head .page-tools .btn { flex: 1 1 auto; justify-content: center; }
    .broken-tip { margin-left: 0; margin-top: 6px; }
}

/* ---------- v1.4.0 告警通知页：全部左对齐 ---------- */
.notify-page .form-divider {
    justify-content: flex-start;
    gap: 0;
    color: var(--color-text);
    font-size: 14px;
    margin: 22px 0 10px;
}
.notify-page .form-divider::before,
.notify-page .form-divider::after {
    display: none;
}
.notify-page .switch-row {
    display: block !important;
    text-align: left;
    margin: 10px 0;
}
.notify-page .switch-row input[type="checkbox"] {
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 8px 0 0;
    width: auto;
}
.notify-page .switch-row span {
    display: inline !important;
    vertical-align: middle;
    white-space: normal;
    word-break: break-all;
}
.notify-page .actions {
    justify-content: flex-start !important;
    text-align: left;
    margin-left: 0;
    padding-left: 0;
}
.notify-page .actions .btn {
    margin-left: 0;
}
.notify-page .kv-table th {
    width: 80px;
    text-align: left;
    white-space: nowrap;
}
.notify-page .kv-table td {
    text-align: left;
}
.notify-page .data-table th,
.notify-page .data-table td {
    text-align: left;
}
.notify-page .hint {
    text-align: left;
}
