/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f0f8ff;  /* 极淡天蓝背景 */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.container {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 30px 20px;
    border: 1px solid #e0eef5;
    border-radius: 12px;          /* 轻微圆角，现代感 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin: 0 auto;
}

h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 500;
    font-size: 26px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #4a6a8e;
    font-size: 15px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cce0ed;
    font-size: 16px;
    outline: none;
    background: white;
    -webkit-appearance: none;
    border-radius: 8px;
    transition: border 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #5c9ce5;
    box-shadow: 0 0 0 2px rgba(92,156,229,0.1);
}

button {
    width: 100%;
    padding: 14px;
    background: #5c9ce5;  /* 天蓝主色 */
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-appearance: none;
    border-radius: 8px;
    touch-action: manipulation;
}

button:hover {
    background: #4a7fc9;
}

.link {
    text-align: center;
    margin-top: 20px;
    color: #6c8fb3;
    font-size: 15px;
}

.link a {
    color: #5c9ce5;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border 0.2s;
}

.link a:hover {
    border-bottom-color: #5c9ce5;
}

/* 按钮组 (登录首页用) */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.button-group button {
    flex: 1;
}

.btn-primary {
    background: #5c9ce5;
    color: white;
}

.btn-primary:hover {
    background: #4a7fc9;
}

.btn-secondary {
    background: #f0f4f8;
    color: #2c3e50;
    border: 1px solid #cce0ed;
}

.btn-secondary:hover {
    background: #e6edf4;
}

/* 聊天页面 */
.chat-container {
    max-width: 600px;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    border: none;
    border-radius: 0;
}

.chat-header {
    padding: 15px 20px;
    background: #f8fafd;
    border-bottom: 1px solid #e0eef5;
}

.chat-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fdfe;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message.me {
    align-items: flex-end;
}

.message.other {
    align-items: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e0eef5;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.4;
}

.message.me .message-bubble {
    background: #5c9ce5;
    color: white;
    border-color: #5c9ce5;
}

.message-time {
    font-size: 12px;
    color: #8ba9c9;
    margin-top: 5px;
    margin-left: 8px;
    margin-right: 8px;
}

.system-message {
    text-align: center;
    color: #8ba9c9;
    font-size: 14px;
    margin: 10px 0;
}

.chat-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0eef5;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #cce0ed;
    border-radius: 30px;
    font-size: 16px;
}

.chat-input-area input:focus {
    border-color: #5c9ce5;
}

.chat-input-area button {
    width: auto;
    padding: 12px 25px;
    background: #5c9ce5;
    border-radius: 30px;
}

/* 匹配页面 */
.match-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 3px solid #e0eef5;
    border-top: 3px solid #5c9ce5;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.match-container p {
    font-size: 16px;
    color: #6c8fb3;
}

/* 后台管理表格等 (保持简洁) */
.admin-container {
    max-width: 1000px;
    width: 100%;
    background: white;
    border: 1px solid #e0eef5;
    border-radius: 12px;
    padding: 20px;
    margin: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e0eef5;
    padding-bottom: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-nav button {
    width: auto;
    padding: 10px 20px;
    background: #f0f4f8;
    color: #2c3e50;
    border: none;
    border-radius: 30px;
}

.tab-nav button.active {
    background: #5c9ce5;
    color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    word-break: break-word;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e0eef5;
}

th {
    background: #f0f8ff;
    font-weight: 500;
}

/* 响应式小屏幕 */
@media (max-width: 480px) {
    .container {
        padding: 25px 15px;
    }
    h2 {
        font-size: 24px;
    }
    .button-group {
        gap: 8px;
    }
    button {
        padding: 12px;
    }
    .chat-header {
        padding: 12px 15px;
    }
    .chat-messages {
        padding: 15px;
    }
    .chat-input-area {
        padding: 12px 15px;
    }
    table {
        font-size: 13px;
    }
    th, td {
        padding: 8px 6px;
    }
}