:root {
  --bg: #f3f4fa;
  --bg-soft: #eef0f8;
  --card: #ffffff;
  --text: #1a1b28;
  --text-2: #8b8fa3;
  --text-3: #b0b4c4;
  --primary: #4a49b8;
  --primary-deep: #3f3ea8;
  --price: #c9893a;
  --tag-gold-bg: #fbf3e4;
  --tag-gold: #b9893d;
  --tag-blue-bg: #eef1ff;
  --tag-blue: #5a5fc0;
  --status-bg: #f1f2f7;
  --line: rgba(26, 27, 40, 0.06);
  --shadow: 0 8px 24px rgba(70, 74, 120, 0.08);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #e7e9ff 0%, transparent 55%),
    linear-gradient(180deg, #eceef8 0%, #d9dcec 100%);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.phone-shell {
  width: 100%;
  max-width: 430px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 24px 80px rgba(40, 45, 90, 0.18);
}

@media (min-width: 860px) {
  body {
    padding: 28px 0;
    align-items: center;
  }
  .phone-shell {
    min-height: min(920px, calc(100vh - 56px));
    height: min(920px, calc(100vh - 56px));
    border-radius: 28px;
    overflow: hidden;
  }
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f7f8fc 0%, #f1f2f8 40%, #eceef6 100%);
}

@media (min-width: 860px) {
  .app {
    min-height: 100%;
  }
}

/* Top bar */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  background: rgba(247, 248, 252, 0.96);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(40, 50, 90, 0.16);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.brand-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: #555977;
  box-shadow: 0 2px 8px rgba(70, 74, 120, 0.05);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f6ef7;
  box-shadow: 0 0 0 0 rgba(79, 110, 247, 0.55);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(79, 110, 247, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0); }
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #9aa0b5;
}

/* Main */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 14px;
}

.main.profile-view {
  overflow-y: auto;
  padding-bottom: calc(72px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

/* Hero */
.hero {
  position: relative;
  flex: 0 0 auto;
  height: 148px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 12, 28, 0.78) 0%, rgba(8, 12, 28, 0.35) 55%, rgba(8, 12, 28, 0.25) 100%),
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 16px;
  gap: 12px;
}

.hero-copy h1 {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hero-copy p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.publish-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  color: #2c2f45;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
}

.publish-btn:active {
  transform: scale(0.97);
}

.publish-btn .plus {
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* Ticker */
.ticker {
  flex: 0 0 auto;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(70, 74, 120, 0.05);
}

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b63d6;
  flex: 0 0 auto;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  height: 18px;
}

.ticker-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.45s ease;
}

.ticker-item {
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  color: #5a5f78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-item em {
  font-style: normal;
  color: var(--price);
  font-weight: 600;
}

.ticker-arrow {
  color: #b6bbcd;
  font-size: 18px;
  line-height: 1;
}

/* Tabs */
.tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 22px;
  margin-top: 14px;
  padding: 0 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  position: relative;
  padding: 6px 0 10px;
  font-size: 14px;
  color: #8f94a8;
  font-weight: 500;
}

.tab.active {
  color: var(--primary);
  font-weight: 700;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateX(-50%);
}

/* Orders */
.order-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 4px;
  padding-bottom: calc(80px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.order-list-wrap::-webkit-scrollbar {
  width: 0;
}

.watermark {
  pointer-events: none;
  position: absolute;
  inset: -20px -40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 24px;
  transform: rotate(-22deg);
  opacity: 0.085;
  z-index: 0;
  user-select: none;
}

.watermark span {
  font-size: 15px;
  color: #6b7190;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.order-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: 0 4px 18px rgba(70, 74, 120, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-meta img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}

.order-meta .name {
  font-size: 13px;
  font-weight: 600;
  color: #2c2f45;
}

.order-meta .time {
  font-size: 12px;
  color: var(--text-3);
}

.status {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--status-bg);
  color: #9499ad;
  font-size: 12px;
}

.order-body {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-main {
  min-width: 0;
  flex: 1;
}

.order-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.order-info {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #8d92a6;
  font-size: 12px;
}

.order-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.order-info svg {
  opacity: 0.75;
}

.order-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.tag.gold {
  background: var(--tag-gold-bg);
  color: var(--tag-gold);
}

.tag.blue {
  background: var(--tag-blue-bg);
  color: var(--tag-blue);
}

.order-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
}

.price {
  color: var(--price);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
}

.price small {
  font-size: 14px;
  margin-right: 1px;
}

.accept-btn {
  min-width: 72px;
  padding: 8px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5554c4 0%, var(--primary-deep) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(63, 62, 168, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.accept-btn:active {
  transform: scale(0.96);
  filter: brightness(0.96);
}

.empty {
  text-align: center;
  padding: 48px 12px;
  color: var(--text-2);
  font-size: 14px;
}

/* Profile */
.profile-view {
  padding-top: 12px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
}

.profile-card h2 {
  font-size: 18px;
}

.profile-card p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
}

.profile-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.profile-stats div {
  background: #fff;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(70, 74, 120, 0.05);
}

.profile-stats strong {
  display: block;
  font-size: 18px;
  color: var(--primary);
}

.profile-stats span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}

.profile-menu {
  margin-top: 12px;
  list-style: none;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(70, 74, 120, 0.05);
}

.profile-menu li {
  padding: 16px 18px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}

.profile-menu li:last-child {
  border-bottom: 0;
}

/* Bottom nav */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(26, 27, 40, 0.06);
  box-shadow: 0 -8px 24px rgba(40, 45, 90, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #a0a5b8;
  font-size: 11px;
  padding: 4px 0;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  display: block;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(28, 30, 45, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: min(86vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Expire / renew */
.expire-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 20, 36, 0.72);
  backdrop-filter: blur(10px);
}

.expire-card {
  width: min(100%, 360px);
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 24, 50, 0.28);
}

.expire-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff3e8;
  color: #d97706;
  font-size: 26px;
  font-weight: 800;
}

.expire-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: #1a1b28;
}

.expire-card > p {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7088;
  line-height: 1.5;
}

.expire-meta {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f6fb;
  color: #8b8fa3;
  font-size: 12px;
  line-height: 1.5;
}

.expire-btn {
  margin-top: 18px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #5554c4 0%, #3f3ea8 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(63, 62, 168, 0.28);
}

.expire-btn:active {
  transform: scale(0.98);
}

.expire-tip {
  margin-top: 12px !important;
  font-size: 12px !important;
  color: #a0a5b8 !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
