/* ═══════════════════════════════════════════════════════
   智汇人事管理平台 · HRMS Portal
   Design: Modern Dark Header + Glass Morphism + Light FX
   Brand: 智汇 Smart ZhiHui
   ═══════════════════════════════════════════════════════ */

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

:root {
    /* Brand Colors */
    --c-primary: #4F46E5;
    --c-primary-l: #818CF8;
    --c-primary-d: #3730A3;
    --c-accent: #06B6D4;
    --c-gold: #F59E0B;
    --c-gold-l: #FCD34D;

    /* Surface */
    --bg: #F0F2F5;
    --surface: #FFFFFF;
    --surface-h: #F8FAFC;

    /* Text */
    --text-1: #0F172A;
    --text-2: #475569;
    --text-3: #94A3B8;
    --text-d: #CBD5E1;

    /* Effects */
    --sh-sm: 0 1px 2px rgba(0,0,0,.04);
    --sh-md: 0 4px 12px rgba(0,0,0,.06);
    --sh-lg: 0 8px 24px rgba(0,0,0,.08);
    --sh-glow: 0 0 20px rgba(79,70,229,.1);
    --sh-glow-a: 0 0 20px rgba(6,182,212,.1);

    --r-lg: 16px;
    --r-md: 12px;
    --r-sm: 8px;
    --ease: cubic-bezier(.4,0,.2,1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 56px;
}

/* ━━━━━━━━━━━━━━━━━━━━ HEADER ━━━━━━━━━━━━━━━━━━━━ */

.hr-header {
    position: relative;
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 35%, #312E81 65%, #1E3A5F 100%);
    padding: 14px 20px 24px;
    overflow: hidden;
}

/* Animated light orbs */
.hr-header::before,
.hr-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hr-header::before {
    width: 300px; height: 300px;
    top: -160px; right: -80px;
    background: radial-gradient(circle, rgba(6,182,212,.22) 0%, transparent 70%);
    animation: hr-float 8s ease-in-out infinite;
}
.hr-header::after {
    width: 240px; height: 240px;
    bottom: -110px; left: -50px;
    background: radial-gradient(circle, rgba(79,70,229,.28) 0%, transparent 70%);
    animation: hr-float 10s ease-in-out infinite reverse;
}

@keyframes hr-float {
    0%, 100% { transform: translate(0,0) scale(1); }
    50%      { transform: translate(10px,-10px) scale(1.05); }
}

/* Extra light rays */
.hr-header-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120px 80px at 80% 20%, rgba(245,158,11,.12) 0%, transparent 100%),
        radial-gradient(ellipse 80px 120px at 20% 80%, rgba(99,102,241,.15) 0%, transparent 100%);
}

.hr-header-inner {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

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

.hr-platform {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hr-platform-logo {
    width: 42px; height: 42px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hr-platform-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}
.hr-platform-sub {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    letter-spacing: .5px;
    margin-top: 2px;
}

.hr-user-area {
    display: flex;
    align-items: center;
}
.hr-user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 2px solid rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hr-user-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.hr-greeting-row {
    position: relative;
}
.hr-greeting {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.hr-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hr-badge {
    font-size: 11px;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.1);
    padding: 2px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.hr-date {
    font-size: 12px;
    color: rgba(255,255,255,.55);
}

/* ━━━━━━━━━━━━━━━━━━━━ AI BAR ━━━━━━━━━━━━━━━━━━━━ */

.hr-ai-bar {
    position: relative;
    max-width: 600px;
    margin: -10px auto 0;
    padding: 0 16px;
    z-index: 3;
}
.hr-ai-bar-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(79,70,229,.12);
    border-radius: var(--r-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--sh-md), var(--sh-glow);
}
.hr-ai-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.hr-ai-content {
    flex: 1;
    min-width: 0;
}
.hr-ai-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}
.hr-ai-desc {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}
/* Animated glow border */
.hr-ai-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, transparent, rgba(79,70,229,.15), rgba(6,182,212,.15), transparent);
    background-size: 200% 100%;
    animation: hr-shimmer 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}
