* {
  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;
  font-size: 14px;
  color: #333;
  background-color: #f0f2f5;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}

.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.login-header h1 {
  font-size: 24px;
  color: #1890ff;
  margin-bottom: 8px;
}

.login-header p {
  color: #999;
}

.login-box .form-group {
  margin-bottom: 20px;
  position: relative;
}

.login-box .form-group label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.login-box .form-group input {
  width: 100%;
  height: 44px;
  padding: 0 15px 0 45px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.login-box .form-group input:focus {
  border-color: #1890ff;
  outline: none;
}

.login-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.login-btn:hover {
  opacity: 0.9;
}

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

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

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: #001529;
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.logo i {
  font-size: 24px;
  margin-right: 10px;
  color: #1890ff;
}

.nav-menu {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-menu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-menu a.active {
  color: #fff;
  background: #1890ff;
}

.nav-menu a i {
  width: 20px;
  margin-right: 10px;
}

.user-info {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.user-info .avatar {
  font-size: 40px;
  color: #1890ff;
  margin-bottom: 10px;
}

.user-info .name {
  margin-bottom: 10px;
}

.user-info .logout {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 12px;
}

.user-info .logout:hover {
  color: #fff;
}

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 20px;
  overflow-y: auto;
  min-height: 100vh;
}

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

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
}

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

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

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-right: 15px;
}

.stat-icon.blue { background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%); }
.stat-icon.green { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #fa8c16 0%, #d46b08 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #722ed1 0%, #531dab 100%); }

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

.stat-info .stat-label {
  font-size: 14px;
  color: #999;
  margin-top: 5px;
}

.filter-bar {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.filter-bar input[type="date"] {
  width: 150px;
}

.table-container {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #666;
}

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

.text-muted {
  color: #999;
  font-size: 12px;
}

.text-danger {
  color: #ff4d4f;
  font-weight: 600;
}

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status-0 { background: #fff7e6; color: #fa8c16; }
.status-1 { background: #e6f7ff; color: #1890ff; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #f5f5f5; color: #999; }
.status-4 { background: #fff1f0; color: #ff4d4f; }
.status-5 { background: #f5f5f5; color: #999; }
.status-6 { background: #fff1f0; color: #ff4d4f; }
.status-active { background: #f6ffed; color: #52c41a; }
.status-inactive { background: #f5f5f5; color: #999; }

.btn-primary {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-sm {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 5px;
}

.btn-info { background: #e6f7ff; color: #1890ff; }
.btn-warning { background: #fff7e6; color: #fa8c16; }
.btn-danger { background: #fff1f0; color: #ff4d4f; }
.btn-success { background: #f6ffed; color: #52c41a; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #fff;
  margin-top: 20px;
  border-radius: 8px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.sync-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.sync-result {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.sync-result pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
}

.sync-test-section {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.sync-test-section h3 {
  margin-bottom: 15px;
  font-size: 16px;
  color: #333;
}

.sync-test-section h3 i {
  margin-right: 8px;
  color: #52c41a;
}

.sync-test-form {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.sync-test-form .form-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
}

.sync-test-form .form-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

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

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

.sync-test-section .hint {
  font-size: 12px;
  color: #999;
}

.sync-result h4 {
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

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

.config-section {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}

.config-section h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 16px;
}

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

.modal-body {
  padding: 20px;
}

.detail-row {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row .label {
  color: #666;
  margin-right: 10px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 4px;
  color: #fff;
  z-index: 2000;
}

.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.warning { background: #fa8c16; }

.mapping-tip {
  color: #999;
  font-size: 12px;
  margin-bottom: 15px;
}

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

.config-section .form-group select {
  background: #fff;
}

.protocol-page .protocol-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  background: #fff;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.protocol-page .protocol-tabs button {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background: #fafafa;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
}

.protocol-page .protocol-tabs button:hover {
  color: #1890ff;
  background: #f5f5f5;
}

.protocol-page .protocol-tabs button.active {
  background: #fff;
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
  font-weight: 500;
}

.protocol-page .protocol-editor {
  background: #fff;
  padding: 20px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.protocol-page .protocol-editor .form-group {
  margin-bottom: 20px;
}

.protocol-page .protocol-editor .form-group label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  margin-bottom: 10px;
}

.protocol-page .protocol-textarea {
  width: 100%;
  min-height: 500px;
  padding: 15px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #fafafa;
  transition: all 0.3s;
}

.protocol-page .protocol-textarea:focus {
  border-color: #1890ff;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.protocol-page .protocol-textarea::placeholder {
  color: #bfbfbf;
}

.protocol-page .btn-primary {
  padding: 10px 30px;
  font-size: 14px;
}

.dev-mode-section {
  grid-column: 1 / -1;
}

.dev-mode-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-mode-section h3 i {
  color: #1890ff;
}

.dev-mode-tip {
  color: #666;
  font-size: 13px;
  margin-bottom: 15px;
}

.dev-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #1890ff;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.switch-label {
  font-size: 14px;
  color: #666;
}

.dev-mode-warning {
  margin-top: 15px;
  padding: 12px 15px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-mode-warning i {
  color: #fa8c16;
  font-size: 16px;
}

.dev-mode-warning span {
  color: #d46b08;
  font-size: 13px;
}
