body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif,
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
}

.animate-progress {
  animation: progress 20s linear forwards;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 24px;
}
.switch-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
.switch input:checked + .switch-slider {
  background-color: #d97706;
}
.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Date picker */
.date-input-wrapper {
  position: relative;
  display: block;
  width: 100%;
}
.date-input-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}
.picker-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}
.picker-modal.active {
  transform: translateY(0);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  backdrop-filter: blur(2px);
}
.modal-backdrop.active {
  display: block;
}
.picker-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}
.picker-title {
  font-size: 18px;
  font-weight: 600;
}
.picker-actions {
  display: flex;
  gap: 10px;
}
.picker-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 500;
}
.picker-cancel {
  background: #f5f5f5;
}
.picker-confirm {
  background: #ff6b6b;
  color: #fff;
  font-weight: 600;
}
.calendar-info {
  padding: 15px 20px;
  text-align: center;
  font-size: 16px;
  color: #333;
  font-weight: 500;
  border-bottom: 1px solid #eee;
}
.wheel-wrapper {
  display: flex;
  height: 240px;
  position: relative;
  overflow: hidden;
}
.wheel-column {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.wheel-scroll {
  list-style: none;
  position: absolute;
  width: 100%;
  top: 100px;
  left: 0;
  margin: 0;
  padding: 0;
  z-index: 5;
}
.wheel-item {
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 17px;
  font-weight: 500;
  color: #888;
  line-height: 40px;
  position: relative;
  z-index: 10;
  white-space: nowrap;
  padding: 0 6px;
}
.wheel-item.active {
  color: #333 !important;
  font-weight: 600;
  z-index: 20;
}
.wheel-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0) 75%,
    rgba(255, 255, 255, 0.9) 100%
  );
  z-index: 10;
}
.wheel-highlight {
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  height: 40px;
  border-radius: 8px;
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: #ffebee;
  border: 1px solid #ffcdd2;
}
.style-1 .wheel-column:nth-child(2) .wheel-highlight {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}
.style-1 .wheel-column:nth-child(3) .wheel-highlight {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
}
.style-1 .wheel-column:nth-child(4) .wheel-highlight {
  background: #f3e5f5;
  border: 1px solid #ce93d8;
}
@media (max-width: 600px) {
  .picker-modal {
    max-width: 100%;
  }
  .wheel-column:nth-child(1),
  .wheel-column:nth-child(2),
  .wheel-column:nth-child(3) {
    flex: 0 0 20%;
  }
  .wheel-column:nth-child(4) {
    flex: 0 0 40%;
  }
  .wheel-item {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
  }
}

/* Tabs */
.tabs-list {
  display: grid;
  width: 100%;
  background: #fef3c7;
  border-radius: 0.5rem;
  padding: 0.25rem;
  gap: 0.25rem;
}
.tabs-list.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.tabs-list.cols-1 {
  grid-template-columns: 1fr;
}
.tab-trigger {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #92400e;
  transition: background 0.15s, color 0.15s;
}
.tab-trigger.active {
  background: #d97706;
  color: #fff;
}
.tab-panel {
  display: none;
  margin-top: 1rem;
}
.tab-panel.active {
  display: block;
}

/* Markdown */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  font-weight: 600;
  margin-top: 0.75em;
  margin-bottom: 0.25em;
}
.markdown-content h1 { font-size: 1.25em; }
.markdown-content h2 { font-size: 1.1em; }
.markdown-content h3 { font-size: 1em; }
.markdown-content p { margin: 0.5em 0; }
.markdown-content ul,
.markdown-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.markdown-content li { margin: 0.25em 0; }
.markdown-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}
.markdown-content pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.5em 0;
}
.markdown-content pre code {
  background: none;
  padding: 0;
}
.markdown-content blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 0.75em;
  margin: 0.5em 0;
  color: #6b7280;
}
.markdown-content strong { font-weight: 600; }
.markdown-content a {
  color: #d97706;
  text-decoration: underline;
}
.markdown-content table {
  border-collapse: collapse;
  margin: 0.5em 0;
  width: 100%;
}
.markdown-content th,
.markdown-content td {
  border: 1px solid #d1d5db;
  padding: 0.25em 0.5em;
}
.markdown-content th {
  background: rgba(0, 0, 0, 0.03);
}

#loading-screen.hidden {
  display: none !important;
}

#back-to-top.hidden-btn {
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
}

.palace-card-details.hidden {
  display: none;
}

.gong-card-details.hidden {
  display: none;
}
