/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', 'PingFang SC', sans-serif; background: #f0f8f0; color: #333; }

/* ===== 登录/注册 ===== */
.container { max-width: 420px; margin: 60px auto; padding: 30px; background: white; border-radius: 16px; box-shadow: 0 8px 30px rgba(46,204,113,0.15); }
.container h1 { text-align: center; margin-bottom: 5px; font-size: 24px; }
.container h2 { text-align: center; margin-bottom: 20px; }
.container input, .container button { width: 100%; padding: 12px; margin: 10px 0; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 15px; transition: border 0.3s; }
.container input:focus { border-color: #2ecc71; outline: none; }
.container button { background: #2ecc71; color: white; border: none; cursor: pointer; font-size: 16px; font-weight: 600; }
.container button:hover { background: #27ae60; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; }
.remember input { width: auto; margin: 0; }
.switch { text-align: center; margin-top: 15px; font-size: 14px; color: #666; }
.switch a { color: #2ecc71; text-decoration: none; font-weight: 600; }

/* ===== 主界面布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #2ecc71, #27ae60); padding: 20px 15px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.sidebar-logo { color: white; font-size: 20px; font-weight: bold; text-align: center; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.2); margin-bottom: 10px; }
.sidebar button { padding: 14px 18px; background: rgba(255,255,255,0.15); color: white; border: none; border-radius: 10px; cursor: pointer; text-align: left; font-size: 15px; transition: background 0.3s; }
.sidebar button:hover { background: rgba(255,255,255,0.25); }
.sidebar button.active { background: rgba(255,255,255,0.35); font-weight: 600; }
.sidebar .logout-btn { margin-top: auto; background: rgba(255,255,255,0.1); text-align: center; }
.content { flex: 1; padding: 25px; overflow-y: auto; }

/* ===== 区域切换 ===== */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 大厅 ===== */
.lobby-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.lobby-header h2 { font-size: 22px; }
.weather-inline { background: #e8f8f0; padding: 8px 16px; border-radius: 20px; font-size: 14px; color: #27ae60; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: white; padding: 20px; border-radius: 14px; box-shadow: 0 3px 12px rgba(0,0,0,0.06); }
.card h3 { margin-bottom: 10px; font-size: 16px; color: #2c3e50; }

.online-box { display: inline-block; background: linear-gradient(135deg, #3498db, #2980b9); color: white; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.chat-messages { min-height: 80px; max-height: 150px; overflow-y: auto; background: #f8f9fa; border-radius: 8px; padding: 10px; font-size: 14px; }

/* ===== 查询页 ===== */
.query-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.query-row input { flex: 1; min-width: 150px; padding: 12px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 15px; }
.query-row button { padding: 12px 25px; background: #2ecc71; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.query-row button:hover { background: #27ae60; }
.result-box { background: #1e2a38; border-radius: 12px; padding: 20px; min-height: 120px; }
.result-box pre { color: #2ecc71; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #555; }
.form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 15px; font-family: inherit; }
.form-group select:focus, .form-group textarea:focus { border-color: #2ecc71; outline: none; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input { width: auto; }
.submit-btn { width: 100%; padding: 14px; background: #2ecc71; color: white; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; }
.submit-btn:hover { background: #27ae60; }

/* ===== 活动卡片 ===== */
.event-card { background: white; border-radius: 14px; padding: 20px; margin-bottom: 15px; box-shadow: 0 3px 12px rgba(0,0,0,0.06); border-left: 4px solid #2ecc71; }
.event-card h3 { color: #2c3e50; margin-bottom: 8px; }
.event-card p { color: #666; font-size: 14px; margin: 5px 0; }
.event-card .status { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; margin: 8px 0; }
.status-waiting { background: #fff3cd; color: #856404; }
.status-active { background: #d4edda; color: #155724; }
.status-ended { background: #f8d7da; color: #721c24; }
.event-card button { margin-top: 10px; padding: 10px 20px; background: #2ecc71; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.event-card button:disabled { background: #ccc; cursor: not-allowed; }

/* ===== 响应式：手机/平板 ===== */
@media (max-width: 900px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 10px; gap: 6px; }
    .sidebar-logo { display: none; }
    .sidebar button { flex: 0 0 auto; text-align: center; padding: 10px 14px; font-size: 13px; border-radius: 8px; }
    .sidebar .logout-btn { margin-top: 0; }
    .content { padding: 15px; }
    .lobby-header { flex-direction: column; align-items: flex-start; }
    .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .container { margin: 20px 15px; padding: 20px; }
    .query-row { flex-direction: column; }
    .query-row button { width: 100%; }
}
