style.css 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. /* 全局样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  9. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  10. min-height: 100vh;
  11. color: #333;
  12. }
  13. .container {
  14. max-width: 800px;
  15. margin: 0 auto;
  16. padding: 20px;
  17. min-height: 100vh;
  18. }
  19. /* 头部样式 */
  20. header {
  21. text-align: center;
  22. margin-bottom: 30px;
  23. color: white;
  24. }
  25. header h1 {
  26. font-size: 2.5rem;
  27. margin-bottom: 10px;
  28. text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  29. }
  30. .subtitle {
  31. font-size: 1.1rem;
  32. opacity: 0.9;
  33. }
  34. /* 介绍区域 */
  35. .intro-section {
  36. background: white;
  37. border-radius: 15px;
  38. padding: 30px;
  39. text-align: center;
  40. box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  41. }
  42. .game-rules {
  43. margin-bottom: 30px;
  44. }
  45. .game-rules h2 {
  46. color: #667eea;
  47. margin-bottom: 20px;
  48. }
  49. .game-rules ul {
  50. list-style: none;
  51. text-align: left;
  52. max-width: 400px;
  53. margin: 0 auto;
  54. }
  55. .game-rules li {
  56. padding: 8px 0;
  57. border-bottom: 1px solid #eee;
  58. }
  59. /* 按钮样式 */
  60. .start-btn, .hint-btn {
  61. background: linear-gradient(135deg, #667eea, #764ba2);
  62. color: white;
  63. border: none;
  64. padding: 15px 30px;
  65. border-radius: 25px;
  66. font-size: 1.1rem;
  67. cursor: pointer;
  68. transition: all 0.3s ease;
  69. font-weight: bold;
  70. }
  71. .start-btn:hover, .hint-btn:hover {
  72. transform: translateY(-2px);
  73. box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  74. }
  75. .start-btn:disabled, .hint-btn:disabled {
  76. opacity: 0.5;
  77. cursor: not-allowed;
  78. transform: none;
  79. }
  80. /* 游戏区域 */
  81. .game-section {
  82. background: white;
  83. border-radius: 15px;
  84. padding: 20px;
  85. box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  86. display: flex;
  87. flex-direction: column;
  88. height: 600px;
  89. }
  90. .game-header {
  91. display: flex;
  92. justify-content: space-between;
  93. align-items: center;
  94. margin-bottom: 20px;
  95. padding-bottom: 15px;
  96. border-bottom: 2px solid #f0f0f0;
  97. }
  98. .game-stats {
  99. display: flex;
  100. gap: 20px;
  101. font-weight: bold;
  102. color: #667eea;
  103. }
  104. .hint-btn {
  105. padding: 8px 16px;
  106. font-size: 0.9rem;
  107. }
  108. /* 聊天容器 */
  109. .chat-container {
  110. flex: 1;
  111. overflow-y: auto;
  112. padding: 10px;
  113. background: #f8f9fa;
  114. border-radius: 10px;
  115. margin-bottom: 15px;
  116. }
  117. .welcome-message {
  118. margin-bottom: 15px;
  119. }
  120. /* 消息样式 */
  121. .message {
  122. display: flex;
  123. margin-bottom: 15px;
  124. animation: fadeIn 0.3s ease;
  125. }
  126. .message-content {
  127. max-width: 70%;
  128. padding: 12px 16px;
  129. border-radius: 18px;
  130. line-height: 1.4;
  131. }
  132. .user-message {
  133. justify-content: flex-end;
  134. }
  135. .user-message .message-content {
  136. background: linear-gradient(135deg, #667eea, #764ba2);
  137. color: white;
  138. border-bottom-right-radius: 5px;
  139. }
  140. .agent-message {
  141. justify-content: flex-start;
  142. }
  143. .agent-message .message-content {
  144. background: #e3f2fd;
  145. color: #333;
  146. border-bottom-left-radius: 5px;
  147. }
  148. /* 输入区域 */
  149. .input-container, .guess-section {
  150. display: flex;
  151. gap: 10px;
  152. margin-bottom: 10px;
  153. }
  154. .input-container input, .guess-section input {
  155. flex: 1;
  156. padding: 12px 16px;
  157. border: 2px solid #ddd;
  158. border-radius: 25px;
  159. font-size: 1rem;
  160. outline: none;
  161. transition: border-color 0.3s ease;
  162. }
  163. .input-container input:focus, .guess-section input:focus {
  164. border-color: #667eea;
  165. }
  166. .input-container button, .guess-section button {
  167. padding: 12px 20px;
  168. background: #667eea;
  169. color: white;
  170. border: none;
  171. border-radius: 25px;
  172. cursor: pointer;
  173. font-weight: bold;
  174. transition: background 0.3s ease;
  175. }
  176. .input-container button:hover, .guess-section button:hover {
  177. background: #5a6fd8;
  178. }
  179. .input-container button:disabled, .guess-section button:disabled {
  180. background: #ccc;
  181. cursor: not-allowed;
  182. }
  183. .guess-section {
  184. background: #fff3cd;
  185. padding: 15px;
  186. border-radius: 10px;
  187. border: 2px solid #ffeaa7;
  188. }
  189. .guess-section input {
  190. background: #fff;
  191. }
  192. /* 模态框 */
  193. .modal {
  194. position: fixed;
  195. top: 0;
  196. left: 0;
  197. width: 100%;
  198. height: 100%;
  199. background: rgba(0,0,0,0.7);
  200. display: flex;
  201. justify-content: center;
  202. align-items: center;
  203. z-index: 1000;
  204. }
  205. .modal-content {
  206. background: white;
  207. padding: 30px;
  208. border-radius: 15px;
  209. text-align: center;
  210. max-width: 500px;
  211. width: 90%;
  212. }
  213. .modal-content h2 {
  214. color: #667eea;
  215. margin-bottom: 20px;
  216. }
  217. .modal-content p {
  218. margin-bottom: 20px;
  219. line-height: 1.6;
  220. }
  221. #figure-info {
  222. background: #f8f9fa;
  223. padding: 15px;
  224. border-radius: 10px;
  225. margin-bottom: 20px;
  226. text-align: left;
  227. }
  228. #figure-info h3 {
  229. color: #667eea;
  230. margin-bottom: 10px;
  231. }
  232. /* Portrait gallery */
  233. .portrait-gallery {
  234. display: flex;
  235. gap: 8px;
  236. justify-content: center;
  237. margin-bottom: 14px;
  238. flex-wrap: wrap;
  239. }
  240. .portrait-item {
  241. flex: 0 0 auto;
  242. width: 120px;
  243. height: 120px;
  244. border-radius: 10px;
  245. overflow: hidden;
  246. box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  247. border: 2px solid #e0e0e0;
  248. transition: transform 0.2s ease, box-shadow 0.2s ease;
  249. }
  250. .portrait-item:hover {
  251. transform: scale(1.05);
  252. box-shadow: 0 6px 18px rgba(102,126,234,0.4);
  253. border-color: #667eea;
  254. }
  255. .portrait-item img {
  256. width: 100%;
  257. height: 100%;
  258. object-fit: cover;
  259. display: block;
  260. }
  261. /* 工具类 */
  262. .hidden {
  263. display: none !important;
  264. }
  265. .loading {
  266. opacity: 0.6;
  267. pointer-events: none;
  268. }
  269. /* 动画 */
  270. @keyframes fadeIn {
  271. from {
  272. opacity: 0;
  273. transform: translateY(10px);
  274. }
  275. to {
  276. opacity: 1;
  277. transform: translateY(0);
  278. }
  279. }
  280. /* Loading overlay */
  281. .loading-overlay {
  282. position: fixed;
  283. top: 0;
  284. left: 0;
  285. width: 100%;
  286. height: 100%;
  287. background: rgba(102, 126, 234, 0.85);
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. z-index: 2000;
  292. backdrop-filter: blur(4px);
  293. }
  294. .loading-box {
  295. background: white;
  296. border-radius: 20px;
  297. padding: 40px 50px;
  298. text-align: center;
  299. box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  300. animation: fadeIn 0.3s ease;
  301. }
  302. .loading-spinner {
  303. width: 56px;
  304. height: 56px;
  305. border: 5px solid #e0e0e0;
  306. border-top-color: #667eea;
  307. border-radius: 50%;
  308. animation: spin 0.9s linear infinite;
  309. margin: 0 auto 20px;
  310. }
  311. .loading-title {
  312. font-size: 1.2rem;
  313. font-weight: bold;
  314. color: #333;
  315. margin-bottom: 10px;
  316. }
  317. .loading-step {
  318. font-size: 0.95rem;
  319. color: #667eea;
  320. min-height: 1.4em;
  321. transition: opacity 0.4s ease;
  322. }
  323. @keyframes spin {
  324. to { transform: rotate(360deg); }
  325. }
  326. /* 响应式设计 */
  327. @media (max-width: 768px) {
  328. .container {
  329. padding: 10px;
  330. }
  331. header h1 {
  332. font-size: 2rem;
  333. }
  334. .game-section {
  335. height: 500px;
  336. }
  337. .message-content {
  338. max-width: 85%;
  339. }
  340. .input-container, .guess-section {
  341. flex-direction: column;
  342. }
  343. .game-stats {
  344. flex-direction: column;
  345. gap: 5px;
  346. }
  347. }