/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", SimSun, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f0f2f5;
  min-height: 100vh;
}

/* Page Wrapper */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Header */
.page-header {
  background: #1a56a5;
  color: #fff;
  padding: 14px 24px;
  margin-bottom: 0;
}

.page-header h1 {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Form Container */
.form-container {
  background: #fff;
  border: 1px solid #d9d9d9;
  border-top: none;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  border-bottom: 2px solid #1a56a5;
  background: #fff;
  padding: 0 8px;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #1a56a5;
}

.tab-btn.active {
  color: #1a56a5;
  font-weight: bold;
  border-bottom-color: #1a56a5;
}

/* Tab Panels */
.tab-panel {
  display: none;
  padding: 20px 24px;
}

.tab-panel.active {
  display: block;
}

/* Section Box */
.section-box {
  border: 1px solid #d9d9d9;
  margin-bottom: 20px;
}

.section-title {
  background: #f5f7fa;
  border-bottom: 1px solid #d9d9d9;
  padding: 10px 16px;
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

/* Form Table */
.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table tr {
  border-bottom: 1px solid #f0f0f0;
}

.form-table tr:last-child {
  border-bottom: none;
}

.form-label {
  width: 200px;
  padding: 10px 16px;
  text-align: right;
  color: #555;
  font-size: 13px;
  vertical-align: middle;
  background: #fafafa;
  white-space: nowrap;
}

.form-value {
  padding: 8px 16px;
  vertical-align: middle;
}

/* Required Star */
.required-star {
  color: #e02424;
  margin-right: 2px;
}

/* Input Styles */
.input-text,
.input-textarea,
.input-number,
.input-select {
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 13px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.input-text:focus,
.input-textarea:focus,
.input-number:focus,
.input-select:focus {
  border-color: #1a56a5;
  box-shadow: 0 0 0 2px rgba(26, 86, 165, 0.1);
}

.input-text {
  width: 360px;
  height: 30px;
}

.input-text.input-readonly {
  background: #f5f5f5;
  color: #888;
  width: 260px;
}

.input-text.input-highlight {
  border-color: #1a56a5;
}

.input-textarea {
  width: 100%;
  max-width: 720px;
  resize: vertical;
}

.input-number {
  width: 120px;
  text-align: right;
}

.input-select {
  height: 30px;
  background: #fff;
}

.input-select-wide {
  width: 360px;
}

.input-select-currency {
  width: 90px;
  margin-left: 4px;
}

/* Field group (for two-col layouts) */
.field-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-label-side {
  margin-left: 16px;
  white-space: nowrap;
  color: #555;
  font-size: 13px;
}

.unit-label {
  color: #555;
  font-size: 13px;
  margin: 0 4px;
}

/* Tip Text */
.tip-text {
  color: #e02424;
  font-size: 13px;
  padding: 6px 16px 6px 200px;
  line-height: 1.6;
}

/* File Input */
.input-file {
  font-size: 13px;
}

.file-hint {
  display: block;
  margin-top: 4px;
  color: #999;
  font-size: 12px;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #f0f0f0;
}

/* Buttons */
.btn {
  padding: 7px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

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

.btn-default:not(:disabled):hover {
  border-color: #1a56a5;
  color: #1a56a5;
}

.btn-primary {
  background: #1a56a5;
  border-color: #1a56a5;
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: #1648a0;
}

.btn-success {
  background: #1a7a3c;
  border-color: #1a7a3c;
  color: #fff;
}

.btn-success:not(:disabled):hover {
  background: #165f30;
}

/* Loading state */
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Error messages */
.field-error {
  color: #e02424;
  font-size: 12px;
  margin-top: 3px;
  display: block;
}

.input-text.error,
.input-textarea.error,
.input-number.error,
.input-select.error {
  border-color: #e02424;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 4px;
  padding: 40px;
  text-align: center;
  min-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1a7a3c;
  color: #fff;
  font-size: 28px;
  line-height: 60px;
  margin: 0 auto 16px;
}

.modal-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #333;
}

.modal-content p {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .tab-btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .form-label {
    width: 130px;
    font-size: 12px;
  }

  .input-text {
    width: 100%;
    max-width: 300px;
  }

  .field-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-label-side {
    margin-left: 0;
  }

  .tip-text {
    padding-left: 16px;
  }
}
