:root {
  --ocean-deep: #0a3d62;
  --ocean-mid: #1b6ca8;
  --ocean-light: #4aa3df;
  --sand: #f6e3b4;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #eaf4ff;
  --text-dim: #9fc3e0;
  --accent: #7dd3fc;
  --danger: #fca5a5;
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #05203a 0%, #0a3d62 55%, #0e5a8a 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.ocean {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.wave {
  position: absolute;
  width: 200%;
  height: 120px;
  bottom: 0;
  left: -50%;
  background: radial-gradient(ellipse at center, rgba(125, 211, 252, 0.14), transparent 70%);
  animation: wave-move 16s linear infinite;
}

.wave2 {
  animation-duration: 24s;
  animation-direction: reverse;
  opacity: 0.6;
}

@keyframes wave-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-header {
  text-align: center;
  padding: 8px 0 4px;
}

.app-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  background: linear-gradient(90deg, #bde0fe, #7dd3fc, #bde0fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.identity-panel,
.cast-panel,
.lift-panel,
.conv-panel,
.chat-panel,
.mypanel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ocean-light), var(--ocean-mid));
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.identity-info {
  flex: 1;
  min-width: 0;
}

.identity-name {
  font-size: 15px;
  font-weight: 600;
}

.identity-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.cast-input {
  width: 100%;
  resize: none;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  min-height: 88px;
}

.cast-title {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}

.cast-input:focus {
  border-color: var(--accent);
}

.cast-input::placeholder {
  color: var(--text-dim);
}

.cast-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.char-count {
  font-size: 12px;
  color: var(--text-dim);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #06324f;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-cast {
  padding: 10px 28px;
  font-size: 15px;
  letter-spacing: 2px;
}

.toast {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  min-height: 16px;
  text-align: center;
}

.toast.error {
  color: var(--danger);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
}

.panel-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.history-list,
.unopened-list,
.conv-list,
.mylist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.lift-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-lift {
  padding: 14px;
  font-size: 16px;
  letter-spacing: 2px;
  width: 100%;
}

.btn-lift:disabled {
  opacity: 0.6;
  cursor: wait;
}

.lift-result {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.conv-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.conv-card:hover {
  border-color: var(--accent);
}

.conv-preview {
  font-size: 13px;
  color: var(--text-dim);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  max-height: 320px;
  overflow-y: auto;
  min-height: 120px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
}

.chat-msg.mine {
  align-items: flex-end;
  align-self: flex-end;
}

.chat-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border: none;
  color: #06324f;
}

.chat-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  min-height: 48px;
}

.bottle-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.bottle-card:hover {
  border-color: var(--accent);
}

.bottle-card.conv-active {
  border-color: var(--accent);
  cursor: default;
}

.bottle-card.conv-active .chat-messages {
  border-top: 1px solid var(--glass-border);
  margin-top: 8px;
  padding-top: 12px;
}

.bottle-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.bottle-sender {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.bottle-time {
  font-size: 11px;
  color: var(--text-dim);
}

.bottle-text {
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.bottle-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(125, 211, 252, 0.15);
  color: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
}

.empty-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0;
}

.app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 8px;
  line-height: 1.8;
}

.conn-status {
  color: var(--text-dim);
}

.conn-status.online {
  color: #86efac;
}

.conn-status.offline {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .app {
    padding: 14px 12px 40px;
  }

  .app-title {
    font-size: 26px;
  }
}
