/* 全局重置与基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  line-height: 1.5;
}

/* ========== 登录/注册页 ========== */
.auth-body {
  background: #36393f;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  color: #fff;
}

.auth-form {
  width: 100%;
  max-width: 400px;
  background: #2f3136;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  color: #fff;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: #40444b;
  border: 1px solid #4f545c;
  border-radius: 4px;
  color: white;
  font-size: 16px;
}

.auth-form input:focus {
  outline: none;
  border-color: #7289da;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  background: #5865f2;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-form button:hover:not(:disabled) {
  background: #4752c4;
}

.auth-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  text-align: center;
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
  color: #43b581;
}

.status.error {
  color: #ed4245;
}

.switch {
  text-align: center;
  margin-top: 16px;
  color: #b9bbbe;
  font-size: 14px;
}

.switch a {
  color: #00aff4;
  text-decoration: none;
  cursor: pointer;
}

.switch a:hover {
  text-decoration: underline;
}

/* ========== 主应用页面 ========== */
.app-body {
  background: #36393f;
  color: #dcddde;
  min-height: 100vh;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 10px;
}

.header-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  color: white;
}

.btn.primary {
  background: #5865f2;
}

.btn.primary:hover {
  background: #4752c4;
}

.btn.secondary {
  background: #4f545c;
}

.btn.secondary:hover {
  background: #6a7179;
}

.btn.logout {
  background: #f04747;
}

.btn.logout:hover {
  background: #d83c3c;
}

.messages {
  height: 60vh;
  overflow-y: auto;
  background: #2f3136;
  border: 1px solid #4f545c;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.message {
  padding: 8px 0;
  font-size: 14px;
  word-break: break-word;
}

.message.system {
  color: #7289da;
  font-style: italic;
  text-align: center;
}

.input-area {
  display: flex;
  gap: 8px;
}

.input-area input {
  flex: 1;
  padding: 10px;
  background: #40444b;
  border: 1px solid #4f545c;
  border-radius: 4px;
  color: white;
  font-size: 14px;
}

.input-area input:focus {
  outline: none;
  border-color: #7289da;
}

.input-area button {
  padding: 10px 16px;
}

/* ========== 关于弹窗 (Modal) ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #2f3136;
  color: #dcddde;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #4f545c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

#close-about {
  background: none;
  border: none;
  color: #b9bbbe;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-about:hover {
  color: white;
}

.about-text {
  padding: 16px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #b9bbbe;
}

/* ========== 响应式优化 ========== */
@media (max-width: 600px) {
  .header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .messages {
    height: 50vh;
  }

  .input-area {
    flex-direction: column;
  }

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