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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f7fa;
}

/* 布局样式 */
#app {
  min-height: 100vh;
}

/* 通用组件样式 */
.btn {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: none;
}

.btn-primary {
  color: #fff;
  background-color: #2c3e50;
  border-color: #2c3e50;
}

.btn-primary:hover {
  background-color: #1a252f;
  border-color: #1a252f;
}

.btn-warning {
  color: #fff;
  background-color: #f39c12;
  border-color: #f39c12;
}

.btn-warning:hover {
  background-color: #e67e22;
  border-color: #e67e22;
}

.btn-danger {
  color: #fff;
  background-color: #e74c3c;
  border-color: #e74c3c;
}

.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.btn-default:hover {
  background-color: #e6e6e6;
  border-color: #adadad;
}

.btn-small {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 3px;
}

/* 表单样式 */
.form-item {
  margin-bottom: 15px;
}

.form-item label {
  display: inline-block;
  width: 100px;
  text-align: right;
  margin-right: 10px;
}

.form-item input, .form-item select {
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
}

.form-actions {
  margin-left: 110px;
}

/* 页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
  color: #2c3e50;
}

.page-actions {
  display: flex;
  gap: 10px;
}

/* 表格样式 */
table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  background-color: #fff;
  border-collapse: collapse;
}

table th, table td {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #eee;
  text-align: left;
}

table th {
  background-color: #f9f9f9;
  font-weight: bold;
  color: #2c3e50;
}

table tr:hover {
  background-color: #f5f5f5;
}

/* 状态标签 */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
}

.status.online {
  background-color: #27ae60;
}

.status.offline {
  background-color: #95a5a6;
}

.status.error {
  background-color: #e74c3c;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

/* 登录页面样式 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f7fa;
}

.login-card {
  width: 400px;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

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

.login-header h2 {
  color: #2c3e50;
  margin-bottom: 5px;
}

.login-form {
  margin-top: 20px;
}

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

.captcha-img {
  width: 100px;
  height: 34px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* 仪表盘样式 */
.dashboard {
  padding: 20px;
}

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

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.stat-title {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.chart-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.chart-placeholder {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f9f9f9;
  color: #7f8c8d;
}

/* 设备管理样式 */
.device-filter {
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  gap: 5px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 500px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #7f8c8d;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 配置中心样式 */
.config-tabs {
  display: flex;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}

.tab-item {
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-item.active {
  border-bottom-color: #2c3e50;
  color: #2c3e50;
  font-weight: bold;
}

.config-content {
  padding: 20px;
  background-color: #fff;
  min-height: 400px;
}

.config-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* 日志监控样式 */
.log-filter {
  display: flex;
  gap: 20px;
  padding: 10px 20px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
  align-items: center;
}

.date-range {
  display: flex;
  gap: 10px;
  align-items: center;
}

.log-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  max-height: 600px;
  overflow-y: auto;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
}

.log-time {
  min-width: 180px;
  color: #7f8c8d;
}

.log-type {
  min-width: 60px;
  text-align: center;
  border-radius: 4px;
  color: #fff;
  padding: 2px 5px;
}

.log-type.info {
  background-color: #3498db;
}

.log-type.warn {
  background-color: #f39c12;
}

.log-type.error {
  background-color: #e74c3c;
}

.log-type.debug {
  background-color: #9b59b6;
}

.log-content {
  flex: 1;
}

/* 系统设置样式 */
.system-tabs {
  display: flex;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}

.system-content {
  padding: 20px;
  background-color: #fff;
  min-height: 400px;
}

.permission-tree {
  padding: 20px;
}

.tree-node {
  margin: 10px 0;
}

.tree-children {
  margin-left: 20px;
  margin-top: 5px;
}