@keyframes hr-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ━━━━━━━━━━━━━━━━━━━━ MAIN ━━━━━━━━━━━━━━━━━━━━ */

.hr-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 18px 16px 16px;
}

/* ━━━━━━━━━━━━━━━━━━━━ SECTIONS ━━━━━━━━━━━━━━━━━━━━ */

.hr-section {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 12px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hr-section:last-child { margin-bottom: 0; }

.hr-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-left: 4px;
}
.hr-section-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hr-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: .3px;
}

/* ━━━━━━━━━━━━━━━━━━━━ MODULE GRID ━━━━━━━━━━━━━━━━━━━━ */

.hr-module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 0;
}

/* ━━━━━━━━━━━━━━━━━━━━ MODULE CARDS ━━━━━━━━━━━━━━━━━━━━ */

.hr-card {
    position: relative;
    background: transparent;
    border-radius: 0;
    padding: 12px 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: all .25s var(--ease);
    animation: hr-rise .45s var(--ease) both;
    border: none;
}
.hr-card:nth-child(1) { animation-delay: .05s; }
.hr-card:nth-child(2) { animation-delay: .1s; }
.hr-card:nth-child(3) { animation-delay: .15s; }
.hr-card:nth-child(4) { animation-delay: .2s; }
.hr-card:nth-child(5) { animation-delay: .25s; }
.hr-card:nth-child(6) { animation-delay: .3s; }

@keyframes hr-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Active card */
.hr-card--active {
    cursor: pointer;
}
.hr-card--active:hover {
    transform: translateY(-1px);
}
.hr-card--active:active {
    transform: scale(.95);
}

/* Card icon */
.hr-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: transparent;
    box-shadow: none;
    transition: all .25s var(--ease);
    flex-shrink: 0;
    overflow: hidden;
}
.hr-card--active:hover .hr-card-icon {
    transform: scale(1.08);
}
.hr-card-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.hr-card-icon--muted {
    background: linear-gradient(135deg, #E2E8F0, #CBD5E1) !important;
    box-shadow: none !important;
    color: #94A3B8 !important;
}

/* Card text */
.hr-card-info {
    text-align: center;
    min-width: 0;
    width: 100%;
}
.hr-card-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}
.hr-card-desc {
    font-size: 10px;
    color: var(--text-3);
    line-height: 1.3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

/* Coming soon card */
.hr-card--coming {
    opacity: .45;
    cursor: default;
}
.hr-card--coming .hr-card-name { color: var(--text-3); }
.hr-card--coming .hr-card-desc { color: var(--text-d); }

/* Tag */
.hr-card-tag {
    position: absolute;
    top: 6px; right: 6px;
    font-size: 9px;
    color: var(--text-3);
    background: #F1F5F9;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: .3px;
}

/* ━━━━━━━━━━━━━━━━━━━━ FOOTER ━━━━━━━━━━━━━━━━━━━━ */

.hr-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,.05);
    text-align: center;
    padding: 10px 16px;
    z-index: 100;
}
.hr-footer-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-accent), transparent);
    margin-bottom: 6px;
    opacity: .3;
}
.hr-footer-text {
    font-size: 12px;
    color: var(--text-3);
}
.hr-footer-brand {
    color: var(--c-primary);
    font-weight: 600;
}
.hr-footer-sep { margin: 0 4px; opacity: .5; }
.hr-footer-sub { font-size: 11px; }

/* ━━━━━━━━━━━━━━━━━━━━ LOGIN PAGE ━━━━━━━━━━━━━━━━━━━━ */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 40%, #312E81 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    top: -200px; right: -100px;
    background: radial-gradient(circle, rgba(6,182,212,.2) 0%, transparent 70%);
    animation: hr-float 8s ease-in-out infinite;
}
.login-logo { font-size: 48px; margin-bottom: 16px; position: relative; }
.login-title {
    color: white; font-size: 24px; font-weight: 700;
    margin-bottom: 8px; position: relative;
}
.login-subtitle {
    color: rgba(255,255,255,.6); font-size: 14px;
    margin-bottom: 32px; position: relative;
}
.login-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px;
    background: rgba(255,255,255,.95);
    color: var(--c-primary); font-size: 16px; font-weight: 600;
    border: none; border-radius: 24px;
    cursor: pointer; position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: all .2s;
}
.login-btn:active { transform: scale(.96); }
.login-hint {
    color: rgba(255,255,255,.4); font-size: 12px;
    margin-top: 16px; position: relative;
}
.login-error {
    background: rgba(255,255,255,.1); color: white;
    padding: 12px 20px; border-radius: var(--r-sm);
    margin-top: 16px; font-size: 13px; position: relative;
}

