/* ========== 全局变量 & 重置 ========== */
:root {
    --primary: #1a2b5c;        /* 深蓝 - 主色 */
    --primary-light: #2c4585;
    --primary-dark: #0f1a3d;
    --accent: #d4a857;          /* 金色 - 点缀色,从LOGO取色 */
    --accent-light: #e8c47a;
    --accent-dark: #b8912f;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --text-1: #1a1a2e;
    --text-2: #4a5568;
    --text-3: #8a94a6;
    --bg-1: #f5f7fb;
    --bg-2: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 2px 6px rgba(26, 43, 92, 0.06);
    --shadow-md: 0 4px 14px rgba(26, 43, 92, 0.08);
    --shadow-lg: 0 8px 28px rgba(26, 43, 92, 0.12);
    --radius: 10px;
    --radius-lg: 14px;
}

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

html, body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-1);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(212, 168, 87, 0.15) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-box {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 50px 60px;
    width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 220px;
    height: auto;
}

.login-title {
    text-align: center;
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 30px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--text-2);
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 43, 92, 0.1);
}

.btn {
    padding: 11px 22px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 13px;
    font-size: 15px;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-1);
    color: var(--primary);
}

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

.login-domain {
    text-align: center;
    margin-top: 20px;
    color: var(--text-3);
    font-size: 12px;
}

.login-domain strong {
    color: var(--accent-dark);
    font-weight: 600;
}

/* ========== 主框架 - 侧边栏 ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.sidebar-logo .name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.sidebar-logo .name small {
    display: block;
    font-size: 11px;
    color: var(--accent-light);
    font-weight: 400;
    margin-top: 2px;
}

.nav-menu {
    padding: 16px 0;
}

.nav-section-title {
    padding: 12px 20px 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.nav-item.active {
    background: rgba(212, 168, 87, 0.15);
    color: var(--accent-light);
    border-left-color: var(--accent);
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ========== 主内容区 ========== */
.main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left h1 {
    font-size: 18px;
    color: var(--text-1);
    font-weight: 600;
}

.topbar-left .breadcrumb {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-action {
    position: relative;
    cursor: pointer;
    color: var(--text-2);
    font-size: 18px;
    padding: 6px;
}

.topbar-action:hover { color: var(--primary); }

.topbar-action .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info .name {
    font-size: 13px;
    color: var(--text-1);
    font-weight: 500;
}

.user-info .role {
    font-size: 11px;
    color: var(--text-3);
}

.content {
    padding: 24px 28px;
    flex: 1;
}

/* ========== 通用组件 ========== */
.card {
    background: var(--bg-2);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: var(--accent);
    opacity: 0.08;
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card.blue::before { background: var(--info); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }

.stat-label {
    color: var(--text-3);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
}

.stat-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-meta .up { color: var(--success); }
.stat-meta .down { color: var(--danger); }

/* 表格 */
.table-wrap {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: var(--bg-1);
}

th {
    padding: 13px 16px;
    text-align: left;
    color: var(--text-2);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
}

tbody tr:hover { background: var(--bg-1); }
tbody tr:last-child td { border-bottom: none; }

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.tag-primary { background: rgba(26, 43, 92, 0.1); color: var(--primary); }
.tag-success { background: rgba(46, 204, 113, 0.12); color: var(--success); }
.tag-warning { background: rgba(243, 156, 18, 0.12); color: var(--warning); }
.tag-danger { background: rgba(231, 76, 60, 0.12); color: var(--danger); }
.tag-info { background: rgba(52, 152, 219, 0.12); color: var(--info); }
.tag-accent { background: rgba(212, 168, 87, 0.18); color: var(--accent-dark); }

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

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

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 240px;
    font-size: 13px;
    background: white;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
}

.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: 13px;
    color: var(--text-1);
}

/* 模态框 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 61, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-mask.active { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal.lg { max-width: 760px; }
.modal.xl { max-width: 1000px; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
}

.modal-close {
    font-size: 22px;
    color: var(--text-3);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--danger); }

.modal-body { padding: 22px; }

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单 - 网格 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

/* ========== 日历 ========== */
.calendar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-1);
}

.calendar-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    padding: 10px;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 500;
}

.calendar-day {
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: white;
    min-height: 80px;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: var(--bg-1);
    border-color: var(--primary-light);
}

.calendar-day.other-month {
    opacity: 0.35;
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--primary);
}

.calendar-day.today .day-num { color: white; }

.calendar-day.selected {
    border: 2px solid var(--accent);
}

.day-num {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-1);
    margin-bottom: 4px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.event-pill {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--accent);
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.event-pill.interview { background: var(--info); }
.event-pill.training { background: var(--success); }
.event-pill.contract { background: var(--accent-dark); }
.event-pill.review { background: var(--warning); }

/* ========== 待办事项 ========== */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.todo-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.todo-item.completed { opacity: 0.5; }
.todo-item.completed .todo-title { text-decoration: line-through; }

.todo-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.todo-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.todo-body {
    flex: 1;
    min-width: 0;
}

.todo-title {
    font-size: 14px;
    color: var(--text-1);
    font-weight: 500;
    margin-bottom: 4px;
}

.todo-meta {
    font-size: 11px;
    color: var(--text-3);
    display: flex;
    gap: 10px;
}

.todo-meta .priority-high { color: var(--danger); font-weight: 500; }
.todo-meta .priority-mid { color: var(--warning); font-weight: 500; }
.todo-meta .priority-low { color: var(--info); font-weight: 500; }

/* ========== 月报 ========== */
.report-cover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 60px 50px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.report-cover::before {
    content: '';
    position: absolute;
    right: -100px;
    top: -100px;
    width: 300px;
    height: 300px;
    background: rgba(212, 168, 87, 0.15);
    border-radius: 50%;
}

.report-cover img {
    height: 50px;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
}

.report-cover h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.report-cover .subtitle {
    font-size: 16px;
    opacity: 0.85;
}

.report-cover .meta {
    margin-top: 24px;
    font-size: 13px;
    opacity: 0.7;
}

/* ========== 空状态 ========== */
.empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-3);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    font-size: 13px;
}

.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
.toast.danger { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar-logo .name { display: none; }
    .nav-item span { display: none; }
    .main { margin-left: 64px; }
    .form-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .calendar-day { min-height: 50px; }
    .day-num { font-size: 12px; }
}