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

body {
  font-family: 'ZCOOL KuaiLe', 'Comic Sans MS', cursive, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #E8F4FD 0%, #F0E6FF 50%, #FFE8F0 100%);
  overflow-x: hidden;
  position: relative;
}

/* ===== 背景装饰 ===== */
.cloud {
  position: fixed;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  z-index: 0;
  pointer-events: none;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-1 {
  width: 200px; height: 60px;
  top: 5%; left: -5%;
  animation: floatCloud 20s ease-in-out infinite;
}
.cloud-1::before {
  width: 80px; height: 80px;
  top: -40px; left: 30px;
}
.cloud-1::after {
  width: 100px; height: 100px;
  top: -50px; left: 80px;
}
.cloud-2 {
  width: 150px; height: 50px;
  top: 15%; right: -5%;
  animation: floatCloud 25s ease-in-out infinite reverse;
}
.cloud-2::before {
  width: 60px; height: 60px;
  top: -30px; left: 20px;
}
.cloud-2::after {
  width: 80px; height: 80px;
  top: -40px; left: 60px;
}
.cloud-3 {
  width: 180px; height: 55px;
  bottom: 10%; left: 20%;
  animation: floatCloud 22s ease-in-out infinite 5s;
}
.cloud-3::before {
  width: 70px; height: 70px;
  top: -35px; left: 25px;
}
.cloud-3::after {
  width: 90px; height: 90px;
  top: -45px; left: 70px;
}

@keyframes floatCloud {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(50px); }
}

.stars {
  position: fixed;
  top: 20px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  font-size: 24px;
  z-index: 0;
  pointer-events: none;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== 容器 ===== */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ===== 头部 ===== */
.header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}
.header-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 8px;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.title {
  font-size: 36px;
  color: #FF6B6B;
  text-shadow: 2px 2px 0 #FFE66D, 4px 4px 0 rgba(0,0,0,0.1);
  letter-spacing: 2px;
}
.subtitle {
  font-size: 16px;
  color: #8888AA;
  margin-top: 4px;
}

/* ===== 主卡片 ===== */
.main-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border: 2px solid rgba(255,255,255,0.5);
}

/* ===== 输入区 ===== */
.input-section {
  margin-bottom: 8px;
}
.input-label {
  display: block;
  font-size: 18px;
  color: #555;
  margin-bottom: 12px;
}
.sentence-input {
  width: 100%;
  padding: 16px 20px;
  border: 3px solid #E0D6FF;
  border-radius: 16px;
  font-family: inherit;
  font-size: 18px;
  color: #333;
  background: #FAFAFF;
  resize: vertical;
  transition: border-color 0.3s;
  outline: none;
}
.sentence-input:focus {
  border-color: #FF6B6B;
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}
.sentence-input::placeholder {
  color: #C0C0D0;
  font-size: 16px;
}
.char-count {
  text-align: right;
  font-size: 13px;
  color: #AAA;
  margin-top: 4px;
  margin-right: 4px;
}

/* ===== 例句 ===== */
.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 20px;
}
.example-label {
  font-size: 14px;
  color: #999;
  white-space: nowrap;
}
.example-chip {
  padding: 6px 14px;
  border: 2px solid #D0D0E8;
  border-radius: 20px;
  background: white;
  font-family: inherit;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.example-chip:hover {
  border-color: #FF6B6B;
  color: #FF6B6B;
  background: #FFF5F5;
  transform: scale(1.05);
}

/* ===== 扩句按钮 ===== */
.expand-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  font-family: inherit;
  font-size: 22px;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  position: relative;
  overflow: hidden;
}
.expand-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}
.expand-btn:active {
  transform: translateY(0);
}
.expand-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.btn-loading .dot {
  animation: dotBounce 1.2s infinite;
  font-size: 32px;
  line-height: 1;
}
.btn-loading .dot-2 { animation-delay: 0.2s; }
.btn-loading .dot-3 { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 80%, 100% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-8px); }
}
.hidden { display: none !important; }

/* ===== 结果区 ===== */
.result-section {
  margin-top: 24px;
  animation: fadeInUp 0.5s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-divider {
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}
.result-divider::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, #FFD0D0, #FFE66D, #FFD0D0, transparent);
  position: relative;
  top: 12px;
}
.divider-text {
  background: white;
  padding: 0 16px;
  font-size: 18px;
  color: #FF6B6B;
  position: relative;
  z-index: 1;
}

.result-box {
  background: #FAFAFF;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 2px solid #EEE;
}
.result-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.result-content {
  font-size: 20px;
  color: #333;
  line-height: 1.6;
}
.expanded-text {
  color: #FF6B6B;
  font-size: 22px;
}

.additions-box {
  background: linear-gradient(135deg, #FFF5F5, #FFFDE7);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 2px solid #FFE0B2;
}
.additions-title {
  font-size: 16px;
  color: #FF8E53;
  margin-bottom: 10px;
}
.additions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.addition-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #555;
  flex-wrap: wrap;
}
.addition-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: #FFE0B2;
  color: #E65100;
}
.addition-before {
  color: #999;
  text-decoration: line-through;
}
.addition-after {
  color: #FF6B6B;
  font-weight: bold;
}
.addition-arrow {
  color: #CCC;
}

.explanation-box {
  background: linear-gradient(135deg, #E3F2FD, #F3E5F5);
  border-radius: 16px;
  padding: 16px 20px;
  border: 2px solid #BBDEFB;
}
.explanation-title {
  font-size: 16px;
  color: #5C6BC0;
  margin-bottom: 8px;
}
.explanation-text {
  font-size: 16px;
  color: #444;
  line-height: 1.7;
}

/* ===== 错误提示 ===== */
.error-box {
  background: #FFF0F0;
  border: 2px solid #FFCDD2;
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: shake 0.5s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.error-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.error-text {
  font-size: 15px;
  color: #C62828;
}

/* ===== 底部 ===== */
.footer {
  text-align: center;
  margin-top: 24px;
  padding: 16px;
  color: #AAA;
  font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 500px) {
  .container { padding: 12px; }
  .main-card { padding: 20px; }
  .title { font-size: 28px; }
  .sentence-input { font-size: 16px; }
  .expand-btn { font-size: 18px; }
}
