/* assets/css/components.css 通用业务UI组件，多页面复用 */

/* 消息提示框：操作成功/提示 */
.msg {
    padding:10px;
    background:#ecfbe8;
    border-radius:6px;
    margin-bottom:12px;
}

/* 分页容器 */
.page-box {
    margin-top:15px;
    text-align:center;
}
.page-box a {
    margin:0 4px;
    padding:4px 8px;
    border:1px solid var(--color-primary);
    border-radius:4px;
    text-decoration:none;
    color:var(--color-primary);
}
.page-box a.current {
    background:var(--color-primary);
    color:#fff;
}

/* 删除按钮链接 */
.del-btn {
    color:#f5222d;
    text-decoration:none;
}

/* 通用数据表格，history / admin_list / sys_log / visit_log 全部共用 */
.table-default {
    width:100%;
    border-collapse:collapse;
    table-layout: fixed;
}
.table-default th,
.table-default td {
    border:1px solid #eee;
    padding:8px 6px;
    font-size:14px;
    text-align:center;
}
.table-default th {
    background:#f5f9ff;
}
/* 油价变更高亮行（history页面） */
.table-default tr.change-row {
    background-color:#e6f4ff;
}
.table-default td.wrap {
    word-break: break-all;
    white-space: normal;
}

/* 日志表格外层滚动容器，限制宽度，长内容内部横向滚动，不撑开card */
.table-wrap {
    width:100%;
    overflow-x:auto;
}
.table-default td {
    word-break: break-all;
    white-space: normal;
}


/* 后台三列网格表单 */
.form-grid {
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:12px;
    align-items:center;
}
.form-grid > div {
    margin:4px 0;
}
.form-grid input {
    padding:4px;
    font-size:14px;
}

/* 只新增UA长文本自动换行，其余全部保留你原来写的样式 */
.ua-col{
    word-break: break-all;
    white-space: normal;
}

.table-block { width: 100%; }
.table-wrap { width:100%; overflow-x:auto; }
.table-default td.ua-col {
    word-break: break-all;
    white-space: normal;
    text-align: left;   /* UA 长文本左对齐更美观，可选 */
}


/* ==== 历史卡片专属公共样式 ==== */
.history-list { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.history-card { background: #fcfcfc; border-radius: 8px; padding: 20px; border: 1px solid #eee; display: flex; justify-content: space-between; gap: 20px; }
.history-card .card-left { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.history-card .card-title { font-size: 16px; font-weight: bold; padding: 6px 16px; border-radius: 6px; display: inline-block; white-space: nowrap; align-self: flex-start; margin-bottom: 15px; cursor: help; color: #fff; }
.history-card .card-content { font-size: 14px; color: #333; line-height: 1.6; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.history-card .card-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; min-width: 240px; }
.history-card .card-meta { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 15px; }
.history-card .card-time { font-size: 13px; color: #888; white-space: nowrap; }
.history-card .btn-group { display: flex; gap: 8px; }
.history-card .btn-sm { padding: 5px 12px; border-radius: 4px; font-size: 13px; text-decoration: none; color: #fff; transition: 0.2s; border: none; cursor: pointer; white-space: nowrap; }
.history-card .btn-sm:hover { opacity: 0.85; }
.history-card .btn-info { background: #17a2b8; }
.history-card .btn-edit { background: #007bff; }
.history-card .btn-del  { background: #dc3545; }
.history-card .card-img-preview { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid #ddd; object-fit: cover; cursor: pointer; transition: transform 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.history-card .card-img-preview:hover { transform: scale(1.05); }

@media (max-width: 768px) {
    .history-card { flex-direction: column; }
    .history-card .card-right { align-items: flex-start; min-width: 100%; margin-top: 10px; }
    .history-card .card-meta { justify-content: flex-start; }
    .history-card .card-img-preview { max-width: 100%; max-height: 200px; margin-top: 10px; }
}