/* E+OPC SaaS 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: width 0.3s; overflow-y: auto; }
.main-area { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* 头部 */
.header { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 99; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-title { font-size: 16px; font-weight: 600; color: #333; }
.admin-avatar { width: 32px; height: 32px; border-radius: 50%; background: #1890ff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }

/* 侧边栏 */
.sidebar-logo { height: 56px; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h2 { color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; }
.sidebar-logo span { color: #1890ff; }
.nav-menu { padding: 8px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title { padding: 8px 16px; color: rgba(255,255,255,0.45); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; padding: 10px 16px; color: rgba(255,255,255,0.65); text-decoration: none; transition: all 0.3s; cursor: pointer; font-size: 14px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active { color: #fff; background: #1890ff; }
.nav-item .icon { width: 20px; margin-right: 8px; text-align: center; font-size: 16px; }
.nav-sub { padding-left: 20px; }
.nav-sub .nav-item { padding: 8px 16px 8px 44px; font-size: 13px; }

/* 内容区 */
.content { padding: 24px; flex: 1; }
.page-header { margin-bottom: 20px; }
.page-header h3 { font-size: 20px; font-weight: 600; color: #333; }
.page-header p { color: #666; margin-top: 4px; font-size: 13px; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.stat-card .label { color: #666; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #333; }
.stat-card .trend { font-size: 12px; margin-top: 8px; }
.stat-card .trend.up { color: #52c41a; }
.stat-card .trend.down { color: #ff4d4f; }
.stat-card.blue { border-left: 4px solid #1890ff; }
.stat-card.green { border-left: 4px solid #52c41a; }
.stat-card.orange { border-left: 4px solid #fa8c16; }
.stat-card.purple { border-left: 4px solid #722ed1; }

/* 表格 */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #fafafa; padding: 12px 16px; text-align: left; font-weight: 600; color: #333; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #fafafa; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #333; transition: all 0.3s; text-decoration: none; gap: 4px; }
.btn:hover { border-color: #40a9ff; color: #40a9ff; }
.btn-primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; color: #fff; }
.btn-warning { background: #fa8c16; color: #fff; border-color: #fa8c16; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 工具栏 */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.toolbar-left { display: flex; align-items: center; gap: 8px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.search-input { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; width: 200px; outline: none; }
.search-input:focus { border-color: #40a9ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
select.filter { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; outline: none; background: #fff; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: #fa8c16; border: 1px solid #ffe58f; }
.tag-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-default { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; margin-top: 16px; gap: 4px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; text-decoration: none; color: #333; }
.pagination span.current { background: #1890ff; color: #fff; border-color: #1890ff; }
.pagination a:hover { border-color: #40a9ff; color: #40a9ff; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #333; font-size: 13px; }
.form-group label .required { color: #ff4d4f; margin-left: 2px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; outline: none; transition: border-color 0.3s; }
.form-control:focus { border-color: #40a9ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* 模态框 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 90vw; max-height: 85vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; font-size: 18px; color: #999; background: none; border: none; }
.modal-close:hover { color: #333; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #001529 0%, #003a70 50%, #1890ff 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.login-box h1 { text-align: center; margin-bottom: 8px; font-size: 24px; color: #333; }
.login-box .subtitle { text-align: center; color: #999; margin-bottom: 32px; font-size: 13px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box .btn-primary { width: 100%; padding: 10px; font-size: 15px; justify-content: center; }

/* 面包屑 */
.breadcrumb { color: #999; font-size: 13px; margin-bottom: 16px; }
.breadcrumb a { color: #1890ff; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* 操作列 */
.action-link { color: #1890ff; cursor: pointer; text-decoration: none; margin-right: 8px; font-size: 13px; }
.action-link:hover { color: #40a9ff; }
.action-link.danger { color: #ff4d4f; }
.action-link.danger:hover { color: #ff7875; }

/* 栅格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-area { margin-left: 200px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
}
