/* ============================================================
   common.css - 全局样式 + 暗黑主题
   ============================================================ */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: #e63946;
    text-decoration: none;
}
a:hover {
    color: #ff6b7a;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: #3d3d4a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e63946;
}

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

/* ---------- 页面标题 ---------- */
.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

/* ---------- 卡片 ---------- */
.card {
    background: #2d2d3a;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #3d3d4a;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

/* ---------- 统计条 ---------- */
.stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: #2d2d3a;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 16px;
    border: 1px solid #3d3d4a;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

.stat-number {
    color: #ffffff;
    font-weight: 700;
    font-size: 20px;
}

/* ---------- 工具栏 ---------- */
.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-state .title {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 8px;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    gap: 6px;
}

.btn-primary {
    background: #e63946;
    color: #fff;
}
.btn-primary:hover {
    background: #c1121f;
    transform: translateY(-1px);
}

.btn-success {
    background: #2ecc71;
    color: #fff;
}
.btn-success:hover {
    background: #1ea85a;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}
.btn-warning:hover {
    background: #d68910;
}

.btn-outline {
    background: transparent;
    color: #adb5bd;
    border: 1px solid #3d3d4a;
}
.btn-outline:hover {
    background: #3d3d4a;
    color: #fff;
}

.btn-link {
    background: transparent;
    color: #e63946;
    padding: 4px 8px;
}
.btn-link:hover {
    color: #ff6b7a;
    text-decoration: underline;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}
.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

.form-label {
    display: block;
    color: #adb5bd;
    font-size: 14px;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #1a1a2e;
    border: 1px solid #3d3d4a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: #e63946;
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2);
}
.form-control::placeholder {
    color: #6c757d;
}
.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* ---------- 表格 ---------- */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #3d3d4a;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d3a;
    border-radius: 12px;
}

table th {
    background: #1a1a2e;
    color: #adb5bd;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #3d3d4a;
}

table td {
    padding: 10px 16px;
    border-bottom: 1px solid #3d3d4a;
    color: #ffffff;
    font-size: 14px;
    vertical-align: middle;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: rgba(230, 57, 70, 0.05);
}

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}
.tag-danger {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}
.tag-warning {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}
.tag-info {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}
.tag-primary {
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
}
.tag-muted {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 14px;
    background: #2d2d3a;
    border: 1px solid #3d3d4a;
    border-radius: 6px;
    color: #adb5bd;
    cursor: pointer;
    transition: all 0.3s;
}
.pagination button:hover {
    background: #3d3d4a;
    color: #fff;
}
.pagination button.active {
    background: #e63946;
    color: #fff;
    border-color: #e63946;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .page-title {
        font-size: 20px;
    }
    .card {
        padding: 16px;
    }
    .stats-bar {
        padding: 12px 16px;
        gap: 12px;
    }
    .stat-number {
        font-size: 18px;
    }
    table th,
    table td {
        padding: 8px 12px;
        font-size: 13px;
    }
    .btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    .card {
        padding: 12px;
        border-radius: 12px;
    }
    .stats-bar {
        flex-direction: column;
        gap: 6px;
    }
    .stat-item {
        justify-content: space-between;
    }
    table th,
    table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .toolbar {
        flex-direction: column;
    }
}
/* ===== 快捷指令栏 ===== */
.quick-commands {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    background: #16213e;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #0f3460;
}

.quick-label {
    color: #adb5bd;
    font-size: 13px;
    font-weight: 500;
}

.quick-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #0f3460;
    color: #64b5f6;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-tag:hover {
    background: #1a4a7a;
    border-color: #e94560;
    color: #fff;
}

.quick-tag:active {
    transform: scale(0.95);
}