﻿* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f1ea;
  color: #292724;
  font-family: "Microsoft YaHei", sans-serif;
}

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  text-align: center;
  margin-bottom: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #d8d3ca;
}

.scene-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #77716a;
  font-size: 18px;
}

.status-bar {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.48);
  color: white;
  backdrop-filter: blur(5px);
  font-size: 14px;
}

.input-area {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.input-area textarea {
  flex: 1;
  min-height: 66px;
  resize: vertical;
  border: 1px solid #cdc7bd;
  border-radius: 14px;
  padding: 12px;
  background: white;
  font: inherit;
}

.input-area button {
  width: 82px;
  border: 0;
  border-radius: 14px;
  background: #44403c;
  color: white;
  font: inherit;
  cursor: pointer;
}

.interaction {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
}

.current {
  background: #242424;
  color: white;
}

.previous {
  background: #dedbd5;
}

.section-title {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 12px;
}

.message {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.message:last-child {
  border-bottom: 0;
}

.message p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.empty-text {
  color: #77716a;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.bottom-nav a {
  text-align: center;
  padding: 13px 10px;
  border-radius: 14px;
  background: white;
  color: #292724;
  text-decoration: none;
  border: 1px solid #ddd7ce;
}

@media (max-width: 600px) {
  .page {
    padding: 12px;
  }

  .status-bar {
    left: 10px;
    bottom: 10px;
    max-width: 85%;
  }

  .input-area button {
    width: 70px;
  }
}

.end-row {
  margin-top: 16px;
  text-align: right;
}

.end-button {
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 12px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}

.settings-card {
  background: white;
  border: 1px solid #ddd7ce;
  border-radius: 18px;
  padding: 18px;
}

.settings-card label {
  display: block;
  margin-bottom: 16px;
}

.settings-card label span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  color: #5e5953;
}

.settings-card input {
  width: 100%;
  border: 1px solid #cdc7bd;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.settings-actions button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 11px;
  font: inherit;
  cursor: pointer;
}

#testButton {
  background: #e7e2da;
  color: #292724;
}

#saveButton {
  background: #44403c;
  color: white;
}

.settings-message {
  min-height: 24px;
  margin-top: 14px;
  font-size: 14px;
  color: #625d57;
}

.model-row {
  display: flex;
  gap: 10px;
}

.model-row select {
  flex: 1;
  width: 100%;
  border: 1px solid #cdc7bd;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: white;
}

.model-row button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  background: #e7e2da;
  color: #292724;
  cursor: pointer;
}

.personality-add {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.personality-add textarea {
  flex: 1;
  min-height: 78px;
  border: 1px solid #cdc7bd;
  border-radius: 12px;
  padding: 12px;
  resize: vertical;
  font: inherit;
}

.personality-add button {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: #44403c;
  color: white;
  font: inherit;
}

.personality-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #eee9e2;
}

.personality-item:last-child {
  border-bottom: 0;
}

.personality-item p {
  margin: 0 0 6px;
  line-height: 1.6;
}

.personality-source {
  font-size: 12px;
  color: #938d85;
}

.delete-personality {
  align-self: center;
  flex: 0 0 auto;
  border: 0;
  background: #eee9e2;
  border-radius: 10px;
  padding: 7px 11px;
  font: inherit;
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: #6d675f;
}

.identity-row select {
  border: 1px solid #cdc7bd;
  border-radius: 10px;
  padding: 7px 10px;
  background: white;
  font: inherit;
}

.diary-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.history-button {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 12px;
  background: white;
  border: 1px solid #ddd7ce;
  color: #292724;
  text-decoration: none;
  font-size: 14px;
}

.diary-list {
  display: grid;
  gap: 14px;
}

.diary-card {
  background: white;
  border: 1px solid #ddd7ce;
  border-radius: 18px;
  padding: 18px;
}

.diary-card h2 {
  margin: 5px 0 10px;
  font-size: 18px;
}

.diary-card p {
  margin: 0;
  line-height: 1.75;
  white-space: pre-wrap;
}

.diary-meta {
  color: #938d85;
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-card {
  background: white;
  border: 1px solid #ddd7ce;
  border-radius: 18px;
  padding: 18px;
}

.history-meta {
  font-size: 12px;
  color: #938d85;
  margin-bottom: 12px;
}

.history-message {
  padding: 10px 0;
  border-bottom: 1px solid #eee9e2;
}

.history-message:last-child {
  border-bottom: 0;
}

.history-message p {
  margin: 5px 0 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.item-status-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  font-size: 13px;
}

.item-status-bar > div {
  background: rgba(255,255,255,0.82);
  border: 1px solid #ddd7ce;
  border-radius: 999px;
  padding: 7px 12px;
}

.item-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-chip button {
  border: 0;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  color: #746d65;
}

.item-chip button:hover {
  text-decoration: underline;
}

.item-chip button:disabled {
  opacity: 0.45;
  cursor: default;
}
