* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #fff;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "STHeiti", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.page-view {
  min-height: 100%;
  background: #fff;
}

.record-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
}

.date-bar {
  text-align: center;
  color: #b2b2b2;
  font-size: 12px;
  line-height: 1;
  padding: 18px 16px 14px;
}

.chat-list {
  padding-bottom: 28px;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px 13px 14px;
  border-bottom: 0.5px solid #e6e6e6;
}

.chat-item:last-child {
  border-bottom: none;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  background: #d8d8d8;
}

.chat-main {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.nickname {
  color: #888;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-time {
  color: #b2b2b2;
  font-size: 11px;
  line-height: 1.2;
  flex-shrink: 0;
}

.msg-text {
  color: #111;
  font-size: 17px;
  line-height: 1.47;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-emoji {
  font-size: 30px;
  line-height: 1.1;
}

.msg-image-wrap {
  margin-top: 2px;
}

.msg-image {
  max-width: 210px;
  max-height: 280px;
  border-radius: 3px;
  display: block;
  object-fit: cover;
}

.loading, .error-box {
  text-align: center;
  color: #999;
  padding: 48px 16px;
  font-size: 15px;
}

.noscript-fallback {
  padding: 16px;
}

/* admin pages */
.page-admin {
  min-height: 100%;
  background: #f5f5f5;
  padding: 16px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h1 {
  font-size: 20px;
  margin-bottom: 8px;
}

.card p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 13px;
  color: #666;
  margin: 10px 0 6px;
}

input[type="text"], textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  background: #07c160;
  color: #fff;
}

.btn-secondary {
  background: #576b95;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.msg-editor {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  background: #fafafa;
}

.msg-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #888;
}

.link-box {
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
  margin-top: 8px;
  color: #333;
}

.tip {
  color: #999;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.5;
}

.success {
  color: #07c160;
  font-size: 14px;
  margin-top: 10px;
}

.share-tip {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  color: #8c6a00;
  font-size: 12px;
  line-height: 1.6;
}
