:root {
  --user-bg: #f4f6fb;
  --user-panel: #ffffff;
  --user-panel-soft: #f8fbff;
  --user-border: #dbe3ef;
  --user-border-soft: #e7edf6;
  --user-text: #101828;
  --user-muted: #667085;
  --user-primary: #2563eb;
  --user-primary-strong: #1d4ed8;
  --user-danger: #ef4444;
  --user-success: #16a34a;
  --user-warning: #f59e0b;
  --user-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--user-text);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--user-bg) 100%);
}

a {
  color: var(--user-primary);
  text-decoration: none;
}

a:hover {
  color: var(--user-primary-strong);
}

img {
  max-width: 100%;
}

.user-shell {
  display: flex;
  min-height: 100vh;
}

.ai-chat-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.chat-left {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  color: #d9e3f4;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 34%),
    linear-gradient(180deg, #0f172a 0%, #13203a 55%, #182946 100%);
}

.sidebar-scrim {
  display: none;
}

.left-top {
  padding: 24px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.brand-copy h1 {
  margin: 0;
  font-size: 20px;
  color: #ffffff;
}

.brand-copy p {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(217, 227, 244, 0.74);
}

.left-menu {
  padding: 16px 12px 8px;
}

.menu-group-title,
.history-title {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 227, 244, 0.52);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: rgba(239, 246, 255, 0.88);
  cursor: pointer;
  margin-bottom: 6px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.menu-item i {
  font-size: 18px;
}

.menu-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.menu-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.82));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24);
}

.history-list {
  padding: 0 12px;
  flex: 1;
}

.history-item {
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  font-size: 13px;
  color: rgba(217, 227, 244, 0.78);
  cursor: pointer;
}

.history-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.user-info-bottom {
  margin: 16px 12px 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.user-avatar-sidebar {
  width: 56px;
  height: 56px;
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
}

.vip-ring {
  position: absolute;
  inset: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  z-index: 2;
}

.vip-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 3;
}

.user-money-box {
  min-width: 0;
  flex: 1;
}

.user-meta {
  font-size: 12px;
  color: rgba(239, 246, 255, 0.84);
  margin-bottom: 3px;
}

.user-level {
  margin-bottom: 6px;
}

.user-level img {
  max-width: 96px;
  height: auto;
}

.user-money-label {
  font-size: 12px;
  color: rgba(217, 227, 244, 0.72);
  margin-bottom: 2px;
}

.user-money-num {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.login-btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

.chat-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.chat-head {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--user-border-soft);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  font-size: 17px;
  font-weight: 600;
  color: var(--user-text);
  flex-shrink: 0;
}

.chat-head .menu-toggle {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  box-shadow: var(--user-shadow);
  font-size: 22px;
  cursor: pointer;
}

.chat-head .menu-toggle span {
  font-size: 14px;
  font-weight: 600;
}

.chat-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 28px 24px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.empty-box {
  max-width: 860px;
  margin: 70px auto 0;
  text-align: center;
}

.empty-box h3 {
  margin: 0 0 20px;
  font-size: 30px;
  line-height: 1.2;
  color: var(--user-text);
}

.notice-banner {
  margin: 0 auto 20px;
  max-width: 820px;
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff4e5;
  color: #a16207;
  border: 1px solid #fde7c1;
  font-size: 14px;
}

.fast-ask {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fast-ask-item {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--user-border);
  background: #ffffff;
  color: var(--user-muted);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.fast-ask-item:hover {
  color: var(--user-primary);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.msg-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.msg-row.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-bubble {
  max-width: min(74%, 720px);
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.ai-bubble {
  background: #ffffff;
  border: 1px solid var(--user-border-soft);
  border-bottom-left-radius: 6px;
}

.user-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.chat-img,
.ai-image-pure {
  max-width: 240px;
  border-radius: 14px;
  margin-top: 10px;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.chat-input-box {
  flex-shrink: 0;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--user-border-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 30;
  pointer-events: auto;
}

.input-wrap {
  border: 1px solid var(--user-border);
  border-radius: 28px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  position: relative;
  z-index: 31;
  pointer-events: auto;
}

.input-wrap:hover {
  border-color: #93c5fd;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  position: relative;
  z-index: 32;
}

#userText {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  min-height: 28px;
  max-height: 150px;
  font-size: 14px;
  line-height: 1.65;
  background: transparent;
  color: var(--user-text);
  position: relative;
  z-index: 33;
  pointer-events: auto;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
  position: relative;
  z-index: 33;
  pointer-events: auto;
}

.send-btn.disabled {
  background: #d0d7e2;
  cursor: not-allowed;
  box-shadow: none;
}

.tool-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 32;
  pointer-events: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.28);
}

.tool-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 44px;
  border-radius: 16px;
  color: #475467;
  cursor: pointer;
  font-size: 13px;
  position: relative;
  z-index: 33;
  pointer-events: auto;
  border: 1px solid #d9e3f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tool-item:hover {
  background: #ffffff;
  color: var(--user-primary);
  border-color: #9cc0ff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.tool-item i {
  color: #64748b;
}

