.lending-panel {
  width: 100%;
}

.lending-header {
  margin-bottom: 24px;
}

.lending-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

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

.contract-info .label {
  font-weight: 500;
  margin-right: 8px;
}

.contract-info .value {
  font-family: monospace;
  color: var(--color-primary);
}

/* 账户数据 */
.account-data {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-data h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.data-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--color-bg-section);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.data-item .label {
  font-size: 14px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.data-item .value {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
}

.data-item .value.warning {
  color: var(--color-error);
}

/* 系统信息 */
.system-info {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.system-info h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--color-bg-section);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

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

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

/* 操作区域 */
.operations {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  min-height: 300px;
}

.operation-form {
  max-width: 500px;
  margin: 0 auto;
}

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

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

.select-input,
.amount-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.select-input:focus,
.amount-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.info-box {
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.info-box p {
  margin: 0;
  padding: 4px 0;
  color: var(--color-text);
  font-size: 14px;
}

.action-button {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.action-button:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 抵押品明细 */
.collateral-details {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.collateral-details h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.details-table {
  overflow-x: auto;
}

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

.details-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--color-bg-section);
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.details-table td {
  padding: 16px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 14px;
}

.details-table tbody tr:hover {
  background: var(--color-bg-section);
}

/* 连接提示 */
.connect-prompt {
  text-align: center;
  padding: 80px 20px;
  background: var(--color-bg-card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.connect-prompt p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .lending-panel {
    padding: 16px;
  }

  .data-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1 1 auto;
    min-width: 120px;
  }
}
