/**
 * 企业安全管理系统 - 主样式表
 * 主题: 深蓝科技感 (安全管理)
 * 版本: 1.0.0
 */

/* ==================== CSS 变量 ==================== */
:root {
    --primary: #1565c0;
    --primary-light: #1e88e5;
    --primary-dark: #0d47a1;
    --primary-bg: rgba(21,101,192,0.08);
    --accent: #00acc1;
    --accent-light: #26c6da;
    --success: #2e7d32;
    --success-light: #43a047;
    --warning: #f57c00;
    --warning-light: #ff9800;
    --danger: #c62828;
    --danger-light: #e53935;
    --info: #0277bd;

    --bg-dark: #0a1628;
    --bg-darker: #060f1d;
    --bg-sidebar: #0d1f35;
    --bg-card: #112240;
    --bg-input: #0a1929;
    --bg-hover: rgba(66,165,245,0.08);

    --text-primary: #e0e6ed;
    --text-secondary: #8892a4;
    --text-muted: #5a6577;
    --text-link: #42a5f5;

    --border-color: rgba(66,165,245,0.12);
    --border-light: rgba(66,165,245,0.06);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --topbar-height: 60px;
    --footer-height: 40px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 基础重置 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ==================== 登录页面 ==================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #060f1d 0%, #0a1628 25%, #1a3a5c 50%, #0d2847 75%, #060f1d 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 粒子背景 */
.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(21,101,192,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0,172,193,0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(66,165,245,0.05) 0%, transparent 70%);
    animation: bgRotate 30s linear infinite;
}

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

/* 浮动光点 */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: rgba(13, 31, 53, 0.85);
    border: 1px solid rgba(66,165,245,0.12);
    border-radius: var(--radius-xl);
    padding: 50px 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(21,101,192,0.1);
}

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

.login-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(21,101,192,0.3);
}

.login-logo svg {
    width: 36px;
    height: 36px;
    color: #fff;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* 登录表单 */
.login-form .form-group {
    margin-bottom: 22px;
    position: relative;
}

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

.login-form .form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 46px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition);
    outline: none;
}

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

.login-form .form-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
    background: rgba(10, 25, 41, 0.95);
}

.login-form .input-icon {
    position: absolute;
    left: 14px;
    top: 39px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.login-form .form-input:focus ~ .input-icon,
.login-form .form-group:focus-within .input-icon {
    color: var(--primary-light);
}

.login-form .input-icon svg {
    width: 20px;
    height: 20px;
}

.login-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(21,101,192,0.3);
    margin-top: 10px;
}

.login-btn:hover {
    box-shadow: 0 6px 25px rgba(21,101,192,0.5);
    transform: translateY(-1px);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 12px;
}

.login-error {
    background: rgba(198,40,40,0.1);
    border: 1px solid rgba(198,40,40,0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 20px;
    color: var(--danger-light);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 后台布局 ==================== */
.admin-body {
    height: 100vh;
    overflow: hidden;
}

.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    z-index: 1000;
    position: relative;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 18px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.logo-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-muted);
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(66,165,245,0.2);
    border-radius: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(21,101,192,0.2), rgba(0,172,193,0.1));
    color: var(--primary-light);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(66,165,245,0.15);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-active-bar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 3px 0 0 3px;
}

.nav-center { justify-content: center; }
.nav-center .nav-icon { margin-right: 0; }
.nav-center .nav-active-bar { display: none; }

/* ==================== 子菜单导航 ==================== */
.nav-group {
    margin-bottom: 2px;
}

.nav-parent {
    position: relative;
}

.nav-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-group.expanded .nav-arrow {
    transform: rotate(180deg);
}

.nav-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-group.expanded .nav-children {
    max-height: 500px;
}

.nav-child {
    padding-left: 48px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    font-size: 13px !important;
    margin-bottom: 1px !important;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
}

.nav-child:hover .nav-dot {
    background: var(--primary-light);
    box-shadow: 0 0 6px rgba(66,165,245,0.4);
}

.nav-child.active .nav-dot {
    background: var(--primary-light);
    box-shadow: 0 0 8px rgba(66,165,245,0.5);
}

.nav-child.active {
    background: rgba(21,101,192,0.12) !important;
    color: var(--primary-light) !important;
}

/* ==================== 侧边栏底部 ==================== */
.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--border-light);
}

.sidebar-copyright {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* 顶部栏 */
.top-bar {
    height: var(--topbar-height);
    background: rgba(13, 31, 53, 0.95);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
}

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

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

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

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

.breadcrumb {
    font-size: 15px;
}

.breadcrumb-item {
    color: var(--text-primary);
    font-weight: 500;
}

/* 用户下拉菜单 */
.top-bar-right {
    display: flex;
    align-items: center;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.user-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--primary-bg);
    color: var(--primary-light);
    border-radius: 10px;
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform var(--transition);
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
    overflow: hidden;
}

.user-dropdown.open .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

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

.dropdown-header {
    padding: 16px;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.dropdown-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-role {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition);
    cursor: pointer;
}

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

.dropdown-item-danger {
    color: var(--danger-light);
}

.dropdown-item-danger:hover {
    background: rgba(198,40,40,0.1);
    color: var(--danger-light);
}

