/* ========================================
   数据治理开发平台 - 科技蓝主题样式
   苏州济趣通信工程有限公司
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: #0066FF;
    --primary-light: #00D4FF;
    --primary-dark: #0044AA;

    /* Accent Colors */
    --success: #00FF88;
    --warning: #FFD93D;
    --danger: #FF6B6B;
    --info: #00D4FF;

    /* Background Colors */
    --bg-dark: #0D1B2A;
    --bg-card: #1B2838;
    --bg-card-hover: #243447;
    --bg-sidebar: #0A1628;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #8B9DC3;
    --text-muted: #5A6B8A;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0066FF 0%, #00D4FF 100%);
    --gradient-success: linear-gradient(135deg, #00FF88 0%, #00D4AA 100%);
    --gradient-warning: linear-gradient(135deg, #FFD93D 0%, #FF9500 100%);
    --gradient-danger: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 102, 255, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 102, 255, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 102, 255, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);

    /* Borders */
    --border-color: rgba(0, 212, 255, 0.2);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    outline: none;
}

/* ========================================
   Login Page Styles
   ======================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 102, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.login-box {
    position: relative;
    z-index: 10;
    width: 420px;
    padding: 48px;
    background: rgba(27, 40, 56, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

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

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-glow);
}

.login-logo .logo-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.login-form label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 12px;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
}

/* ========================================
   Main Layout
   ======================================== */

.main-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header .logo-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.sidebar-header .logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-light);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-toggle {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition-normal);
}

.sidebar.collapsed + .main-content {
    margin-left: 72px;
}

/* Header */
.header {
    height: 64px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
}

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

.header-search {
    position: relative;
}

.header-search input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.header-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition-fast);
}

.header-icon-btn:hover {
    background: var(--bg-card-hover);
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
}

.header-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Page Content */
.page-content {
    padding: 24px;
}

/* ========================================
   Dashboard Styles
   ======================================== */

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

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

.stat-card.success::before {
    background: var(--gradient-success);
}

.stat-card.warning::before {
    background: var(--gradient-warning);
}

.stat-card.danger::before {
    background: var(--gradient-danger);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 102, 255, 0.15);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-light);
}

.stat-card.success .stat-card-icon {
    background: rgba(0, 255, 136, 0.15);
}

.stat-card.success .stat-card-icon svg {
    fill: var(--success);
}

.stat-card.warning .stat-card-icon {
    background: rgba(255, 217, 61, 0.15);
}

.stat-card.warning .stat-card-icon svg {
    fill: var(--warning);
}

.stat-card.danger .stat-card-icon {
    background: rgba(255, 107, 107, 0.15);
}

.stat-card.danger .stat-card-icon svg {
    fill: var(--danger);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card-change.up {
    color: var(--success);
}

.stat-card-change.down {
    color: var(--danger);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-card-title {
    font-size: 1rem;
    font-weight: 600;
}

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

.chart-card-actions select {
    padding: 6px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.data-table td {
    font-size: 0.875rem;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.online {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
}

.status-badge.online::before {
    background: var(--success);
}

.status-badge.offline {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.status-badge.offline::before {
    background: var(--danger);
}

.status-badge.pending {
    background: rgba(255, 217, 61, 0.15);
    color: var(--warning);
}

.status-badge.pending::before {
    background: var(--warning);
}

.status-badge.processing {
    background: rgba(0, 212, 255, 0.15);
    color: var(--info);
}

.status-badge.processing::before {
    background: var(--info);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Panels */
.panel {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
}

.panel-body {
    padding: 20px;
}

/* Alerts */
.alert-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid;
}

.alert-item.critical {
    border-left-color: var(--danger);
}

.alert-item.warning {
    border-left-color: var(--warning);
}

.alert-item.info {
    border-left-color: var(--info);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-item.critical .alert-icon {
    fill: var(--danger);
}

.alert-item.warning .alert-icon {
    fill: var(--warning);
}

.alert-item.info .alert-icon {
    fill: var(--info);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.alert-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.quick-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-light);
}

/* Lists */
.list-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 102, 255, 0.15);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.list-item-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-light);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.list-item-action {
    font-size: 0.75rem;
    color: var(--primary-light);
    cursor: pointer;
}

/* Progress Bars */
.progress-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--gradient-primary);
    transition: width 0.5s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

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

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-light);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 6px;
    margin-bottom: 6px;
}

.tag.success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
}

.tag.warning {
    background: rgba(255, 217, 61, 0.15);
    color: var(--warning);
}

.tag.danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

/* Grid Layout Helpers */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
