:root {
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --text: #2d3436;
  --muted: #8a94a6;
  --primary: #6c5ce7;
  --primary-dark: #5846d6;
  --border: #e5e8f0;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(44, 62, 80, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部 */
.site-header {
  text-align: center;
  padding: 40px 16px 8px;
}

.site-header h1 {
  font-size: 30px;
  letter-spacing: 1px;
}

.subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 15px;
}

/* 主体布局 */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  flex: 1;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}

.tab {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 面板 */
.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 26px;
  text-align: center;
}

blockquote {
  font-size: 20px;
  font-weight: 600;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meta {
  color: var(--muted);
  margin-top: 14px;
  font-size: 14px;
}

/* 颜色 */
.color-box {
  height: 180px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  border: 1px solid var(--border);
}

.color-hex {
  background: rgba(255, 255, 255, 0.9);
  color: #2d3436;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 22px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* 数字 */
.number-range {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.number-range label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.number-range input {
  width: 110px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.number-range input:focus {
  border-color: var(--primary);
}

.number-result {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 笑话 */
.joke-text {
  font-size: 17px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 按钮 */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 26px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

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

/* 页脚 */
.site-footer {
  text-align: center;
  padding: 18px 16px 30px;
  color: var(--muted);
  font-size: 13px;
}

/* Toast 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(80px);
  background: #2d3436;
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .site-header {
    padding-top: 28px;
  }

  .site-header h1 {
    font-size: 24px;
  }

  .card {
    padding: 24px 18px;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .number-range {
    flex-direction: column;
    align-items: center;
  }
}
