/* 广告管理后台样式：浅色卡片风，一眼能看出每块配置对应哪个接口 */

:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --line: #e3e8f2;
    --text: #1d2433;
    --muted: #6c7891;
    --brand: #2f6df6;
    --brand-deep: #1c4fd0;
    --ok: #17a673;
    --shadow: 0 6px 20px rgba(29, 36, 51, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 0 40px;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

/* 顶部栏 */
.topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: #101423;
    color: #fff;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 1px;
}

.topbar .sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: #9aa6c0;
}

.status {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #b8c2da;
}

main {
    max-width: 1240px;
    margin: 22px auto 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 卡片 */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px 20px;
    flex: 1 1 0;
    min-width: 320px;
}

.card-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.card-head h2 {
    margin: 0;
    font-size: 15px;
}

.api {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    color: var(--brand-deep);
    background: #eef3ff;
    border: 1px solid #d8e3ff;
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}

.hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* 表单行 */
.rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.row:hover {
    background: #f7f9ff;
}

.row > span {
    flex: 1 1 auto;
}

.row em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
    min-width: 18px;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    cursor: pointer;
}

.num,
.text {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
}

.num {
    width: 76px;
    text-align: right;
}

.text {
    flex: 1 1 auto;
    min-width: 200px;
    font-family: Consolas, "Courier New", monospace;
}

.num:focus,
.text:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

/* 按钮 */
button {
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.save {
    background: var(--brand);
    color: #fff;
}

.save:hover {
    background: var(--brand-deep);
}

.ghost {
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card .ghost {
    background: #f0f3fa;
    color: var(--text);
    border: 1px solid var(--line);
}

.card-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.tip {
    font-size: 12px;
    color: var(--ok);
    min-height: 18px;
}

.tip.fail {
    color: #e5484d;
}

/* 事件日志 */
.log-wrap {
    max-height: 260px;
    overflow: auto;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table.log {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

table.log th,
table.log td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f3fa;
    vertical-align: top;
}

table.log th {
    background: #f7f9ff;
    color: var(--muted);
    font-weight: normal;
    position: sticky;
    top: 0;
}

table.log td.empty {
    color: var(--muted);
    text-align: center;
    padding: 18px;
}

/* 配置预览 */
pre.code {
    margin: 12px 0 0;
    max-height: 260px;
    overflow: auto;
    padding: 12px 14px;
    background: #0f1526;
    color: #b7e5c4;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .card-row {
        flex-direction: column;
    }
}
