/* 基础样式 */
body {
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: #2d2d2d;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.role-selector h2 {
    color: #00ffcc;
    margin-bottom: 20px;
}

.preset-roles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.preset-roles button {
    background: #444;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-roles button:hover {
    background: #00ffcc;
    color: #000;
    transform: translateY(-2px);
}

.custom-role {
    background: #333;
    padding: 15px;
    border-radius: 8px;
}

.custom-role h3 {
    color: #00ffcc;
    margin-bottom: 10px;
}

.custom-role input,
.custom-role textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #444;
    color: #fff;
}

.custom-role textarea {
    height: 80px;
    resize: none;
}

#add-custom-role {
    width: 100%;
    background: #00ffcc;
    color: #000;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#add-custom-role:hover {
    background: #00e6b8;
}

/* 聊天区域样式 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  padding: 15px;
  border-bottom: 1px solid #ff7e7e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-header h1 {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.user-info {
  background: rgba(255,255,255,0.2);
  padding: 8px 15px;
  border-radius: 20px;
}

#logout-btn {
  background: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.5);
  color: white;
  padding: 5px 15px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#logout-btn:hover {
  background: rgba(255,255,255,0.5);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

#username-display {
  font-weight: bold;
  color: #333;
}

#logout-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

#logout-btn:hover {
  background-color: #c82333;
}

.chat-header h1 {
    color: #00ffcc;
    margin: 0;
}

.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #222;
}

.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    max-width: 70%;
}

.user-message {
    background: #00ffcc;
    color: #111;
    margin-left: auto;
}

.user-message .message-text {
    color: #111;
}

.assistant-message {
    background: #444;
    color: #fff;
    margin-right: auto;
}

.system-message {
    background: #333;
    color: #aaa;
    margin: 10px auto;
    text-align: center;
    padding: 8px;
    font-size: 0.9em;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-role {
    font-weight: bold;
    color: #00ffcc;
    margin-bottom: 5px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    color: #eee;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

/* 输入区域样式 */
.input-area {
    background: #2d2d2d;
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

#user-input {
    flex: 1;
    height: 40px;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 8px;
    background: #444;
    color: #fff;
    resize: none;
}

#send-btn {
    background: #00ffcc;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background: #00e6b8;
}

/* 加载指示器 */
.loading-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    color: #00ffcc;
    margin-left: 10px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #00ffcc;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 登录/注册容器 */
.login-container,
.register-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #666;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

button[type="submit"] {
  width: 100%;
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background-color: #0056b3;
}

/* 链接样式 */
p {
  text-align: center;
  margin-top: 15px;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 会员仪表盘样式 */
.dashboard-container {
  max-width: 1200px;
  margin: 50px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  color: #333;
  margin: 0;
}

.dashboard-nav {
  display: flex;
  gap: 20px;
}

.dashboard-nav a {
  color: #007bff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s;
}

.dashboard-nav a:hover {
  background-color: #007bff;
  color: white;
}

.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
  color: #333;
  margin-top: 0;
}

.dashboard-card p {
  color: #666;
  line-height: 1.6;
}

.dashboard-footer {
  margin-top: 30px;
  text-align: center;
  color: #666;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
