* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(108, 92, 231, 0.18), transparent 30%),
    linear-gradient(180deg, #0f1117 0%, #111420 100%);
  color: #e6e8ef;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.container {
  padding: 16px;
}

.card {
  background: rgba(22, 26, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.cover {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.tag {
  display: inline-block;
  background: rgba(108, 92, 231, 0.16);
  color: #8a7bff;
  padding: 4px 10px;
  border-radius: 999px;
  margin-right: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.icon-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: none;
  color: #e6e8ef;
  background: #6c5ce7;
  cursor: pointer;
}

.icon-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.brand-inline-cn {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(246, 248, 255, 0.95);
}

.brand-inline-en {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #f3f1ff 10%, #b9adff 62%, #4a6dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 8px rgba(125, 108, 255, 0.25);
}

.brand-inline.compact .brand-inline-en {
  font-size: 13px;
  text-shadow: none;
}

.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: #f3f5fb;
}

.chat-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: #a8b0c0;
}

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 10px 12px 12px;
}

.chat-topbar,
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0 10px;
}

.minimal-topbar {
  padding-bottom: 8px;
}

.chat-topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 999px;
  border: 2px solid #111420;
}

.chat-title-group {
  min-width: 0;
}

.mini-energy-inline {
  margin-left: 8px;
  color: #8f98ab;
  font-size: 11px;
}

.more-menu-wrap {
  position: relative;
}

.more-btn {
  min-width: 42px;
  padding: 0;
}

.more-menu {
  position: absolute;
  right: 0;
  top: 42px;
  width: 148px;
  background: rgba(29, 34, 48, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  z-index: 20;
}

.hidden {
  display: none;
}

.more-menu-item {
  width: 100%;
  height: 40px;
  text-align: left;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #e6e8ef;
  cursor: pointer;
}

.more-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.energy-panel {
  background: rgba(22, 26, 35, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.energy-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.energy-label {
  font-size: 13px;
  color: #a8b0c0;
}

.energy-value {
  font-size: 14px;
  font-weight: 600;
  color: #f3f5fb;
}

.energy-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.energy-segment {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.energy-segment.active {
  background: linear-gradient(90deg, #6c5ce7 0%, #8a7bff 100%);
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.35);
}

.energy-tip {
  font-size: 12px;
  color: #6b7385;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 8px 2px 14px;
}

.chat-box-clean {
  padding-top: 10px;
}

.system-tip {
  width: fit-content;
  max-width: 90%;
  margin: 0 auto 16px;
  padding: 8px 12px;
  font-size: 12px;
  color: #a8b0c0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.message-row {
  display: flex;
  margin-bottom: 14px;
}

.assistant-row {
  justify-content: flex-start;
}

.user-row {
  justify-content: flex-end;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  margin-right: 8px;
  flex-shrink: 0;
}

.bubble-group {
  max-width: 78%;
}

.user-row .bubble-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.name-line {
  font-size: 12px;
  color: #8f98ab;
  margin-bottom: 5px;
}

.bubble {
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
}

.assistant-bubble {
  background: #161a23;
  color: #e6e8ef;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-bubble {
  background: linear-gradient(135deg, #6c5ce7 0%, #7f6fff 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.22);
}

.meta-line {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7385;
}

.memory-card {
  margin: 4px 0 16px 42px;
  padding: 14px;
  background: rgba(29, 34, 48, 0.96);
  border: 1px solid rgba(108, 92, 231, 0.45);
  border-radius: 16px;
}

.memory-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f3f8;
  margin-bottom: 8px;
}

.memory-card-content {
  font-size: 13px;
  color: #a8b0c0;
  line-height: 1.55;
  margin-bottom: 12px;
}

.memory-card-actions {
  display: flex;
  gap: 8px;
}

.memory-btn {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.memory-btn.confirm {
  background: #6c5ce7;
  color: #fff;
}

.memory-btn.cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #e6e8ef;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.soft-energy-tip {
  padding: 0 4px 8px;
  font-size: 12px;
  color: #6b7385;
}

.chat-input-panel {
  padding-top: 4px;
}

.minimal-input-panel {
  padding-top: 2px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  outline: none;
  background: #1d2230;
  color: #e6e8ef;
}

.chat-input:focus,
.search-input:focus {
  border-color: #6c5ce7;
}

.chat-input::placeholder,
.search-input::placeholder {
  color: #6b7385;
}

.voice-toggle-btn {
  width: 42px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #d5d9e5;
  cursor: pointer;
  flex-shrink: 0;
}

.send-btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6c5ce7 0%, #8a7bff 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 首页 */
.hero-panel {
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(108, 92, 231, 0.18), rgba(255, 122, 182, 0.06)),
    rgba(22, 26, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-kicker {
  font-size: 12px;
  color: #8a7bff;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.hero-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  color: #f5f7fd;
}

.hero-desc {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #a8b0c0;
}

.search-wrap {
  margin-top: 16px;
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  outline: none;
  background: #1d2230;
  color: #e6e8ef;
}

/* 标签/筛选 chips 功能已移除 */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #f3f5fb;
}

.section-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7385;
}

.oc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.oc-card {
  overflow: hidden;
  border-radius: 20px;
  background: rgba(22, 26, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.oc-cover-wrap {
  position: relative;
  height: 180px;
}

.oc-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oc-cover-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(15, 17, 23, 0.75) 100%);
}

.oc-avatar {
  position: absolute;
  left: 16px;
  bottom: 14px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
}

.oc-body {
  padding: 14px 16px 16px;
}

.oc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.oc-name {
  font-size: 17px;
  font-weight: 600;
  color: #f3f5fb;
}

.oc-price {
  font-size: 13px;
  color: #b7adff;
  white-space: nowrap;
}

.oc-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #a8b0c0;
}

.oc-meta {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7385;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: #6b7385;
  background: rgba(22, 26, 35, 0.96);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 详情页 */
.detail-hero {
  position: relative;
  height: 320px;
  overflow: hidden;
}

.detail-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-cover-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 17, 23, 0.12), rgba(15, 17, 23, 0.88)),
    linear-gradient(135deg, rgba(108, 92, 231, 0.18), transparent 55%);
}

.detail-topbar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 2;
}

.detail-hero-content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 2;
}

.detail-avatar-ring {
  width: 92px;
  height: 92px;
  padding: 3px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.85), rgba(255, 122, 182, 0.55));
  margin-bottom: 14px;
}

.detail-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 25px;
  display: block;
}

.detail-meta {
  min-width: 0;
}

.detail-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-name {
  margin: 0;
  font-size: 28px;
  color: #ffffff;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(108, 92, 231, 0.2);
  color: #d7d1ff;
  font-size: 12px;
  white-space: nowrap;
}

.detail-one-liner {
  margin-top: 10px;
  font-size: 14px;
  color: #d5d9e5;
  line-height: 1.6;
}

.detail-content {
  margin-top: -6px;
  padding-bottom: 110px;
}

.detail-text {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #a8b0c0;
}

.detail-feature-list {
  margin-top: 10px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-title {
  font-size: 14px;
  color: #f3f5fb;
}

.feature-desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #6b7385;
}

.sticky-action-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(17, 20, 32, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sticky-btn {
  height: 46px;
}

@media (min-width: 481px) {
  .app-shell {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}