:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: #1d1d1f;
  background: #f7f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(145deg, #f7f7f8, #f2f2f7, #f7f7f8);
}

button,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  cursor: pointer;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .35);
  outline-offset: 2px;
}

#root {
  width: 100%;
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 390px);
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(35, 47, 75, .14);
}

.login-label {
  display: block;
  margin: 22px 0 8px;
  color: #42ada9;
  font-size: .95rem;
  font-weight: 700;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid #c7c7cc;
  border-radius: 10px;
  background: #fff;
  color: #1d1d1f;
  font-size: 1rem;
  font-weight: 600;
}

.login-input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .16);
}

.verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.code-btn {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(0, 122, 255, .25);
  border-radius: 10px;
  background: rgba(0, 122, 255, .1);
  color: #007aff;
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
}

.code-btn:hover {
  border-color: #007aff;
  background: rgba(0, 122, 255, .18);
}

.login-notice {
  margin-top: 10px;
  color: #34a853;
  font-size: .9rem;
  font-weight: 600;
}

.login-error {
  margin-top: 10px;
  color: #ff3b30;
  font-size: .9rem;
  font-weight: 600;
}

.login-btn {
  width: 100%;
  height: 44px;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: #007aff;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.login-btn:hover {
  background: #0056d6;
}

.switch-control-container {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  color: #1d1d1f;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.6;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-title {
  margin: 0;
  color: #58bce7;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .04em;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 1px 12px;
  border-radius: 6px;
  border-color: rgba(0, 122, 255, .25);
  background: rgba(0, 122, 255, .1);
  color: #007aff;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.action-btn:hover {
  transform: scale(1.05);
  border-color: #007aff;
  background: rgba(0, 122, 255, .18);
  box-shadow: 0 1px 3px rgba(0, 122, 255, .15);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 150px;
}

.deadline-label,
.deadline-value {
  color: #42ada9;
}

.deadline-label {
  font-size: .86rem;
  font-weight: 500;
}

.deadline-value {
  margin-top: 4px;
  font-size: .9rem;
  font-weight: 700;
  text-align: right;
}

.section {
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(245, 245, 250, .7));
  border: none;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(35, 47, 75, .12), 0 2px 8px rgba(71, 84, 107, .08);
}

.section-header {
  min-height: 58px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-bottom: 1px solid #e5e5e7;
  border-radius: 16px 16px 0 0;
  background: #f2f2f7;
  transition: background .2s ease;
}

.section-header:hover {
  background: #e5e5e7;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-title {
  margin: 0;
  color: #1d1d1f;
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: 600;
}

