﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family:
    "Zen Maru Gothic",
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background: radial-gradient(circle at top, #2e2f3e 0%, #171821 100%);
  color: #e2e8f0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom)) 20px;
  position: relative;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.app-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 10px rgba(108, 92, 231, 0.4);
}
.status-indicator {
  font-size: 0.8rem;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a29bfe;
  transition: all 0.3s ease;
}
.status-indicator.ready {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.05);
}
.main-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 25px;
}
.avatar-container {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, #6c5ce7, #fd79a8);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(108, 92, 231, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}
.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 4px solid #171821;
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}
.avatar-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 3px solid #6c5ce7;
  opacity: 0;
  transition: all 0.3s ease;
}
.speaking-state .avatar-ring {
  animation: ripple 1.6s infinite ease-out;
  opacity: 1;
}
.subtitle-container {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  gap: 8px;
}
.subtitle-text {
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 700;
  color: #f1f5f9;
}
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a29bfe;
  animation: bounce 1s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}
.controls-section {
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}
.button-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.action-btn {
  width: 85%;
  max-width: 320px;
  height: 64px;
  border-radius: 32px;
  border: none;
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.action-btn:active {
  transform: scale(0.95);
}
.record-btn {
  background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
  box-shadow: 0 6px 20px rgba(232, 67, 147, 0.4);
}
.record-btn:disabled {
  background: #4a5568;
  box-shadow: none;
  color: #a0aec0;
  cursor: not-allowed;
}
.stop-btn {
  background: linear-gradient(135deg, #d63031 0%, #ff7675 100%);
  box-shadow: 0 6px 20px rgba(214, 48, 49, 0.4);
}
.text-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 8px 8px 16px;
  backdrop-filter: blur(10px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.text-input-wrapper:focus-within {
  border-color: rgba(108, 92, 231, 0.6);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.text-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-family: "Zen Maru Gothic", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}
.text-input::placeholder {
  color: #64748b;
}
.text-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.6);
}
.send-btn:active {
  transform: scale(0.93);
}
.send-btn:disabled {
  background: #4a5568;
  box-shadow: none;
  color: #718096;
  cursor: not-allowed;
  transform: none;
}
.info-bar {
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
}
.hidden {
  display: none !important;
}
.app-footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}
.footer-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.footer-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.history-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75%;
  background: #1e1e2d;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 100;
  animation: slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.history-header h3 {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
}
.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.chat-bubble.user {
  align-self: flex-end;
}
@keyframes ripple {
  0% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.05);
    opacity: 0;
  }
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