/* ==================== 页面内容区 ==================== */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-dark);
}

.page-content::-webkit-scrollbar {
    width: 6px;
}
.page-content::-webkit-scrollbar-track {
    background: transparent;
}
.page-content::-webkit-scrollbar-thumb {
    background: rgba(66,165,245,0.15);
    border-radius: 3px;
}

/* ==================== 页脚 ==================== */
.admin-footer {
    height: var(--footer-height);
    background: rgba(13, 31, 53, 0.8);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-separator {
    opacity: 0.3;
}

/* ==================== 卡片组件 ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    border-color: rgba(66,165,245,0.2);
}

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

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

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    border-color: rgba(66,165,245,0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 8px;
}

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

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: rgba(21,101,192,0.15); color: var(--primary-light); }
.stat-icon.cyan { background: rgba(0,172,193,0.15); color: var(--accent-light); }
.stat-icon.green { background: rgba(46,125,50,0.15); color: var(--success-light); }
.stat-icon.orange { background: rgba(245,124,0,0.15); color: var(--warning-light); }

/* ==================== 表格组件 ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 800px;
}

.data-table thead {
    background: rgba(21,101,192,0.08);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

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

.data-table tbody tr.selected {
    background: rgba(21,101,192,0.12);
}

/* 表格checkbox */
.table-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* 表格操作按钮 */
.table-actions {
    display: flex;
    gap: 6px;
}

.table-action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.table-action-btn.edit {
    background: rgba(21,101,192,0.1);
    color: var(--primary-light);
}
.table-action-btn.edit:hover {
    background: rgba(21,101,192,0.2);
}

.table-action-btn.delete {
    background: rgba(198,40,40,0.1);
    color: var(--danger-light);
}
.table-action-btn.delete:hover {
    background: rgba(198,40,40,0.2);
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 13px;
}

.pagination-info {
    color: var(--text-secondary);
}

.pagination-btns {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: var(--primary-bg);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== 按钮组件 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(21,101,192,0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-light));
    color: #fff;
}

.btn-secondary {
    background: rgba(30,58,95,0.5);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(30,58,95,0.8);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
}
.btn-outline:hover {
    background: var(--primary-bg);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== 表单组件 ==================== */
.form-group {
    margin-bottom: 18px;
}

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ==================== 弹窗组件 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.modal-dialog.modal-lg { max-width: 900px; }
.modal-dialog.modal-sm { max-width: 440px; }

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ==================== Toast 通知 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success {
    background: rgba(46,125,50,0.9);
    color: #fff;
    border: 1px solid rgba(67,160,71,0.3);
}

.toast.error {
    background: rgba(198,40,40,0.9);
    color: #fff;
    border: 1px solid rgba(229,57,53,0.3);
}

.toast.warning {
    background: rgba(245,124,0,0.9);
    color: #fff;
    border: 1px solid rgba(255,152,0,0.3);
}

.toast.info {
    background: rgba(21,101,192,0.9);
    color: #fff;
    border: 1px solid rgba(30,136,229,0.3);
}

/* ==================== 数据看板 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

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

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* ==================== 加载状态 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(66,165,245,0.2);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,22,40,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

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

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

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

.search-box {
    position: relative;
}

.search-box input {
    width: 240px;
    height: 38px;
    padding: 0 14px 0 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    width: 300px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* ==================== 标签/徽章 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success { background: rgba(46,125,50,0.15); color: var(--success-light); }
.badge-warning { background: rgba(245,124,0,0.15); color: var(--warning-light); }
.badge-danger { background: rgba(198,40,40,0.15); color: var(--danger-light); }
.badge-info { background: rgba(21,101,192,0.15); color: var(--primary-light); }

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

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
    margin-top: 8px;
}

/* ==================== 批量操作栏 ==================== */
.batch-bar {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    align-items: center;
    gap: 16px;
    animation: batchBarSlideUp 0.3s ease;
}

.batch-bar.show {
    display: flex;
}

@keyframes batchBarSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.batch-bar .batch-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.batch-bar .batch-count strong {
    color: var(--primary-light);
}

/* ==================== 科技感动画 ==================== */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-light);
    display: inline-block;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success-light);
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* 数字跳动效果 */
.animate-number {
    transition: all 0.5s ease;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background: rgba(66,165,245,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 1s ease;
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 1024px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* 移动端 */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .top-bar {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .user-name, .user-role-badge {
        display: none;
    }

    .admin-footer {
        padding: 0 16px;
    }

    .footer-left, .footer-right {
        display: none;
    }

    .search-box input {
        width: 160px;
    }

    .search-box input:focus {
        width: 200px;
    }

    .modal-dialog {
        margin: 10px;
        max-height: 90vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: flex-start;
    }

    .batch-bar {
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 16px;
    }

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

    .login-card {
        padding: 35px 25px;
    }
}

/* 超小屏幕 */
@media (max-width: 375px) {
    .page-content { padding: 12px; }
    .card-body { padding: 16px; }
    .stat-card { padding: 16px; }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar, .top-bar, .admin-footer, .toolbar, .batch-bar, .toast-container { display: none !important; }
    .page-content { padding: 0; overflow: visible; }
    body { background: #fff; color: #000; }
    .data-table th, .data-table td { border: 1px solid #ddd; }
}
