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

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
}

h1 {
  text-align: center;
  font-size: 28px;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}

.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.form-row {
  margin-bottom: 18px;
}

.form-row:last-child {
  margin-bottom: 0;
}

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

.inline-group {
  display: flex;
  gap: 16px;
}

.inline-item {
  flex: 1;
  min-width: 0;
}

.inline-item label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
  font-size: 14px;
}

input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: #333;
  background: #fff;
}

.date-wrap {
  width: 100%;
  overflow: hidden;
}

.inline-item {
  flex: 1;
  min-width: 0;
}

.inline-item input,
.inline-item select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

textarea {
  resize: vertical;
  min-height: 180px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

#specialNumberSelect {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #333;
  background: #fff;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #4f6ef7;
  color: #fff;
}

.btn-primary:hover {
  background: #3d5bd9;
}

.btn-secondary {
  background: #f0f0f0;
  color: #555;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.results-section {
  margin-top: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.results-section h2 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.results-section h3 {
  font-size: 16px;
  margin: 20px 0 10px;
  color: #555;
}

.special-info {
  font-size: 15px;
  color: #555;
  margin-bottom: 12px;
}

.special-info strong {
  color: #d4380d;
  font-size: 18px;
}

.hit td {
  background: #f6ffed;
}

.summary {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.summary-item {
  flex: 1;
  padding: 16px;
  border-radius: 8px;
  background: #f7f8fc;
  text-align: center;
}

.summary-item .label {
  display: block;
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.summary-item .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}

.profit-positive {
  color: #389e0d !important;
}

.profit-negative {
  color: #cf1322 !important;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

thead th {
  background: #f7f8fc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e8e8e8;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.summary-row td {
  background: #fffbe6;
  border-top: 2px solid #ffe58f;
  font-size: 15px;
}

.zodiac-summary {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f7f8fc;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  line-height: 1.9;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.zodiac-summary:empty {
  display: none;
}

@media (max-width: 600px) {
  .container {
    margin: 16px auto;
    padding: 0 8px;
  }

  h1 {
    display: none;
  }

  .subtitle {
    font-size: 12px;
    margin-bottom: 18px;
  }

  .form-section {
    padding: 18px 14px;
  }

  .inline-group {
    flex-direction: column;
    gap: 12px;
  }

  .summary {
    flex-direction: column;
    gap: 10px;
  }

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

  thead th,
  tbody td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .summary-item .value {
    font-size: 22px;
  }

  .results-section {
    padding: 18px 14px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}
