/* 月亮社区 — 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; }

.panel { display: none; min-height: 100vh; flex-direction: column; }
.panel.active { display: flex; }

/* 登录面板 */
#auth-panel { align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; padding: 20px; }
#auth-panel h1 { font-size: 32px; margin-bottom: 8px; }
#auth-panel .subtitle { opacity: 0.7; margin-bottom: 30px; }
.tabs { display: flex; gap: 20px; margin-bottom: 20px; }
.tab { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 16px; cursor: pointer; padding-bottom: 5px; border-bottom: 2px solid transparent; }
.tab.active { color: #fff; border-bottom-color: #e94560; }
.form-panel { display: none; flex-direction: column; gap: 12px; width: 280px; }
.form-panel.active { display: flex; }
.form-panel input, .form-panel select { padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; font-size: 15px; outline: none; }
.form-panel input::placeholder { color: rgba(255,255,255,0.4); }
.btn-primary { padding: 12px; border-radius: 8px; border: none; background: #e94560; color: #fff; font-size: 16px; cursor: pointer; font-weight: bold; }
.btn-primary:hover { background: #c73650; }

/* 主界面 */
#main-panel { background: #f0f2f5; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.user-info { display: flex; align-items: center; gap: 8px; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e94560; color: #fff; }
.header-actions button { padding: 6px 16px; margin-left: 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; }

/* 对话区 */
.chat-container { max-width: 600px; margin: 20px auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; }
.agent-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; }
.agent-avatar { width: 44px; height: 44px; border-radius: 50%; background: #e94560; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; }
.agent-name { font-size: 16px; font-weight: bold; }
.agent-desc { font-size: 12px; opacity: 0.7; margin-top: 2px; }

.chat-messages { height: 300px; overflow-y: auto; padding: 16px 20px; }
.message { margin-bottom: 12px; display: flex; }
.message.user { justify-content: flex-end; }
.message .msg-content { max-width: 80%; padding: 10px 14px; border-radius: 12px; line-height: 1.6; font-size: 14px; white-space: pre-line; }
.message.agent .msg-content { background: #f0f2f5; border-bottom-left-radius: 4px; }
.message.user .msg-content { background: #e94560; color: #fff; border-bottom-right-radius: 4px; }

.quick-actions { display: flex; gap: 8px; padding: 12px 20px; flex-wrap: wrap; }
.quick-actions button { padding: 6px 14px; border-radius: 16px; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 13px; }
.quick-actions button.danger { border-color: #e94560; color: #e94560; }
.quick-actions button:hover { background: #f0f2f5; }

.chat-input { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid #eee; }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid #ddd; border-radius: 20px; outline: none; font-size: 14px; }
.btn-send { padding: 10px 20px; border-radius: 20px; border: none; background: #e94560; color: #fff; cursor: pointer; font-size: 14px; }

/* 服务网格 */
.section { max-width: 600px; margin: 0 auto 20px; padding: 0 20px; }
.section h3 { margin-bottom: 12px; font-size: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.service-card { background: #fff; border-radius: 10px; padding: 14px; cursor: pointer; transition: transform 0.2s; }
.service-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.service-card .s-title { font-size: 14px; font-weight: bold; margin-bottom: 6px; }
.service-card .s-supplier { font-size: 12px; color: #888; margin-bottom: 4px; }
.service-card .s-price { font-size: 16px; color: #e94560; font-weight: bold; }
.service-card .s-meta { font-size: 11px; color: #aaa; margin-top: 6px; }

/* 订单面板 */
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; }
.panel-overlay > div { background: #fff; border-radius: 12px; width: 90%; max-width: 500px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.overlay-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; }
.overlay-header button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; }
#orders-list { padding: 16px 20px; overflow-y: auto; }
.order-card { border: 1px solid #eee; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.order-card .o-title { font-weight: bold; margin-bottom: 4px; }
.order-card .o-no { font-size: 12px; color: #888; }
.order-card .o-amount { color: #e94560; font-weight: bold; }
.order-card .o-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-top: 6px; }
.order-card .o-status.paid { background: #e8f5e9; color: #2e7d32; }
.order-card .o-status.pending { background: #fff3e0; color: #e65100; }
.order-card .o-actions { margin-top: 8px; display: flex; gap: 8px; }
.order-card .o-actions button { padding: 4px 12px; font-size: 12px; border-radius: 4px; border: 1px solid #ddd; background: #fff; cursor: pointer; }

@media (max-width: 640px) {
  .chat-container { margin: 10px; border-radius: 8px; }
  .section { padding: 0 10px; }
}
