/* ============================================================
   授权管理系统 - 全局样式
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: #409eff;
    text-decoration: none;
}

a:hover {
    color: #66b1ff;
}

/* 布局 */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    color: #303133;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-name {
    color: #606266;
    font-size: 14px;
}

.main-container {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 200px;
    background: #304156;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

.sidebar nav {
    padding: 8px 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bfcbd9;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar a:hover {
    background: #263445;
    color: #fff;
}

.sidebar a.active {
    background: #409eff;
    color: #fff;
}

.nav-icon {
    margin-right: 8px;
    font-size: 16px;
}

.content {
    flex: 1;
    margin-left: 200px;
    padding: 24px;
    background: #f5f7fa;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    color: #606266;
    outline: none;
    gap: 4px;
}

.btn:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background: #ecf5ff;
}

.btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
    color: #fff;
}

.btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
}

.btn-danger {
    background: #f56c6c;
    border-color: #f56c6c;
    color: #fff;
}

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

.btn-warning {
    background: #e6a23c;
    border-color: #e6a23c;
    color: #fff;
}

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

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

.btn-outline {
    background: transparent;
}

/* 表格 */
.table-wrapper {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: #909399;
    font-size: 13px;
}

tr:hover {
    background: #f5f7fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #606266;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
    color: #606266;
}

.form-control:focus {
    border-color: #409eff;
}

select.form-control {
    height: 36px;
}

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

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    line-height: 20px;
}

.tag-success {
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.tag-danger {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

.tag-warning {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #faecd8;
}

.tag-info {
    background: #f4f4f5;
    color: #909399;
    border: 1px solid #e9e9eb;
}

.tag-primary {
    background: #ecf5ff;
    color: #409eff;
    border: 1px solid #d9ecff;
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    color: #303133;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #909399;
    padding: 4px;
}

.modal-close:hover {
    color: #606266;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #ebeef5;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    width: 240px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.pagination-info {
    color: #909399;
    font-size: 13px;
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-buttons .btn {
    min-width: 32px;
    padding: 4px 8px;
}

.pagination-buttons .btn.active {
    background: #409eff;
    color: #fff;
    border-color: #409eff;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebeef5;
}

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

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 400px;
    max-width: 90vw;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 32px;
    color: #303133;
    font-size: 24px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-error {
    background: #fef0f0;
    color: #f56c6c;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* Tab 切换 */
.tabs {
    display: flex;
    border-bottom: 2px solid #e4e7ed;
    margin-bottom: 16px;
}

.tab-item {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #909399;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-item:hover {
    color: #409eff;
}

.tab-item.active {
    color: #409eff;
    border-bottom-color: #409eff;
}

/* 差异项 */
.diff-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diff-item:hover {
    background: #f5f7fa;
}

.diff-path {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.diff-type {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}

.diff-added { background: #f0f9eb; color: #67c23a; }
.diff-modified { background: #ecf5ff; color: #409eff; }
.diff-deleted { background: #fef0f0; color: #f56c6c; }
.diff-confirm { background: #fdf6ec; color: #e6a23c; }
.diff-rename { background: #fdf6ec; color: #e6a23c; }

/* 上传区域 */
.upload-area {
    border: 2px dashed #dcdfe6;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #409eff;
    background: #ecf5ff;
}

.upload-area p {
    color: #909399;
    margin-top: 8px;
}

/* 统计 */
.stat-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.stat-item {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px;
    color: #909399;
}

.empty-state p {
    margin-top: 8px;
}

/* 加载 */
.loading {
    text-align: center;
    padding: 40px;
    color: #909399;
}
