/* ============================================
   科幻风格 AI 下单系统 - 响应式样式
   ============================================ */

:root {
  /* 科幻主题色 */
  --primary-cyan: #00f0ff;
  --primary-purple: #b024ff;
  --primary-pink: #ff006e;
  --bg-dark: #0a0e27;
  --bg-card: #141830;
  --bg-input: #1a1f3a;
  --text-primary: #e0e7ff;
  --text-secondary: #8b92b8;
  --border-glow: rgba(0, 240, 255, 0.3);
  --success: #00ff88;
  --warning: #ffaa00;
}

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

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

/* 动态背景效果 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(0, 240, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(176, 36, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================
   顶部导航栏
   ============================================ */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(20, 24, 48, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  border-radius: 15px;
  margin-bottom: 15px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(
    90deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-cyan);
  animation: rotate 4s linear infinite;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--success);
  border-radius: 20px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 10px var(--success);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 5px var(--success);
  }
}

.status-text {
  font-size: 14px;
  color: var(--success);
}

/* ============================================
   主内容区域
   ============================================ */

.main-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 15px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ============================================
   聊天区域
   ============================================ */

.chat-section {
  display: flex;
  flex-direction: column;
  background: rgba(20, 24, 48, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  margin-bottom: 15px;
  flex-shrink: 0;
}

.chat-header h2 {
  font-size: 16px;
  background: linear-gradient(
    90deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.clear-btn {
  padding: 6px 12px;
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid var(--primary-pink);
  border-radius: 8px;
  color: var(--primary-pink);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: rgba(255, 0, 110, 0.2);
  box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  border-radius: 10px;
}

.message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.bot-message .message-avatar {
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  color: white;
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .message-avatar {
  background: linear-gradient(
    135deg,
    var(--primary-pink),
    var(--primary-purple)
  );
  color: white;
}

.message-content {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.5;
  font-size: 14px;
}

.bot-message .message-content {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.user-message .message-content {
  background: rgba(176, 36, 255, 0.1);
  border: 1px solid rgba(176, 36, 255, 0.3);
}

/* 支付按钮 */
.pay-button {
  margin-top: 10px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #00ff88, #00d9ff);
  border: none;
  border-radius: 8px;
  color: #0a0e27;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.pay-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 136, 0.5);
  background: linear-gradient(135deg, #00ff88, #00e5ff);
}

.pay-button:active {
  transform: translateY(0);
}

.pay-button svg {
  flex-shrink: 0;
}

/* 聊天输入区 */
.chat-input-area {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   订单区域
   ============================================ */

.order-section {
  display: flex;
  flex-direction: column;
  background: rgba(20, 24, 48, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(176, 36, 255, 0.1);
  min-height: 0;
  overflow: hidden;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(176, 36, 255, 0.2);
  margin-bottom: 15px;
  flex-shrink: 0;
}

.order-header h2 {
  font-size: 16px;
  background: linear-gradient(
    90deg,
    var(--primary-purple),
    var(--primary-pink)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-panel-btn {
  display: none;
  background: none;
  border: none;
  color: var(--primary-pink);
  cursor: pointer;
  padding: 4px;
  transition: all 0.3s ease;
}

.close-panel-btn:hover {
  transform: scale(1.1);
}

.close-panel-btn:active {
  transform: scale(0.95);
}

/* 订单表单 */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.order-form::-webkit-scrollbar {
  width: 6px;
}

.order-form::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.order-form::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--primary-purple),
    var(--primary-pink)
  );
  border-radius: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.form-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(176, 36, 255, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 15px rgba(176, 36, 255, 0.2);
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-input::-webkit-outer-spin-button,
.form-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-input[type="number"] {
  -moz-appearance: textfield;
}

.form-total {
  padding: 15px;
  background: rgba(176, 36, 255, 0.1);
  border: 1px solid rgba(176, 36, 255, 0.3);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  flex-shrink: 0;
}

.total-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.total-value {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(
    90deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.4);
}

.checkout-btn:active {
  transform: translateY(0);
}

/* ============================================
   聊天区域 Typing Indicator
   ============================================ */

.typing-indicator {
  display: none;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

.typing-indicator.active {
  display: flex;
}

.typing-indicator .message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-purple)
  );
  color: white;
}

.typing-indicator .message-content {
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-cyan);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-text {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ============================================
   移动端浮动按钮和遮罩层
   ============================================ */

.mobile-order-btn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-purple),
    var(--primary-pink)
  );
  border: none;
  box-shadow: 0 4px 20px rgba(176, 36, 255, 0.4);
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
}

.mobile-order-btn:active {
  transform: scale(0.95);
}

.mobile-order-btn svg {
  color: white;
}

.order-badge-mobile {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary-cyan);
  color: var(--bg-dark);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.4);
}

.order-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(5px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.order-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   响应式设计 - 平板
   ============================================ */

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 320px;
  }

  .logo span {
    font-size: 18px;
  }

  .message-content {
    max-width: 80%;
  }

  .order-section {
    padding: 18px;
  }
}

/* ============================================
   响应式设计 - 手机端
   ============================================ */

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

  .container {
    padding: 8px;
  }

  .header {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .logo {
    font-size: 14px;
    gap: 8px;
  }

  .logo-icon {
    width: 26px;
    height: 26px;
  }

  .status-text {
    display: none;
  }

  .status-indicator {
    padding: 6px 10px;
  }

  .status-dot {
    width: 8px;
    height: 8px;
  }

  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 0;
  }

  .chat-section {
    padding: 12px;
  }

  /* 订单面板滑出效果 */
  .order-section {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    padding: 16px;
    z-index: 1000;
    transition: right 0.3s ease;
    border-radius: 0;
    border-left: 2px solid var(--border-glow);
    box-shadow: -5px 0 30px rgba(176, 36, 255, 0.3);
  }

  .order-section.active {
    right: 0;
  }

  /* 显示关闭按钮 */
  .close-panel-btn {
    display: block;
  }

  /* 显示浮动按钮 */
  .mobile-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chat-header h2,
  .order-header h2 {
    font-size: 14px;
  }

  .clear-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .message-content {
    max-width: 85%;
    font-size: 13px;
    padding: 8px 12px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .chat-input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  .send-btn svg {
    width: 18px;
    height: 18px;
  }

  .form-group label {
    font-size: 11px;
  }

  .form-input {
    padding: 9px 12px;
    font-size: 13px;
  }

  .form-total {
    padding: 12px;
  }

  .total-label {
    font-size: 12px;
  }

  .total-value {
    font-size: 18px;
  }

  .checkout-btn {
    padding: 11px;
    font-size: 13px;
  }

  .pay-button {
    padding: 9px 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .header {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .logo {
    font-size: 14px;
  }

  .clear-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .chat-section {
    padding: 12px;
  }

  .order-section {
    padding: 12px;
  }

  .checkout-btn {
    padding: 12px;
    font-size: 14px;
  }

  .main-content {
    gap: 8px;
  }
}
