/* 商家账户管理系统样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.login-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* 导航栏 */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-brand {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex: 1;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: #667eea;
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.role-badge.admin {
    background: #ff6b6b;
    color: white;
}

.role-badge.user {
    background: #51cf66;
    color: white;
}

.btn-logout {
    color: #666;
    text-decoration: none;
    padding: 6px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #f5f5f5;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 闪现消息 */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.flash.error {
    background: #ffe0e0;
    color: #c00;
    border-left: 4px solid #c00;
}

.flash.success {
    background: #e0ffe0;
    color: #0a0;
    border-left: 4px solid #0a0;
}

.flash.info {
    background: #e0f0ff;
    color: #06c;
    border-left: 4px solid #06c;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: 1px solid #d9dde7;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #fff;
    color: #4a5568;
}

.btn:hover {
    background: #f8f9fc;
    border-color: #c7cfdd;
}

.btn-primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.btn-success {
    background: #51cf66;
    color: white;
    border-color: #51cf66;
}

.btn-success:hover {
    background: #40c057;
    border-color: #40c057;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.btn-danger:hover {
    background: #fa5252;
    border-color: #fa5252;
}

.btn-block {
    width: 100%;
}

/* 仪表盘 */
.dashboard h2 {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-card.success {
    border-left-color: #51cf66;
}

.stat-card.danger {
    border-left-color: #ff6b6b;
}

.stat-card.warning {
    border-left-color: #ffa94d;
}

.stat-card.info {
    border-left-color: #339af0;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #999;
    margin-top: 10px;
}

/* 表格 */
.table-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

.data-table thead {
    background: #f8f9fa;
    position: relative;
    z-index: 10;
}

.data-table th, .data-table td {
    padding: 10px 12px;
    white-space: nowrap;
    max-width: 200px;
}

.data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th {
    overflow: visible;
}
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th {
    font-weight: 600;
    color: #666;
}

.data-table tbody tr:hover {
    background: #f0f0f0;
}

/* 行状态颜色 */
.data-table tbody tr.row-pending {
    background: #fffdf0;
}
.data-table tbody tr.row-success {
    background: #f0faf2;
}
.data-table tbody tr.row-failed {
    background: #fef0f0;
}
.data-table tbody tr.row-rejected {
    background: #fdf0f4;
}
.data-table tbody tr.row-approved {
    background: #f0f6fe;
}
.data-table tbody tr.row-pending:hover {
    background: #fef9e0;
}
.data-table tbody tr.row-success:hover {
    background: #e0f5e6;
}
.data-table tbody tr.row-failed:hover {
    background: #fde0e0;
}
.data-table tbody tr.row-rejected:hover {
    background: #fce0ea;
}
.data-table tbody tr.row-approved:hover {
    background: #e0ecfc;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
    border-color: #ffe69c;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.status-badge.not_started {
    background: #e7f3ff;
    color: #004085;
    border-color: #b8daff;
}

.status-badge.processing {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.status-badge.blocked_cookie {
    background: #fff3cd;
    color: #856404;
    border-color: #ffe69c;
}

.status-badge:not([class*=" "]) {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

/* 空状态 */
.empty-text {
    text-align: center;
    color: #999;
    padding: 40px;
    background: white;
    border-radius: 10px;
}

/* 最近记录区域 */
.recent-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recent-section h3 {
    margin-bottom: 20px;
}

/* 表单页面 */
.form-page h2 {
    margin-bottom: 20px;
}

.config-info {
    background: #f8f9fc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.config-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.form-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 600px;
}

.form-card h3 {
    margin-bottom: 10px;
}

.hint {
    color: #999;
    font-size: 13px;
    margin-bottom: 20px;
}

.config-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.required {
    color: #ff6b6b;
}

/* 列表页面 */
.list-page h2 {
    margin-bottom: 20px;
}

.filter-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.filter-panel > * + * {
    margin-top: 14px;
}

.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group + .filter-group {
    margin-top: 12px;
}

.filter-group-label {
    min-width: 72px;
    padding-top: 8px;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar .btn {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.filter-bar .btn.btn-primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.action-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.inline-actions .btn {
    white-space: nowrap;
}

.toolbar-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex-wrap: nowrap;
}

.toolbar-split .search-inline {
    flex: 1 1 auto;
    min-width: 0;
}

.toolbar-split .search-inline input[type="text"] {
    width: 100%;
    min-width: 180px;
}

.toolbar-split .batch-actions {
    flex-shrink: 0;
}

.toolbar-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 16px;
    margin-bottom: 16px;
}

/* 小按钮 */
.btn-warning {
    background: #ffa94d;
    color: white;
    border-color: #ffa94d;
}

.btn-warning:hover {
    background: #ff922b;
    border-color: #ff922b;
}

.btn-secondary {
    background: #868e96;
    color: white;
    border-color: #868e96;
}

.btn-secondary:hover {
    background: #6c757d;
    border-color: #6c757d;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
}

.page-info {
    color: #666;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 详情文本 */
.detail-text {
    font-size: 12px;
    color: #666;
}

.detail-text.error {
    color: #c00;
}

.detail-text.success {
    color: #0a0;
}

/* 导入结果 */
.import-results h3 {
    margin-bottom: 10px;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

/* 导出按钮区域 */
.export-bar {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
    margin-top: 20px;
}

.tab-content.active {
    display: block;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.search-bar input[type="text"] {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: nowrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.search-inline {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.search-inline input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 160px;
    max-width: 260px;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .search-inline {
        flex-wrap: nowrap;
    }
}

.search-inline.no-wrap {
    flex-wrap: nowrap;
    width: 100%;
}

.search-inline.no-wrap input[type="text"] {
    flex: 1 1 auto;
    min-width: 220px;
}

.search-inline.no-wrap .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    z-index: 100;
}

.filter-trigger {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: white;
    border: 1px solid #d9dde7;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 1000;
    display: none;
}

.filter-dropdown.show {
    display: block;
}

.filter-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 13px;
    text-align: left;
}

.filter-option:hover,
.filter-option.active {
    background: #f3f6ff;
    color: #667eea;
}

/* 分页栏 */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.per-page-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.pagination-btns {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-ellipsis {
    padding: 4px 8px;
    color: #999;
}