.tool-button {
  font-weight: 600;
}

.tool-chip {
  min-width: 170px;
}

.tool-chip-wide {
  min-width: 240px;
}

.tool-switch-chip {
  padding-right: 16px;
  padding-left: 12px;
  min-width: 96px;
}

.tool-select-wrap {
  position: relative;
}

.tool-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  width: 100%;
  min-width: 0;
  padding-right: 22px;
  cursor: pointer;
}

.tool-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.img-preview-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--user-border-soft);
}

.round-popup {
  border-radius: 16px !important;
  overflow: hidden !important;
}

.round-popup dd {
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.round-popup dd:hover {
  background: #eef4ff;
  color: var(--user-primary);
}

#imageModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#imageModal img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
}

#imageModal .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--user-danger);
  color: #ffffff;
  border: 0;
  cursor: pointer;
}

.content-card,
.layui-card,
.recharge-card {
  background: var(--user-panel);
  border: 1px solid var(--user-border);
  border-radius: 24px;
  box-shadow: var(--user-shadow);
  overflow: hidden;
}

.layui-card-header,
.content-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--user-border-soft);
  background: linear-gradient(180deg, #ffffff 0%, var(--user-panel-soft) 100%);
  font-size: 18px;
  font-weight: 700;
  color: var(--user-text);
}

.layui-card-body,
.content-card-body {
  padding: 22px;
}

.content-stats {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #edf2f7;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.gallery-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  background: #f8fafc;
}

.gallery-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.72) 100%);
  color: #ffffff;
}

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

.gallery-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 0;
  font-size: 11px;
  cursor: pointer;
  color: #ffffff;
}

.action-chip.primary {
  background: rgba(37, 99, 235, 0.92);
}

.action-chip.warn {
  background: rgba(245, 158, 11, 0.94);
}

.action-chip.danger {
  background: rgba(239, 68, 68, 0.94);
}

.action-chip.ghost {
  background: rgba(255, 255, 255, 0.18);
}

.user-table-tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--user-muted);
}

.user-table-tools .tool-item {
  padding: 0;
}

.form-panel {
  max-width: 720px;
  margin: 0 auto;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-row label,
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.input,
.layui-input,
.layui-textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--user-border);
  background: #ffffff;
  color: var(--user-text);
  font-size: 14px;
  outline: none;
}

.layui-textarea,
textarea.input {
  min-height: 120px;
  resize: vertical;
}

.input:focus,
.layui-input:focus,
.layui-textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-primary,
.layui-btn,
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.layui-btn-fluid,
.submit-btn.block {
  width: 100%;
}

.tip-success,
.tip-error,
.tip-warning {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.tip-success {
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.tip-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.tip-warning {
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.login-shell {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--user-border);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

.login-side {
  padding: 42px 40px;
  color: #eff6ff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(160deg, #0f172a 0%, #1d4ed8 52%, #14b8a6 100%);
}

.login-side h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.login-side p {
  margin: 0;
  color: rgba(239, 246, 255, 0.82);
}

.login-side-list {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
}

.login-side-list li {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.login-side-list strong {
  display: block;
  margin-bottom: 4px;
}

.login-panel {
  padding: 40px 36px;
}

.login-panel h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--user-muted);
}

.tab-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.tab-btn {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--user-border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--user-muted);
  cursor: pointer;
}

.tab-btn.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 14px;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .chat-left {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  .chat-left.show {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(15, 23, 42, 0.18);
  }

  .sidebar-scrim.show {
    display: block;
  }

  .chat-head .menu-toggle {
    display: flex;
  }

  .chat-content {
    padding: 20px 16px;
  }

  .chat-input-box {
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .chat-head {
    height: 64px;
    padding: 0 18px;
    font-size: 15px;
  }

  .empty-box {
    margin-top: 24px;
  }

  .empty-box h3 {
    font-size: 24px;
  }

  .msg-bubble {
    max-width: 88%;
  }

  .tool-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tool-item,
  .tool-chip,
  .tool-chip-wide,
  .tool-switch-chip {
    width: 100%;
    min-width: 0;
  }

  .tool-button {
    justify-content: center;
  }

  .tool-switch-chip {
    justify-content: flex-start;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .login-side,
  .login-panel {
    padding: 26px 22px;
  }
}
