/* ================================================
   毕业生跟踪调查系统 — Apple Style
   ================================================ */

:root {
    --bg: #f5f5f7;
    --sidebar-bg: rgba(255,255,255,.72);
    --card-bg: #fff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --blue: #007AFF;
    --blue-light: rgba(0,122,255,.08);
    --blue-hover: #0066DD;
    --green: #34C759;
    --green-light: rgba(52,199,89,.1);
    --orange: #FF9500;
    --orange-light: rgba(255,149,0,.1);
    --red: #FF3B30;
    --red-light: rgba(255,59,48,.08);
    --gray: #8E8E93;
    --gray-light: rgba(142,142,147,.08);
    --border: #e8e8ed;
    --shadow: 0 2px 16px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.02);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --sidebar-width: 220px;
    --transition: all .2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--blue-hover); }

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

.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-right: 1px solid rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.3px;
}
.sidebar-brand small {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 16px 12px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.nav-item:hover { background: var(--gray-light); }
.nav-item.active {
    background: var(--blue-light);
    color: var(--blue);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--blue);
    border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
}
.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 600; }
.sidebar-user-role { font-size: 11px; color: var(--text-secondary); }
.sidebar-logout {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--red);
    transition: var(--transition);
}
.sidebar-logout:hover { background: var(--red-light); }
.sidebar-actions { display: flex; flex-direction: column; gap: 4px; }
.sidebar-action {
    display: block;
    text-align: center;
    padding: 7px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}
.sidebar-action:hover { background: var(--gray-light); color: var(--text-primary); }

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 36px;
    min-height: 100vh;
}

/* ---- 页面标题 ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- 卡片 ---- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.2px;
}
.card-body { padding: 20px 24px; }
.card-header + .card-body { padding-top: 16px; }

/* ---- 统计卡片 ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}
.stat-value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card.blue .stat-value {
    background: linear-gradient(135deg, var(--blue) 0%, #5AC8FA 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.stat-card.green .stat-value {
    background: linear-gradient(135deg, var(--green) 0%, #30D158 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.stat-card.orange .stat-value {
    background: linear-gradient(135deg, var(--orange) 0%, #FFCC00 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---- 徽章 ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: #1a7a32; }
.badge-orange { background: var(--orange-light); color: #b36a00; }
.badge-red { background: var(--red-light); color: #c62828; }
.badge-gray { background: var(--gray-light); color: var(--gray); }

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,122,255,.3); }
.btn-secondary { background: var(--gray-light); color: var(--text); }
.btn-secondary:hover { background: rgba(142,142,147,.16); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #E6352A; color: #fff; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 16px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 12px; }

/* ---- 表格 ---- */
.table-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    background: rgba(245,245,247,.6);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 13px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,.03);
    vertical-align: middle;
}
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--blue-light); }
.table tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 6px; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,.12);
}
select.form-control { cursor: pointer; appearance: none; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2386868b' stroke-width='1.5'/%3E%3C/svg%3E\"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---- 搜索栏 ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 0 14px;
    transition: var(--transition);
    flex: 1;
    max-width: 360px;
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,.12); }
.search-box input {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 8px;
    width: 100%;
    background: transparent;
    color: var(--text);
}
.search-icon { color: var(--text-secondary); font-size: 14px; }

/* ---- 分页 ---- */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; padding: 16px; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px;
    border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}
.page-link:hover { background: var(--gray-light); color: var(--text); }
.page-link.active { background: var(--blue); color: #fff; }

/* ---- 提示消息 ---- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
    animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }
.alert-success { background: var(--green-light); color: #1a7a32; border: 1px solid rgba(52,199,89,.2); }
.alert-error { background: var(--red-light); color: #c62828; border: 1px solid rgba(255,59,48,.15); }
.alert-info { background: var(--blue-light); color: #0055B3; border: 1px solid rgba(0,122,255,.15); }
.alert-warning { background: #fff8e1; color: #8d6e00; border: 1px solid rgba(255,193,7,.25); }

/* ---- 空状态 ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 15px; }

/* ---- 登录页 ---- */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0,122,255,.06) 0%, transparent 70%);
    top: -200px; right: -200px;
    border-radius: 50%;
}
.login-bg::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(52,199,89,.05) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    border-radius: 50%;
}
.login-card {
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px;
    padding: 48px 40px;
    width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,.6);
    position: relative;
    z-index: 1;
}
.login-card h1 { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: -.5px; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 36px; }

/* ---- 图表容器 ---- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}
.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.chart-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.chart-container { position: relative; height: 280px; }

/* ---- 步骤条 ---- */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition);
}
.step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}
.step.active { color: var(--blue); }
.step.active .step-num { background: var(--blue); color: #fff; }
.step.done { color: var(--green); }
.step.done .step-num { background: var(--green); color: #fff; }
.step-line { width: 40px; height: 2px; background: var(--border); flex-shrink: 0; }

/* ---- 用户层次结构 ---- */
.user-hierarchy { display: flex; flex-direction: column; gap: 20px; }
.hierarchy-section { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hierarchy-header { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.hierarchy-icon { font-size: 18px; }
.hierarchy-title { font-size: 15px; font-weight: 600; color: var(--text); }
.hierarchy-count { font-size: 12px; color: var(--text-secondary); background: var(--gray-light); padding: 2px 10px; border-radius: 10px; margin-left: auto; }
.hierarchy-section .table { --table-cell-padding: 10px 16px; }
.hierarchy-section .table thead th { font-size: 12px; font-weight: 600; color: var(--text-secondary); background: #f8f9fa; }

/* ---- 毕业生按专业部展示 ---- */
.grad-by-dept { display: flex; flex-direction: column; gap: 16px; }
.dept-section { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dept-section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; cursor: pointer; transition: var(--transition); -webkit-user-select: none; user-select: none; }
.dept-section-header:hover { background: var(--blue-light); }
.dept-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.dept-section-icon { font-size: 16px; }
.dept-section-count { font-size: 12px; color: var(--text-secondary); background: var(--gray-light); padding: 1px 8px; border-radius: 4px; }
.dept-section-toggle { font-size: 12px; color: var(--text-secondary); }
.dept-section-body { border-top: 1px solid var(--border); }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .chart-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
    .stat-value { font-size: 28px; }
}
