:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f2f5f9;
  color: #333333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* 柔和的背景渐变 */
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

button, input, textarea {
  font: inherit;
  outline: none;
}

.shell {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 640px) {
  .shell {
    height: 90vh;
    max-height: 800px;
  }
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.login-card {
  padding: 40px 30px;
  margin: auto 0;
}

.brand {
  text-align: center;
  margin-bottom: 36px;
}

.logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%);
  color: white;
  font-size: 32px;
  font-weight: bold;
  border-radius: 24px;
  box-shadow: 0 10px 20px rgba(127, 0, 255, 0.3);
}

h1 {
  font-size: 24px;
  margin: 0 0 8px 0;
  color: #1a1a1a;
}

.brand p {
  margin: 0;
  color: #666;
  font-size: 15px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 20px;
  padding: 16px 20px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

input:focus, textarea:focus {
  border-color: #a881af;
  box-shadow: 0 0 0 4px rgba(168, 129, 175, 0.15), inset 0 2px 4px rgba(0,0,0,0.02);
}

.remember-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
  color: #666;
  cursor: pointer;
}

.remember-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: #a100ff;
  box-shadow: none;
}

button {
  background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 18px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 16px rgba(127, 0, 255, 0.25);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(127, 0, 255, 0.35);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.notice {
  margin-top: 24px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  text-align: center;
}

/* 聊天界面 */
.chat-card {
  height: 100%;
}

.chat-header {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.chat-header h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: #1a1a1a;
}

.chat-header p {
  margin: 0;
  font-size: 13px;
  color: #888;
}

.ghost {
  background: rgba(0, 0, 0, 0.05);
  color: #555;
  box-shadow: none;
  padding: 10px 16px;
  border-radius: 20px;
  margin: 0;
  font-size: 14px;
}

.ghost:hover {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

.messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.4);
}

.msg {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 24px 24px 24px 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  align-self: flex-start;
  color: #333;
}

.msg.mine {
  align-self: flex-end;
  border-radius: 24px 24px 8px 24px;
  background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(127, 0, 255, 0.2);
}

.meta {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.6;
}

.msg.mine .meta {
  opacity: 0.8;
  color: rgba(255,255,255,0.9);
}

.system {
  align-self: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  font-size: 12px;
  color: #666;
  margin: 8px 0;
}

.message-form {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.message-form textarea {
  flex: 1;
  border-radius: 24px;
  padding: 14px 20px;
  max-height: 120px;
  min-height: 52px;
  background: #f8f9fb;
  border: 1px solid transparent;
  box-shadow: none;
}

.message-form textarea:focus {
  background: #ffffff;
  border-color: #d1b3ff;
  box-shadow: 0 0 0 4px rgba(168, 129, 175, 0.1);
}

.message-form button {
  margin: 0;
  padding: 14px 24px;
  height: 52px;
  border-radius: 26px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
