* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #151932;
  --bg-tertiary: #1e2442;
  --bg-hover: #252b4a;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --border-color: #2d3748;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --long-color: #10b981;
  --short-color: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部样式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 主要内容区 */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* 面板通用样式 */
.trading-panel,
.info-panel {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.panel-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 600;
}

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

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

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.input-with-button .input {
  flex: 1;
}

/* 价格显示 */
.price-display {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.price-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-primary);
}

/* 复选框组 */
.checkbox-group {
  display: flex;
  gap: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  transition: all 0.3s ease;
  flex: 1;
}

.checkbox-label:hover {
  background: var(--bg-hover);
}

.checkbox-label input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-text {
  font-weight: 500;
}

.checkbox-text.long {
  color: var(--long-color);
}

.checkbox-text.short {
  color: var(--short-color);
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  width: 100%;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  width: 100%;
}

.btn-icon {
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  background: var(--bg-hover);
  transform: rotate(180deg);
}

/* 操作按钮组 */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

/* 信息卡片 */
.info-card {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-card h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--text-primary);
  font-weight: 600;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
}

/* 持仓列表 */
.positions-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.position-item {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent-primary);
}

.position-item.long {
  border-left-color: var(--long-color);
}

.position-item.short {
  border-left-color: var(--short-color);
}

.position-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.position-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 日志列表 */
.logs-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.log-item {
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-color);
}

.log-item.success {
  border-left-color: var(--success);
  color: var(--success);
}

.log-item.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.log-item.info {
  border-left-color: var(--accent-primary);
  color: var(--accent-primary);
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
  font-size: 22px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.3s ease;
}

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

.modal-body {
  padding: 30px;
}

/* 配置表单 */
.config-form {
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  margin-bottom: 30px;
}

.config-form h3 {
  margin-bottom: 20px;
  font-size: 18px;
}

/* 配置列表 */
.config-list h3 {
  margin-bottom: 15px;
  font-size: 18px;
}

.config-item {
  padding: 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-info {
  flex: 1;
}

.config-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.config-details {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.btn-delete {
  background: var(--danger);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.btn-delete:hover {
  background: #dc2626;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .header h1 {
    font-size: 22px;
  }

  .checkbox-group {
    flex-direction: column;
  }

  .modal-content {
    width: 95%;
  }
}
