/* 页面结构与通用布局 */

.card {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

h2 {
  margin: 0;
  color: #333;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666;
  font-size: 13px;
}

/* 按钮与控制组件 */
.btn {
  background: linear-gradient(180deg, #f8d986, #d7a842);
  color: #3a2a08;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn.secondary {
  background: linear-gradient(180deg, #6f7788, #3b4250);
  color: #fff;
}

.counter {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

/* 铜钱容器布局 */
.coins-wrap {
  display: grid;
  gap: 18px;
  justify-content: center;
  grid-template-columns: 1fr 1fr 1fr;
  cursor: pointer;
}

.coin {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 正反面样式 */
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #f3d28b, #d5a244 40%, #9a6b20 85%, #5b3f18 100%);
  box-shadow: inset 0 6px 14px rgba(255, 255, 255, 0.14), 0 12px 30px rgba(0, 0, 0, 0.45);
  backface-visibility: hidden;
}

.face.front {
  transform: translateZ(1px);
}

.face.back {
  transform: rotateY(180deg) translateZ(1px);
}

/* 铜钱细节 */
.ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 10px solid rgba(112, 71, 15, 0.6);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.square-hole {
  width: 36%;
  aspect-ratio: 1/1;
  transform: rotate(45deg) translateZ(0.1px);
  background: radial-gradient(circle at 60% 30%, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.7));
  outline: 8px solid rgba(112, 71, 15, 0.6);
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.6);
}

/* 印章与文字 */
.mint-seal {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
  color: #d6b158;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.18s linear;
  transform: translateZ(0.2px);
}

.mint-char {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: yellow;
}

.mint-char.char1 {
  left: 50%;
  top: 6%;
  transform: translate(-50%, -50%) rotate(-20deg);
}

.mint-char.char2 {
  right: 6%;
  top: 50%;
  transform: translate(50%, -50%) rotate(70deg);
}

.mint-char.char3 {
  left: 50%;
  bottom: 6%;
  transform: translate(-50%, 50%) rotate(160deg);
}

.mint-char.char4 {
  left: 6%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-110deg);
}

/* 翻转动画 */
.coin.show-back .mint-seal {
  opacity: 1;
}

.coin.tossing .coin-inner {
  animation: coinflip 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes coinflip {
  0% { transform: rotateX(0) rotateY(0); }
  20% { transform: rotateX(180deg) rotateY(90deg); }
  60% { transform: rotateX(540deg) rotateY(180deg); }
  100% { transform: rotateX(720deg) rotateY(360deg); }
}

.coin.show-back .coin-inner {
  transform: rotateY(180deg);
}

/* 卦象容器 */
.hex {
  background: var(--glass);
  border-radius: 12px;
  padding: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.04);
}

/* 六爻排列 */
.lines {
  display: grid;
  gap: 4px;
}

/* 单条爻线 */
.line {
  height: 6px;
  position: relative;
  border-radius: 8px;
}

/* 实线爻 */
.line.solid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #f7f7fb, #e7e7ea);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

/* 虚线爻 */
.line.broken::before,
.line.broken::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #9aa3b6, #aeb6c9);
}

.line.broken::before {
  left: 0;
  width: 44%;
}

.line.broken::after {
  right: 0;
  width: 44%;
}

/* 动爻高亮 */
.line.moving.solid::before,
.line.moving.broken::before,
.line.moving.broken::after {
  background: linear-gradient(90deg, #ff8b8e, #ff5a5f) !important;
  box-shadow: 0 0 12px rgba(255, 90, 95, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* 聊天框容器 */
#wp-chat-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 消息区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #f9f9f9;
  border-bottom: 1px solid #eee;
}

/* 单条消息 */
.chat-message {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}

.chat-message:last-child {
  border-bottom: none;
}

.chat-message.question {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.chat-message.reply {
  background: #f3e5f5;
  border-left: 4px solid #9c27b0;
}

.chat-message.admin-reply {
  background: #e8f5e8;
  border-left: 4px solid #4caf50;
}

/* 消息头部信息 */
.chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
}

.chat-author {
  font-weight: 600;
  color: #333;
}

.chat-author.admin {
  color: #4caf50;
}

.chat-author.admin::after {
  content: " (Admin)";
  font-weight: normal;
  color: #4caf50;
}

.chat-date {
  font-size: 11px;
  color: #999;
}

.chat-content {
  line-height: 1.5;
  color: #333;
  white-space: normal;
  word-wrap: break-word;
}

/* 输入区域 */
.chat-input-container {
  background: #fff;
  padding: 15px;
  border-top: 1px solid #eee;
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.tip{
	border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
	font-size: smaller;
}

#chat-message-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  resize: none;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s ease;
  width:95%;
}

#chat-message-input:focus {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* 发送按钮 */
.send-button {
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.send-button:hover {
  background: #1976d2;
}

.send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 清空按钮 */
.clear-button {
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clear-button:hover {
  background: #b71c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(211, 47, 47, 0.3);
}

.clear-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(211, 47, 47, 0.3);
}

.clear-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 响应式支持 */
@media (max-width: 768px) {
  #wp-chat-box {
    height: auto !important;
/*     min-height: 300px; */
  }

  .chat-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .send-button {
    align-self: flex-end;
    border-radius: 4px;
  }

  .clear-button {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* 新消息动画 */
.chat-message.new-message {
  animation: slideIn 0.3s ease-out, highlight 2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes highlight {
  0% {
    background-color: rgba(33, 150, 243, 0.1);
  }
  50% {
    background-color: rgba(33, 150, 243, 0.05);
  }
  100% {
    background-color: transparent;
  }
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 登录提示 */
.chat-login-notice {
  padding: 20px;
  text-align: center;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.chat-login-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: #007cba;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.chat-login-link:hover {
  background: #005a87;
  color: white;
}

/* 错误提示 */
.chat-error {
  background: #ffebee;
  border: 1px solid #f8bbd9;
  color: #c62828;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  text-align: center;
}

/* 成功提示 */
.chat-success {
  background: #e8f5e8;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  text-align: center;
}

/* 空状态展示 */
.chat-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.chat-empty-state h3 {
  margin: 0 0 10px;
  color: #333;
}

.chat-empty-state p {
  margin: 0;
  font-style: italic;
}

.contentsList ul {
  list-style-type: none;
}

.contentsList ul li::before {
  content: "➤ ";   /* adds a checkmark before each item */
  color: green;
}