/* ━━━━━━━━━━━━━━━━━━━━ RESPONSIVE ━━━━━━━━━━━━━━━━━━━━ */

@media (min-width: 768px) {
    .hr-module-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    .hr-card { padding: 14px 6px 10px; }
    .hr-card-icon { width: 56px; height: 56px; border-radius: 15px; }
    .hr-main { padding: 22px 24px; }
    .hr-header { padding: 18px 24px 28px; }
}

@media (min-width: 1024px) {
    .hr-module-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ━━━ Category icon colors ━━━ */
/* Set via inline --mc1/--mc2 vars from template */

/* ━━━ Pulse animation for AI icon ━━━ */
@keyframes hr-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(79,70,229,.3); }
    50%      { box-shadow: 0 2px 16px rgba(6,182,212,.4); }
}
.hr-ai-icon {
    animation: hr-pulse 2.5s ease-in-out infinite;
}


/* ━━━━━━━━━━━━━━━━━━━━ EXCEPTION DASHBOARD ━━━━━━━━━━━━━━━━━━━━ */

.hr-exception-bar {
    position: relative;
    max-width: 600px;
    margin: 12px auto 0;
    padding: 0 16px;
    z-index: 3;
    animation: hr-rise .45s var(--ease) both;
}
.hr-exception-inner {
    position: relative;
    padding: 14px 16px 12px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(79,70,229,.08);
    border-radius: var(--r-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--sh-sm);
}
.hr-exception-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, transparent, rgba(79,70,229,.06), rgba(6,182,212,.06), transparent);
    background-size: 200% 100%;
    animation: hr-shimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Header */
.hr-exception-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.hr-exception-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}
.hr-exception-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}
.hr-exception-time {
    font-size: 11px;
    color: var(--text-3);
}

/* Total */
.hr-exception-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,.05);
}
.exc-total-num {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.exc-total-danger { color: #DC2626; }
.exc-total-ok { color: #16A34A; font-size: 18px; }
.exc-total-label {
    font-size: 12px;
    color: var(--text-3);
}

/* System cards grid */
.hr-exception-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.exc-system-card {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    background: rgba(255,255,255,.7);
    text-decoration: none;
    color: inherit;
    transition: all .2s var(--ease);
    display: block;
}
a.exc-system-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.exc-system-card.exc-danger {
    border-color: rgba(220,38,38,.15);
    background: rgba(254,226,226,.3);
}
.exc-system-card.exc-warning {
    border-color: rgba(217,119,6,.15);
    background: rgba(254,243,199,.3);
}
.exc-system-card.exc-normal {
    border-color: rgba(22,163,74,.1);
    background: rgba(220,252,231,.2);
}

/* System head */
.exc-system-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.exc-system-icon {
    font-size: 14px;
}
.exc-system-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-1);
}

/* Metrics row */
.exc-metrics-row {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}
.exc-metric {
    text-align: center;
}
.exc-metric-val {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
.exc-metric-label {
    font-size: 10px;
    color: var(--text-3);
    margin-top: 1px;
}
.exc-metric-ok .exc-metric-val { color: #16A34A; }
.exc-metric-alert .exc-metric-val { color: #DC2626; }
.exc-metric-info .exc-metric-val { color: var(--text-2); }

/* Summary */
.exc-system-summary {
    font-size: 10px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 380px) {
    .hr-exception-grid {
        grid-template-columns: 1fr;
    }
    .exc-metrics-row {
        gap: 8px;
    }
    .exc-metric-val {
        font-size: 16px;
    }
}
