/* ============================================
   QQ频道管理中心 - 全局样式 (暗黑游戏风)
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --danger: #f85149;
    --danger-hover: #ff6b63;
    --success: #3fb950;
    --warning: #d29922;
    --purple: #a371f7;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ======== 导航栏 ======== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    color: var(--text-secondary);
    font-size: 14px;
}

.nav-user small {
    color: var(--accent);
    margin-left: 4px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.nav-logout {
    color: var(--danger);
}

.nav-logout:hover { background: rgba(248,81,73,0.1); }

/* ======== 布局：侧边栏 + 内容区 ======== */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover,
.sidebar-item.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
    border-left-color: var(--accent);
}

.content-wrapper {
    margin-left: 200px;
    padding: 24px 32px;
    min-height: calc(100vh - 56px);
    max-width: 1200px;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .content-wrapper {
        margin-left: 0;
        padding: 16px;
    }
}

/* ======== 主容器 (旧版兼容) ======== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ======== 登录页 ======== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90vw;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 22px;
    color: var(--accent);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 32px;
}

/* ======== 表单 ======== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ======== 按钮 ======== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover { opacity: 0.9; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: var(--danger-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* ======== 卡片 ======== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    color: var(--accent);
}

/* ======== 统计卡片组 ======== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ======== 表格 ======== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table th {
    color: var(--text-secondary);
    font-weight: 600;
    background: rgba(255,255,255,0.02);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ======== 徽章 ======== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--warning); }
.badge-danger  { background: rgba(248,81,73,0.15); color: var(--danger); }
.badge-info    { background: rgba(88,166,255,0.15); color: var(--accent); }
.badge-purple  { background: rgba(163,113,247,0.15); color: var(--purple); }

/* ======== 空状态 ======== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state p { margin-bottom: 16px; }

/* ======== 闪存消息 ======== */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.flash-green { background: rgba(63,185,80,0.1); color: var(--success); border: 1px solid rgba(63,185,80,0.2); }
.flash-red   { background: rgba(248,81,73,0.1); color: var(--danger); border: 1px solid rgba(248,81,73,0.2); }
.flash-blue  { background: rgba(88,166,255,0.1); color: var(--accent); border: 1px solid rgba(88,166,255,0.2); }

/* ======== 分页提示 ======== */
.page-hint {
    background: rgba(88,166,255,0.05);
    border: 1px solid rgba(88,166,255,0.15);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ======== 双列布局 ======== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }
    .nav-user { display: none; }
    table th, table td { padding: 8px; font-size: 12px; }
}

/* ======== 操作按钮组 ======== */
.action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ======== 模态框简易版 ======== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin-bottom: 20px;
    color: var(--accent);
}

/* ======== 提示信息 ======== */
.info-tip {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

/* ======== 部门管理树状列表 ======== */
.dept-tree-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.dept-tree-item:hover {
    border-color: var(--accent);
}

.dept-tree-item.sub {
    margin-left: 24px;
    border-left: 3px solid var(--accent);
}

.dept-tree-item .dept-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.dept-tree-item .dept-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dept-tree-item .dept-name {
    font-size: 16px;
    font-weight: 600;
}

.dept-tree-item .dept-sub-list {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ======== 强制离职警告区 ======== */
.resign-warning {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.25);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--danger);
}

.resign-warning ul {
    padding-left: 20px;
    margin-top: 8px;
}

/* ======== 模态框长内容滚动 ======== */
.modal-box {
    max-height: 85vh;
    overflow-y: auto;
}

/* ======== 审批链条 ======== */
.approval-chain {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.approval-chain-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
}

.approval-chain-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.approval-chain-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.4;
}

.approval-chain-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.approval-chain-arrow {
    color: var(--border);
    font-size: 18px;
    line-height: 1;
}

/* ======== 流程步骤条 ======== */
.flow-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.flow-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.flow-step.active .flow-step-dot {
    background: var(--accent);
    color: #fff;
}

.flow-step.done .flow-step-dot {
    background: var(--success);
    color: #fff;
}

.flow-step-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.flow-step.active .flow-step-text {
    color: var(--accent);
    font-weight: 600;
}

.flow-step.done .flow-step-text {
    color: var(--success);
}

.flow-step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 4px;
}

.flow-step.done + .flow-step-line,
.flow-step-line.done {
    background: var(--success);
}

/* ======== 通知组件 ======== */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    position: relative;
    top: -1px;
    margin-left: 4px;
}

.notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.notif-item:hover {
    background: rgba(255,255,255,0.02);
}

.notif-item.unread {
    background: rgba(88,166,255,0.04);
    border-left: 3px solid var(--accent);
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-dot.info    { background: var(--accent); }
.notif-dot.success { background: var(--success); }
.notif-dot.warning { background: var(--warning); }
.notif-dot.error   { background: var(--danger); }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.notif-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ======== 用户头像 ======== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-avatar.sm {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.user-avatar.lg {
    width: 56px;
    height: 56px;
    font-size: 22px;
}

/* ======== 个人资料卡片 ======== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-info h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 13px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .profile-grid { grid-template-columns: 1fr; }
}

.profile-field {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.profile-field-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-field-value {
    font-size: 14px;
    font-weight: 500;
}

/* ======== 标签页导航 ======== */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-nav a {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-nav a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

.tab-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ======== 侧边栏图标指示 ======== */
.sidebar-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.sidebar-icon.ic-home  { background: rgba(88,166,255,0.15); color: var(--accent); }
.sidebar-icon.ic-user  { background: rgba(163,113,247,0.15); color: var(--purple); }
.sidebar-icon.ic-dept  { background: rgba(63,185,80,0.15);  color: var(--success); }
.sidebar-icon.ic-app   { background: rgba(210,153,34,0.15); color: var(--warning); }
.sidebar-icon.ic-api   { background: rgba(248,81,73,0.15);  color: var(--danger); }
.sidebar-icon.ic-add   { background: rgba(88,166,255,0.15); color: var(--accent); }
.sidebar-icon.ic-up    { background: rgba(63,185,80,0.15);  color: var(--success); }
.sidebar-icon.ic-out   { background: rgba(248,81,73,0.15);  color: var(--danger); }
.sidebar-icon.ic-bell  { background: rgba(210,153,34,0.15); color: var(--warning); }
.sidebar-icon.ic-log   { background: rgba(88,166,255,0.12); color: var(--accent); }
.sidebar-icon.ic-me    { background: rgba(163,113,247,0.15); color: var(--purple); }

/* ======== 分割线 ======== */
.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px;
}

/* ======== 页面标题 ======== */
.page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ======== 内容区间距优化 ======== */
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
