/* 独享节点管理面板 - 样式 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* 导航栏 */
.navbar {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.navbar h1 { font-size: 18px; font-weight: 600; }
.navbar a { color: rgba(255,255,255,0.85); text-decoration: none; margin-left: 0; font-size: 14px; white-space: nowrap; }
.navbar a:hover { color: #fff; }
.navbar .nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 14px; row-gap: 8px; flex-wrap: wrap; }
.navbar .admin-email { font-size: 13px; color: rgba(255,255,255,0.7); }

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h2 { font-size: 18px; margin-bottom: 16px; color: var(--text); }

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th { background: #f1f5f9; font-weight: 600; color: var(--text-muted); font-size: 13px; text-transform: uppercase; }
tr:hover { background: #f8fafc; }
td { vertical-align: middle; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    line-height: 1.5;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn + .btn { margin-left: 6px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }

/* 状态 */
.status-enabled { color: var(--success); font-weight: 600; }
.status-disabled { color: var(--danger); font-weight: 600; }
.status-expired { color: var(--text-muted); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-muted);
    margin: 1px 2px;
}
.badge-danger { background: #fef2f2; color: var(--danger); }
.badge-warning { background: #fffbeb; color: var(--warning); }
.badge-info { background: #eff6ff; color: var(--info); }
.badge-success { background: #f0fdf4; color: var(--success); }
.badge-primary { background: #eef2ff; color: var(--primary); }

/* 消息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 14px;
}
.pagination a {
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.pagination a:hover { background: #f1f5f9; }
.pagination span { color: var(--text-muted); }

/* 登录页 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 400px;
    max-width: 90%;
}
.login-box h1 { text-align: center; margin-bottom: 8px; font-size: 22px; }
.login-box p { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-box .btn { width: 100%; padding: 10px; font-size: 15px; }

/* 详情信息 */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.detail-item { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.detail-label { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 15px; font-weight: 500; }

/* 操作栏 */
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}
.search-bar .form-group { flex: 1; margin-bottom: 0; }
.search-bar .btn { height: 38px; }

/* checkbox 组 */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-group label { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 400; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: auto; }

/* 返回链接 */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}
.back-link:hover { text-decoration: underline; }

/* 进度条（流量） */
.traffic-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.traffic-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.traffic-low { background: var(--success); }
.traffic-medium { background: var(--warning); }
.traffic-high { background: var(--danger); }

/* 批量操作工具栏 */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.batch-select-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.batch-select-all input { width: auto; }
.batch-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: auto;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-bar .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
.filter-bar .btn { height: 38px; }

/* 卡片标题行 */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header-row h2 { margin-bottom: 0; }

/* 复选框表格 */
table input[type="checkbox"] { width: auto; cursor: pointer; }

/* 内联复选框 */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.checkbox-inline input { width: auto; }

/* 小文字辅助 */
.text-muted { color: var(--text-muted); }
small { font-size: 12px; }

/* 导航栏高亮 */
.navbar a.active { color: #fff; font-weight: 600; }

/* 审计日志展示 */
.audit-action-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}
.audit-action-code {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    word-break: break-all;
}
.audit-summary {
    max-width: 420px;
    white-space: normal;
}
.audit-summary ul {
    margin: 0;
    padding-left: 18px;
}
.audit-summary li { margin: 2px 0; }
.audit-payload {
    margin-top: 8px;
    font-size: 12px;
}
.audit-payload summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}
.audit-payload-section {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
}
.audit-payload pre {
    margin-top: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.5;
}
.audit-context {
    margin: -4px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}
.audit-mini-summary {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 360px;
    white-space: normal;
}
.table-responsive { overflow-x: auto; }

@media (max-width: 900px) {
    .container { padding: 16px; }
    .navbar { align-items: flex-start; }
    .navbar .nav-links { width: 100%; justify-content: flex-start; }
    .card-header-row { align-items: flex-start; flex-direction: column; gap: 10px; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar .btn { height: auto; }
}
