/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* 登录页面样式 */
.login-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.login-wrapper {
  width: 900px;
  height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  overflow: hidden;
}

.login-left {
  flex: 1;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.system-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}

.company-name {
  font-size: 16px;
  color: #666;
  margin-bottom: 40px;
  text-align: center;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #999;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.login-btn:hover {
  background: #40a9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.copyright {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 40px;
}

.login-right {
  flex: 1;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

.right-content {
  text-align: center;
  padding: 40px;
}

.smart-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.system-description {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 40px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.feature-icon {
  font-size: 20px;
}

/* 管理界面样式 */
.dashboard-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  overflow: hidden;
}

/* 顶部导航栏 */
.dashboard-header {
  height: 60px;
  background: #1890ff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.header-info {
  display: flex;
  gap: 20px;
  white-space: nowrap;
}

.logout-btn {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 主内容区 */
.dashboard-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 左侧菜单栏 */
.dashboard-sidebar {
  width: 200px;
  background: white;
  border-right: 1px solid #e8e8e8;
  overflow-y: auto;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  padding: 0 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 12px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-item a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-item a:hover {
  background: #f5f5f5;
  color: #1890ff;
}

.nav-item.active a {
  background: #e6f7ff;
  color: #1890ff;
  border-right: 3px solid #1890ff;
}

.nav-item.has-submenu .menu-toggle {
  position: relative;
}

.nav-item.has-submenu .menu-toggle::after {
  content: '▶';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  transition: transform 0.3s ease;
}

.nav-item.has-submenu.open .menu-toggle::after {
  transform: translateY(-50%) rotate(90deg);
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fafafa;
}

.nav-item.has-submenu.open .submenu {
  max-height: 500px;
}

.submenu-item {
  margin: 0;
}

.submenu-item a {
  display: block;
  padding: 8px 20px 8px 36px;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
}

.submenu-item a:hover {
  background: #f0f0f0;
  color: #1890ff;
}

.submenu-item.active a {
  background: #e6f7ff;
  color: #1890ff;
}

/* 主内容 */
.dashboard-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f0f2f5;
}

.content-header {
  margin-bottom: 20px;
}

.content-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

/* 设备网格 */
.device-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

.device-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 6px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.device-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.device-card.normal {
  border-left: 3px solid #52c41a;
}

.device-card.warning {
  border-left: 3px solid #faad14;
}

.device-card.error {
  border-left: 3px solid #f5222d;
}

.device-name {
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-status {
  font-size: 9px;
  color: #666;
  margin-bottom: 4px;
}

.device-icon {
  font-size: 16px;
}

/* 右侧设备类型选择 */
.dashboard-rightbar {
  width: 200px;
  background: white;
  border-left: 1px solid #e8e8e8;
  padding: 20px;
  overflow-y: auto;
}

.rightbar-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.device-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-checkbox {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.type-checkbox input {
  margin-right: 8px;
}

/* 底部状态栏 */
.dashboard-footer {
  height: 40px;
  background: white;
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: #666;
}

/* 底部操作栏 */
.dashboard-bottombar {
  height: 32px;
  background: #f0f2f5;
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: #666;
}

.bottombar-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d9d9d9;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 4px;
  transition: all 0.3s ease;
}

.bottombar-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .login-wrapper {
    width: 800px;
    height: 450px;
  }
  
  .login-left,
  .login-right {
    padding: 40px;
  }
  
  .dashboard-sidebar {
    width: 180px;
  }
  
  .dashboard-rightbar {
    width: 180px;
  }
  
  .device-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 992px) {
  .login-wrapper {
    flex-direction: column;
    width: 90%;
    height: auto;
  }
  
  .dashboard-sidebar {
    width: 160px;
  }
  
  .dashboard-rightbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .login-container {
    padding: 20px;
  }
  
  .login-wrapper {
    width: 100%;
  }
  
  .dashboard-header {
    padding: 0 10px;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .dashboard-content {
    padding: 10px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 管理页面通用样式 */
.management-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
}

/* 标签页样式 */
.tab-header {
  display: flex;
  border-bottom: 2px solid #e8e8e8;
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  color: #666;
  transition: all 0.3s ease;
}

.tab-item:hover {
  color: #1890ff;
}

.tab-item.active {
  color: #1890ff;
  border-bottom-color: #1890ff;
}

/* 搜索区域样式 */
.search-area {
  background: #f5f7fa;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.search-row:last-child {
  margin-bottom: 0;
}

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

.search-item label {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

.search-item input,
.search-item select {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  min-width: 120px;
}

.search-item input:focus,
.search-item select:focus {
  outline: none;
  border-color: #1890ff;
}

.search-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.search-btn {
  padding: 8px 20px;
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: #40a9ff;
}

.search-btn.secondary {
  background: #fff;
  color: #666;
  border: 1px solid #d9d9d9;
}

.search-btn.secondary:hover {
  color: #1890ff;
  border-color: #1890ff;
}

/* 表单区域样式 */
.form-area {
  background: #f5f7fa;
  padding: 20px;
  border-radius: 4px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.form-row:last-child {
  margin-bottom: 0;
}

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

.form-item label {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

.form-item input,
.form-item select {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  min-width: 150px;
}

.form-item input:focus,
.form-item select:focus {
  outline: none;
  border-color: #1890ff;
}

.form-item input[readonly] {
  background: #f5f5f5;
  cursor: not-allowed;
}

.form-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* 表格容器样式 */
.table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

/* 数据表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #e8e8e8;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:hover {
  background: #f5f7fa;
}

/* 表格操作按钮样式 */
.table-action-btn {
  padding: 4px 12px;
  margin: 2px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.table-action-btn:hover {
  color: #1890ff;
  border-color: #1890ff;
}

.table-action-btn.delete:hover {
  color: #f5222d;
  border-color: #f5222d;
}