.section-type-0 .section-header {
  background: linear-gradient(90deg, #fef3c7, #fef1c7);
}

.section-type-1 .section-header {
  background: linear-gradient(90deg, #dbeafe, #dbeafe);
}

.section-type-2 .section-header {
  background: linear-gradient(90deg, #dcfce7, #dcfce7);
}

.section-type-3 .section-header {
  background: linear-gradient(90deg, #fecdd3, #fecdd3);
}

.section-type-4 .section-header {
  background: linear-gradient(90deg, #e9d5ff, #e9d5ff);
}

.status-section .section-header {
  border-left: 4px solid #007aff;
  background: linear-gradient(90deg, #e0f2fe, #bae6fd);
}

.section-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  opacity: 0;
  background: rgba(255, 255, 255, .3);
  transition: max-height .35s ease, opacity .25s ease, padding .35s ease;
}

.section-content.expanded {
  max-height: 1100px;
  padding: 12px 16px;
  opacity: 1;
  background: rgba(255, 255, 255, .55);
}

.toggle-icon {
  color: #007aff;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.online-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .9rem;
  font-weight: 600;
}

.online-status.online {
  color: #34c759;
}

.online-status.offline {
  color: #ff3b30;
}

.status-content {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: linear-gradient(135deg, rgba(50, 115, 246, .95), rgba(63, 41, 131, .92));
  box-shadow: inset 0 0 10px rgba(0, 0, 0, .15), 0 4px 12px rgba(0, 0, 0, .2);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 1px 0;
  flex-wrap: wrap;
}

.status-row.area-row {
  justify-content: space-between;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.status-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.status-label {
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
}

.status-label.protector {
  color: #ffea00;
  font-size: .95rem;
  letter-spacing: .5px;
}

.feature-row {
  min-height: 53px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(142, 142, 147, .15);
  background: rgba(242, 242, 247, .3);
  transition: background .2s ease;
}

.feature-row:nth-child(odd) {
  background: rgba(255, 255, 255, .2);
}

.feature-row:hover {
  background: rgba(0, 122, 255, .05);
}

.feature-label {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: .96rem;
  line-height: 1.35;
  font-weight: 600;
  text-align: left;
}

.feature-info {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #007aff;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  transition: transform .12s ease, color .2s ease;
}

.feature-info:hover {
  transform: scale(1.15);
  color: #0056d6;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background-color: #e5e5e7;
  cursor: pointer;
  transition: .3s;
}

.slider::before {
  position: absolute;
  content: "";
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: .3s;
}

input:checked + .slider {
  background-color: #34c759;
}

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

select,
.custom-select-button {
  max-width: 180px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #c7c7cc;
  background: rgba(255, 255, 255, .9);
  color: #1d1d1f;
  font-size: .9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  transition: box-shadow .2s ease, border-color .2s ease;
}

select:focus,
.custom-select-button:hover {
  border-color: #007aff;
  box-shadow: 0 2px 6px rgba(0, 122, 255, .2);
}

.number-select {
  width: 100px;
  max-width: 100px;
  text-align: center;
  font-weight: 700;
}

.number-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: #1d1d1f;
  font-size: .9rem;
  font-weight: 700;
}

.number-input {
  width: 78px;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid #c7c7cc;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  color: #1d1d1f;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

.number-input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 2px 6px rgba(0, 122, 255, .2);
}

.custom-select-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.custom-select-arrow {
  color: #007aff;
  font-size: .7rem;
}

.section-config-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-config-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 60px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 122, 255, .3);
  background: rgba(0, 122, 255, .08);
  color: #007aff;
  line-height: 1;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.section-config-btn:hover {
  transform: translateY(-2px);
  border-color: #007aff;
  background: rgba(0, 122, 255, .15);
  box-shadow: 0 2px 6px rgba(0, 122, 255, .2);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1002;
  padding: 20px;
  background: rgba(0, 0, 0, .4);
}

.modal-content {
  width: min(90vw, 420px);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
}

.modal-content h2,
.modal-content h3 {
  margin: 0 0 16px;
  color: #1d1d1f;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 700;
}

.modal-content p {
  margin: 0 0 16px;
  color: #333;
  font-size: .95rem;
  line-height: 1.5;
}

.modal-action,
.contact-close-btn,
.diana-close-btn,
.enum-close-btn,
.image-close-btn {
  min-height: 40px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #007aff;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  transition: background .2s ease, box-shadow .2s ease;
}

.modal-action:hover,
.contact-close-btn:hover,
.diana-close-btn:hover,
.enum-close-btn:hover,
.image-close-btn:hover {
  background: #0056d6;
  box-shadow: 0 2px 8px rgba(0, 122, 255, .3);
}

.announcement-section {
  margin: 0 0 24px;
  padding: 16px;
  border-left: 4px solid #58bce7;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(88, 188, 231, .1), rgba(63, 41, 131, .08));
  text-align: center;
}

.announcement-subtitle {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.buy-btn {
  min-height: 32px;
  margin: 3px;
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  background: #ff9800;
  color: #fff;
  font-size: 1em;
  font-weight: 500;
  transition: background .2s;
}

.buy-btn:hover {
  background: #e67c00;
}

.contact-info {
  margin: 20px 0;
  text-align: center;
}

.contact-subtitle {
  margin: 0;
  color: #1d1d1f;
  font-size: 1.5rem;
  font-weight: 600;
}

.enum-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.enum-option-btn {
  min-height: 46px;
  padding: 12px 16px;
  border: 2px solid #c7c7cc;
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  color: #1d1d1f;
  font-size: .95rem;
  font-weight: 500;
  transition: all .2s ease;
}

.enum-option-btn:hover,
.enum-option-btn.selected {
  border-color: #007aff;
  background: rgba(0, 122, 255, .2);
  color: #007aff;
}

.diana-settings-body {
  margin-bottom: 12px;
}

.wild-modal .feature-row {
  margin-bottom: 10px;
  border-radius: 10px;
}

.wild-modal .modal-action {
  display: block;
  min-width: 96px;
  margin: 16px auto 0;
}

.diana-row {
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(242, 242, 247, .5);
}

.demo-image {
  display: block;
  max-width: 300px;
  max-height: 50vh;
  margin: 0 auto 15px;
  border-radius: 8px;
}

.loading-overlay,
.deadline-warning-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(0, 0, 0, .4);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top-color: #58bce7;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading-overlay p {
  margin-top: 20px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
}

.deadline-warning-overlay {
  z-index: 9999;
}

.deadline-warning-modal {
  padding: 24px 32px;
  border-radius: 12px;
  background: #fff;
  color: #d32f2f;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  animation: fadeIn .3s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1005;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(29, 29, 31, .92);
  color: #fff;
  font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.version-tag {
  margin-top: 20px;
  color: #999;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

input:disabled,
button:disabled,
select:disabled {
  opacity: .5;
  cursor: not-allowed;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .switch-control-container,
  .feature-label,
  .status-label,
  .section-title,
  select {
    font-size: 14px;
  }

  .feature-row {
    gap: 10px;
    padding-inline: 16px;
  }

  select {
    max-width: 60%;
  }
}
