:root {
  --bg: #101017;
  --surface: #1b1a22;
  --surface-soft: #27242f;
  --surface-bright: #302c39;
  --ink: #f6f1fa;
  --muted: #aea5b5;
  --primary: #9369c8;
  --primary-dark: #c4a3f0;
  --accent: #a27bdb;
  --line: #36323e;
  --success: #72c49f;
  --shadow: 0 25px 62px rgba(0, 0, 0, 0.46);
  --radius: 22px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 26% 19%, #332248 0, transparent 34%),
    radial-gradient(circle at 78% 77%, #241d32 0, transparent 33%),
    #090a0f;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  color: inherit;
}

.desktop-note {
  width: 310px;
}

.desktop-note .brand-dot {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--primary);
  box-shadow: inset -9px -10px #563684, 0 12px 32px rgba(147, 105, 200, 0.29);
  margin-bottom: 25px;
}

.desktop-note strong {
  font-size: 42px;
  letter-spacing: 3px;
}

.desktop-note p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.phone {
  width: 390px;
  height: min(844px, calc(100vh - 36px));
  min-height: 680px;
  border: 8px solid #06070b;
  border-radius: 42px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.app-header {
  padding: 21px 18px 13px;
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  align-items: center;
  background: rgba(16, 16, 23, 0.96);
  flex-shrink: 0;
}

.header-brand {
  text-align: center;
}

.header-brand p {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.header-brand small,
.chat-person small {
  color: var(--muted);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  background: linear-gradient(135deg, #ad82e3, #6644a2);
}

.avatar-small {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.avatar.orange {
  background: linear-gradient(135deg, #b477d5, #e17c9c);
}

.avatar.blue {
  background: linear-gradient(135deg, #5476ac, #9c74d6);
}

.avatar.green {
  background: linear-gradient(135deg, #42967b, #8e74ce);
}

.icon-button {
  justify-self: end;
  width: 39px;
  height: 39px;
  border-radius: 13px;
  background: var(--surface-bright);
  color: var(--primary-dark);
  border: 1px solid var(--line);
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: 0 17px 92px;
  scrollbar-width: none;
}

.view::-webkit-scrollbar {
  display: none;
}

.hero {
  background: linear-gradient(125deg, #211d2b, #171923);
  border: 1px solid #393340;
  padding: 20px 17px 17px;
  border-radius: 26px;
  margin: 5px 0 18px;
}

.hero .eyebrow,
.section-heading .eyebrow {
  color: var(--primary);
  letter-spacing: 1px;
  font-weight: 800;
  font-size: 11px;
  margin: 0 0 7px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.28;
}

.hero p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 9px;
}

.primary-button,
.soft-button,
.outline-button {
  border-radius: 14px;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--primary);
  color: #fff8f4;
  box-shadow: 0 8px 18px rgba(117, 71, 175, 0.34);
}

.soft-button {
  background: var(--surface-bright);
  color: var(--primary-dark);
}

.outline-button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.outline-button.danger {
  color: #ad332d;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 11px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.text-action {
  background: none;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: bold;
}

.circle-strip {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.circle-strip::-webkit-scrollbar {
  display: none;
}

.circle-pill {
  min-width: 106px;
  min-height: 92px;
  padding: 13px 11px;
  border-radius: 19px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
}

.circle-pill span {
  display: block;
  font-size: 23px;
  margin-bottom: 7px;
}

.circle-pill strong {
  display: block;
  font-size: 13px;
}

.circle-pill small {
  color: var(--muted);
  font-size: 11px;
}

.feed {
  display: grid;
  gap: 11px;
}

.post {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 21px;
  padding: 13px 13px 12px;
}

.post-top {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 9px;
}

.post-person {
  flex: 1;
}

.post-person strong {
  display: block;
  font-size: 14px;
}

.post-person small {
  color: var(--muted);
}

.tag {
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  background: #372943;
  color: var(--primary-dark);
}

.tag.share {
  background: #20372f;
  color: var(--success);
}

.tag.chat {
  background: #302846;
  color: #bea5e7;
}

.post p {
  margin: 0 0 11px;
  font-size: 14px;
  line-height: 1.58;
}

.post-actions {
  display: flex;
  gap: 7px;
}

.mini-action {
  background: var(--surface-bright);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-action.highlight {
  color: var(--primary-dark);
}

.page-title {
  margin: 7px 0 17px;
}

.page-title h1 {
  margin: 0 0 6px;
  font-size: 25px;
}

.page-title p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 13px;
}

.filter {
  flex-shrink: 0;
  min-height: 35px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
}

.filter.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.circle-list {
  display: grid;
  gap: 10px;
}

.circle-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 19px;
  display: grid;
  grid-template-columns: 47px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
}

.circle-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-size: 23px;
  background: #292431;
}

.circle-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.circle-card p {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
}

.join-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: var(--primary-dark);
  background: #382944;
}

.join-button.joined {
  background: #20372f;
  color: var(--success);
}

.invitation,
.friend-card,
.star-card,
.boundary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 15px;
  margin-bottom: 12px;
}

.invitation .identity,
.friend-card .identity {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 12px;
}

.identity h3 {
  font-size: 15px;
  margin: 0 0 3px;
}

.identity p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.invitation blockquote {
  background: var(--surface-soft);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 12px;
  padding: 11px;
}

.two-actions {
  display: flex;
  gap: 8px;
}

.two-actions button {
  flex: 1;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-card .identity {
  flex: 1;
  margin: 0;
}

.star-card {
  background: linear-gradient(135deg, #33234c, #7f50a5);
  color: #fff;
}

.star-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 15px;
}

.star-card h1 {
  margin: 0 0 3px;
  font-size: 22px;
}

.star-card small {
  color: #e3d5f6;
}

.profile-line {
  margin-top: 12px;
}

.profile-line span {
  display: block;
  font-size: 11px;
  color: #dbcaee;
  margin-bottom: 4px;
}

.profile-line strong {
  font-size: 14px;
  font-weight: 500;
}

.boundary-card h2 {
  margin: 0 0 7px;
  font-size: 16px;
}

.boundary-card p {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
}

.bottom-nav {
  height: 74px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 19, 26, 0.98);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px max(env(safe-area-inset-bottom), 8px);
}

.nav-item {
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 21px;
}

.nav-item small {
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active {
  color: var(--primary-dark);
}

.nav-item.create span {
  width: 43px;
  height: 43px;
  margin-top: -26px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff8f4;
  background: var(--primary);
  box-shadow: 0 8px 17px rgba(147, 105, 200, 0.38);
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 9, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.sheet.hidden,
.toast.hidden {
  display: none;
}

.sheet-panel {
  width: min(390px, 100vw);
  max-height: 91vh;
  overflow-y: auto;
  border-radius: 29px 29px 0 0;
  background: var(--surface);
  padding: 21px 20px 29px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 14px;
}

.onboarding {
  border-radius: 30px 30px 0 0;
}

.welcome-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--primary);
  color: #fff8f4;
  font-size: 25px;
}

.onboarding h1 {
  font-size: 31px;
  line-height: 1.25;
  margin: 14px 0 9px;
}

.onboarding h1 strong {
  color: var(--primary-dark);
}

.onboarding > p,
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

label,
fieldset {
  display: block;
  margin: 16px 0;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: bold;
}

legend {
  margin-bottom: 9px;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #14131a;
  padding: 12px;
  margin-top: 7px;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
}

.zodiac-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.zodiac-option {
  height: 45px;
  border-radius: 12px;
  font-size: 21px;
  background: var(--surface-bright);
}

.zodiac-option.active {
  color: #fff8f4;
  background: var(--accent);
}

.onboarding .primary-button,
#composeForm .primary-button {
  width: 100%;
}

.rule-list {
  padding: 0;
  margin: 18px 0;
  list-style: none;
}

.rule-list li {
  background: var(--surface-soft);
  padding: 12px 12px 12px 34px;
  border-radius: 13px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
}

.rule-list li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  color: var(--success);
  font-weight: bold;
}

.safety-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.type-option {
  padding: 10px 4px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: bold;
  background: var(--surface-bright);
  color: var(--muted);
}

.type-option.active {
  background: #382944;
  color: var(--primary-dark);
}

.chat-panel {
  height: min(650px, 88vh);
  display: flex;
  flex-direction: column;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-person h2 {
  font-size: 16px;
}

.boundary-note {
  padding: 10px;
  background: #2b2538;
  color: #c1afe0;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.5;
}

.messages {
  flex: 1;
  padding: 17px 2px;
  overflow-y: auto;
}

.bubble {
  width: max-content;
  max-width: 82%;
  border-radius: 16px 16px 16px 4px;
  background: var(--surface-soft);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 9px;
}

.bubble.mine {
  background: var(--primary);
  color: #fff8f4;
  margin-left: auto;
  border-radius: 16px 16px 4px 16px;
}

.message-form {
  display: flex;
  gap: 8px;
}

.message-form input {
  margin: 0;
}

.message-form button {
  flex-shrink: 0;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--primary);
  color: #fff8f4;
  font-weight: bold;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  z-index: 40;
  background: #302c39;
  color: #f8f2ff;
  border-radius: 24px;
  font-size: 13px;
  padding: 11px 17px;
  box-shadow: var(--shadow);
}

@media (max-width: 740px) {
  body {
    display: block;
    background: var(--bg);
  }

  .desktop-note {
    display: none;
  }

  .phone {
    width: 100%;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
