.form-page {
  background: #f7f8fa;
  padding: 16px;
  padding-bottom: 100px;
}

.form-main {
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
}

.form-section {
  margin-bottom: 18px;

  &:last-child {
    margin-bottom: 0;
  }
}

.form-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 16px;
  background: #fff;
  margin-bottom: 12px;
}

.source-tag {
  font-size: 14px;
  padding: 4px 16px;
  border-radius: 16px;
  margin-top: 8px;
  display: inline-block;
}

.form-label {
  font-weight: 600;
  font-size: 16px;
  color: #222;
  display: block;
  margin-bottom: 6px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-top: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  padding-left: 8px;
  position: relative;

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: #1890ff;
    border-radius: 2px;
  }
}

.section-block {
  padding: 12px 0 8px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}

.tabs-bar {
  .adm-tabs-header {
    background: #f7f8fa;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 4px;
  }
  .adm-tabs-tab {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.2s;

    &.adm-tabs-tab-active {
      background: #1890ff;
      color: #fff;
      font-weight: 600;
    }
  }
  .adm-tabs-content {
    padding: 0;
  }
}

.keyword-collapse {
  .adm-collapse-panel-header {
    padding: 0;
    background: transparent;
    border: none;
  }

  .adm-collapse-panel-content {
    padding: 16px 0 0 0;
    background: transparent;
  }

  .form-section {
    margin-bottom: 18px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .form-label {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    display: block;
  }
}

.keyword-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
}

.keyword-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.keyword-arrow {
  font-size: 12px;
  color: #999;
  transition: transform 0.3s;
}

.keyword-collapse .adm-collapse-panel-active .keyword-arrow {
  transform: rotate(180deg);
}

.ai-row,
.section-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-desc {
  color: #666;
  font-size: 14px;
  flex: 1;
  line-height: 1.5;
}

.content-type-header {
  margin-bottom: 12px;
}

.content-type-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.content-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.content-type-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #1890ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;

  &:not(.active) {
    background: #f5f5f5;
    color: #666;
  }

  &:hover {
    opacity: 0.9;
  }

  &.active {
    background: #1890ff;
    color: #fff;
  }
}

.date-row,
.section-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.adm-input {
  min-height: 44px;
  font-size: 15px;
  border-radius: 8px;
}

.time-limit-header {
  margin-bottom: 12px;
}

.time-limit-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.date-inputs {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.date-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-label {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.date-input {
  width: 100%;

  .ant-input {
    background: #f5f5f5;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #222;
    cursor: pointer;

    &:hover {
      border-color: #1890ff;
    }

    &:focus {
      border-color: #1890ff;
      box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
    }
  }
}

.enable-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.enable-label {
  font-size: 15px;
  font-weight: 500;
  color: #222;
}

.device-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;

  &:hover {
    border-color: #1890ff;
  }
}

.device-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;

  .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .avatar-text {
    font-size: 16px;
    color: #fff;
    font-weight: 700;
  }
}

.device-info {
  flex: 1;
  min-width: 0;
}

.device-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.device-name {
  font-size: 15px;
  font-weight: 500;
  color: #222;
}

.device-tag {
  font-size: 12px;
  padding: 2px 8px;
  background: #f5f5f5;
  color: #666;
  border-radius: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;

  &.online {
    background: #52c41a;
  }

  &.offline {
    background: #ff4d4f;
  }
}

.device-wechat-id {
  font-size: 13px;
  color: #888;
}

.device-arrow {
  color: #999;
  font-size: 14px;
}

.device-input-wrapper {
  margin-top: 8px;
}

.device-input {
  width: 100%;
}

.keyword-select {
  width: 100%;

  .ant-select-selector {
    min-height: 44px;
    border-radius: 8px;
  }
}

.submit-btn {
  margin-top: 32px;
  height: 48px !important;
  border-radius: 10px !important;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .form-main {
    max-width: 100vw;
    padding: 0;
  }
  .form-card {
    border-radius: 0;
    box-shadow: none;
    padding: 16px 6px 12px 6px;
  }
  .section-title {
    font-size: 15px;
    margin-top: 22px;
    margin-bottom: 8px;
  }
  .submit-btn {
    height: 44px !important;
    font-size: 15px;
  }
}
