/* ==============================================
   App-specific Styles
   ============================================== */

.app-body {
  padding: 16px;
  min-height: 100%;
}

.app-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
}

.app-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.app-card:active {
  opacity: 0.7;
}

.app-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin-bottom: 4px;
}

.app-card-text {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.app-btn:active {
  transform: scale(0.97);
  opacity: 0.8;
}

.app-btn-primary {
  background: var(--ios-blue);
  color: #fff;
}

.app-btn-secondary {
  background: #f2f2f6;
  color: var(--ios-blue);
}

.app-btn-success {
  background: var(--ios-green);
  color: #fff;
}

.app-btn-warning {
  background: var(--ios-orange);
  color: #fff;
}

.app-btn-danger {
  background: var(--ios-red);
  color: #fff;
}

.app-btn-small {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.app-btn-block {
  width: 100%;
}

/* ==============================================
   Settings Styles
   ============================================== */
.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 16px;
  margin-bottom: 8px;
}

.settings-group {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 16px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid #e8e8ed;
  cursor: pointer;
  min-height: 44px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-label {
  font-size: 16px;
  color: #000;
}

.settings-row-value {
  font-size: 15px;
  color: #8e8e93;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-row-arrow {
  color: #ccc;
  font-size: 14px;
}

.settings-toggle {
  position: relative;
  width: 51px;
  height: 31px;
  cursor: pointer;
}

.settings-toggle input {
  display: none;
}

.settings-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e9e9ea;
  border-radius: 16px;
  transition: all 0.3s;
}

.settings-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: var(--ios-green);
}

.settings-toggle input:checked + .settings-toggle-slider::after {
  transform: translateX(20px);
}

.settings-input {
  width: 100%;
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.settings-input:focus {
  border-color: var(--ios-blue);
}

.settings-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  line-height: 1.4;
}

.settings-textarea:focus {
  border-color: var(--ios-blue);
}

.settings-select {
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

/* ==============================================
   Workstation Styles
   ============================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.workspace-item {
  background: #fff;
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.workspace-item:active {
  transform: scale(0.95);
  opacity: 0.7;
}

.workspace-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 18px;
}

.workspace-item-label {
  font-size: 12px;
  font-weight: 600;
  color: #000;
}

.workspace-item-sub {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}

/* Stats display */
.stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 4px 0;
}

.stats-bar::-webkit-scrollbar { display: none; }

.stat-chip {
  background: #fff;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.stat-chip .stat-val {
  font-weight: 700;
  color: #000;
}

.stat-chip .stat-change {
  font-size: 10px;
}

.stat-change.up { color: var(--ios-green); }
.stat-change.down { color: var(--ios-red); }

/* Event/Story Display */
.story-display {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.story-time {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.story-text {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.story-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.story-choice {
  background: #f2f2f6;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: #000;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}

.story-choice:active {
  background: #e0e0e0;
  transform: scale(0.98);
}

.story-choice.selected {
  background: var(--ios-blue);
  color: #fff;
}

/* AI Loading */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  color: #999;
  font-size: 13px;
}

.ai-thinking .dot-pulse {
  display: flex;
  gap: 4px;
}

.ai-thinking .dot-pulse span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: dotPulse 1.4s infinite ease-in-out both;
}

.ai-thinking .dot-pulse span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking .dot-pulse span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.4); }
  40% { transform: scale(1); }
}

/* ==============================================
   Weibo App Styles - 1:1 iOS Weibo
   ============================================== */

:root {
  --wb-orange: #ff8200;
}

/* Top navigation bar */
.wb-navbar {
  background: #fff;
  flex-shrink: 0;
}

.wb-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  min-height: 42px;
}

.wb-navbar-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--wb-orange);
}

.wb-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wb-navbar-right svg {
  width: 22px;
  height: 22px;
  fill: #333;
}

.wb-navbar-discover {
  font-size: 13px;
  color: var(--wb-orange);
  font-weight: 500;
}

/* Category tabs */
.wb-tabs {
  display: flex;
  border-bottom: 0.5px solid #e8e8ed;
}

.wb-tab {
  flex: 1;
  text-align: center;
  padding: 9px 0 7px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  color: #666;
  font-family: inherit;
  background: none;
  border: none;
}

.wb-tab.active {
  color: var(--wb-orange);
  font-weight: 600;
}

.wb-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2.5px;
  background: var(--wb-orange);
  border-radius: 1px;
}

/* Post card - 1:1 Weibo style */
.wb-post {
  background: #fff;
  margin-bottom: 10px;
}

.wb-post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 6px;
}

.wb-post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.wb-post-author-info {
  flex: 1;
  min-width: 0;
}

.wb-post-name-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.wb-post-name {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-post-subtitle {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wb-post-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wb-follow-btn {
  background: none;
  border: 1px solid var(--wb-orange);
  color: var(--wb-orange);
  border-radius: 16px;
  padding: 2px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.wb-menu-dots svg {
  width: 18px;
  height: 18px;
  fill: #ccc;
  cursor: pointer;
}

.wb-post-content {
  padding: 4px 16px 8px;
}

.wb-post-text {
  font-size: 16px;
  color: #333;
  line-height: 1.65;
  letter-spacing: 0.3px;
  white-space: pre-wrap;
}

/* Image grid */
.wb-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.wb-image-single {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 14px;
  overflow: hidden;
}

.wb-image-multi {
  width: calc(33.33% - 3px);
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #ccc;
}

.wb-tag-chip {
  font-size: 11px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 10px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 6px;
}

.wb-source {
  padding: 0 16px 8px;
  font-size: 11px;
  color: #ccc;
  display: flex;
  gap: 8px;
}

/* Action bar - real Weibo style */
.wb-action-bar {
  display: flex;
  border-top: 0.5px solid #f0f0f0;
  padding: 0 4px;
}

.wb-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  padding: 10px 4px;
  font-family: inherit;
}

.wb-action-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.wb-action-btn:active {
  opacity: 0.6;
}

/* Comment overlay */
.wb-comment-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.wb-comment-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-height: 70%;
  min-height: 40%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

.wb-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  flex-shrink: 0;
}

.wb-comment-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}

.wb-comment-title {
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.wb-comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.wb-comment-item {
  padding: 10px 16px;
  border-bottom: 0.5px solid #f8f8f8;
}

.wb-comment-row {
  display: flex;
  gap: 8px;
}

.wb-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.wb-comment-body {
  flex: 1;
  min-width: 0;
}

.wb-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.wb-comment-nickname {
  font-size: 13px;
  font-weight: 600;
  color: #000;
}

.wb-comment-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.wb-comment-text {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 4px;
}

.wb-comment-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #ccc;
}

.wb-comment-like-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: inherit;
}

.wb-comment-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 0.5px solid #f0f0f0;
  flex-shrink: 0;
}

.wb-comment-input {
  flex: 1;
  height: 34px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.wb-comment-submit {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 17px;
  background: var(--wb-orange);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Compose overlay */
.wb-compose-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.wb-compose-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  animation: slideUp 0.3s ease-out;
}

.wb-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid #e8e8ed;
}

.wb-compose-cancel {
  background: none;
  border: none;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  font-family: inherit;
}

.wb-compose-title {
  font-size: 16px;
  font-weight: 700;
}

.wb-compose-send {
  background: var(--wb-orange);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* FAB button */
.wb-fab {
  position: fixed;
  bottom: 80px;
  right: 12px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wb-orange), #ff6a00);
  border: none;
  box-shadow: 0 3px 12px rgba(255,130,0,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.wb-fab svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

/* Profile */
.wb-profile-header {
  background: #fff;
  padding: 20px 16px;
  text-align: center;
}

.wb-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 10px;
}

.wb-profile-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.wb-profile-bio {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.wb-profile-stats {
  display: flex;
  border-top: 0.5px solid #f0f0f0;
  border-bottom: 0.5px solid #f0f0f0;
  padding: 12px 0;
}

.wb-profile-stat {
  flex: 1;
  text-align: center;
}

.wb-profile-stat-num {
  font-size: 16px;
  font-weight: 700;
}

.wb-profile-stat-label {
  font-size: 11px;
  color: #999;
}

.wb-profile-desc {
  font-size: 13px;
  color: #666;
  margin-top: 12px;
  line-height: 1.5;
}

/* ==============================================
   Weibo Bottom Tab Bar
   ============================================== */
.wb-bottom-tabs {
  display: flex;
  background: #fff;
  border-top: 0.5px solid #e8e8ed;
  flex-shrink: 0;
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  position: relative;
}

.wb-bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 0;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  color: #999;
}

.wb-bottom-tab.active {
  color: var(--wb-orange);
}

.wb-bottom-tab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.wb-bottom-tab span {
  font-size: 10px;
  font-weight: 500;
}

/* Center compose button in bottom tab */
.wb-bottom-compose {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wb-orange), #ff6a00);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,130,0,0.35);
}

.wb-bottom-compose svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

/* ==============================================
   Schedule App
   ============================================== */
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 0.5px solid #e8e8ed;
}

.schedule-nav-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--ios-blue);
  cursor: pointer;
  padding: 4px 8px;
}

.schedule-month {
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.schedule-day-list {
  padding: 8px 16px;
}

.schedule-day {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 0.5px solid #f0f0f0;
}

.schedule-day-date {
  font-size: 13px;
  font-weight: 600;
  color: #999;
  min-width: 60px;
}

.schedule-day-event {
  font-size: 14px;
  color: #000;
  flex: 1;
  line-height: 1.4;
}

.schedule-day-time {
  font-size: 12px;
  color: var(--ios-blue);
}

/* ==============================================
   WeChat App - 100% Realistic iOS WeChat
   ============================================== */
:root {
  --wx-green: #07c160;
  --wx-bg: #ededed;
  --wx-nav-bg: #fff;
  --wx-tab-bg: #f7f7f7;
  --wx-bubble-self: #95ec69;
  --wx-bubble-other: #fff;
  --wx-text: #181818;
  --wx-secondary: #999;
  --wx-line: #d9d9d9;
}

.wx-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wx-bg);
}

/* Navigation Bar */
.wx-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: var(--wx-nav-bg);
  border-bottom: 0.5px solid var(--wx-line);
  position: relative;
  flex-shrink: 0;
  padding: 0 12px;
}

.wx-nav-title {
  font-size: 17px;
  font-weight: 500;
  color: #000;
}

.wx-nav-back {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 22px;
  color: var(--wx-green);
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

.wx-nav-right {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}

.wx-nav-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--wx-green);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

/* Bottom Tab Bar */
.wx-tabbar {
  display: flex;
  height: 50px;
  background: var(--wx-tab-bg);
  border-top: 0.5px solid var(--wx-line);
  flex-shrink: 0;
}

.wx-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  padding: 4px 0 2px;
  color: #999;
  font-size: 10px;
  border: none;
  background: none;
  font-family: inherit;
  position: relative;
}

.wx-tab.active {
  color: #07c160;
}

.wx-tab-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
}

.wx-tab-badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 8px;
  min-width: 16px;
  height: 16px;
  background: #ff3b30;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #fff;
  line-height: 1;
}

/* Chat List */
.wx-chat-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.wx-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  cursor: pointer;
}

.wx-chat-item:active {
  background: #ececec;
}

.wx-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  position: relative;
}

.wx-chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wx-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wx-chat-name {
  font-size: 16px;
  font-weight: 500;
  color: #000;
}

.wx-chat-time {
  font-size: 11px;
  color: #bbb;
  flex-shrink: 0;
}

.wx-chat-preview {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}

/* Chat Messages */
.wx-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ededed;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='g' patternUnits='userSpaceOnUse' width='12' height='12'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23e0e0e0' fill-opacity='0.3'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23g)'/%3E%3C/svg%3E");
}

.wx-time-sep {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin: 0 0 2px;
  align-self: center;
}

/* Message row (avatar + bubble pair) */
.wx-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.wx-msg-row.right {
  flex-direction: row-reverse;
}

.wx-msg-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.wx-msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  color: #000;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.wx-msg-bubble.self {
  background: #95ec69;
  border-top-right-radius: 2px;
}

.wx-msg-bubble.other {
  background: #fff;
  border-top-left-radius: 2px;
}

/* Input Bar */
.wx-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f7f7f7;
  border-top: 0.5px solid #d9d9d9;
  flex-shrink: 0;
}

.wx-input-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #666;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-input-field {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  color: #000;
}

.wx-input-field::placeholder {
  color: #bbb;
}

.wx-send-btn {
  min-width: 54px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: var(--wx-green);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 0 12px;
  flex-shrink: 0;
  display: none;
}

.wx-send-btn.show {
  display: block;
}

/* Contact List */
.wx-contacts {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.wx-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  cursor: pointer;
}

.wx-contact-item:active {
  background: #ececec;
}

.wx-contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.wx-contact-name {
  font-size: 16px;
  color: #000;
  font-weight: 400;
}

/* Discover Page */
.wx-discover {
  flex: 1;
  overflow-y: auto;
  background: #ededed;
}

.wx-discover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 0.5px solid #f0f0f0;
  cursor: pointer;
}

.wx-discover-item:active {
  background: #ececec;
}

.wx-discover-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.wx-discover-label {
  flex: 1;
  font-size: 16px;
  color: #000;
}

.wx-discover-arrow {
  font-size: 14px;
  color: #ccc;
}

/* My Profile Tab */
.wx-profile {
  flex: 1;
  overflow-y: auto;
  background: #ededed;
}

.wx-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: #fff;
  margin-bottom: 8px;
}

.wx-profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #07c160, #05a14e);
}

.wx-profile-info {
  flex: 1;
}

.wx-profile-name {
  font-size: 20px;
  font-weight: 500;
  color: #000;
  margin-bottom: 4px;
}

.wx-profile-id {
  font-size: 14px;
  color: #999;
}

/* Emoji Panel */
.wx-emoji-panel {
  background: #fff;
  border-top: 0.5px solid #e0e0e0;
  flex-shrink: 0;
}

.wx-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
}

.wx-emoji-item {
  font-size: 30px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.1s;
}

.wx-emoji-item:active {
  background: #ececec;
  transform: scale(1.15);
}

.wx-sticker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-top: 0.5px solid #eee;
}

.wx-sticker-item {
  font-size: 14px;
  background: #f5f5f5;
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: #333;
  transition: background 0.1s;
}

.wx-sticker-item:active {
  background: #e0e0e0;
}

/* Call notification */
.wx-call-bubble {
  align-self: center;
  font-size: 13px;
  color: #999;
  background: rgba(255,255,255,0.7);
  padding: 6px 16px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Chat back button */
.chat-back-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--ios-blue);
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}

/* Music player control buttons */
.music-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Toast notification overlay */
.toast-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  max-width: 280px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toastFadeIn 0.2s ease-out;
  pointer-events: none;
}

/* Achievement toast notification */
.achievement-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(255,170,0,0.4);
  animation: slideDown 0.3s ease-out;
  max-width: 300px;
  text-align: center;
  pointer-events: none;
}

/* ==============================================
   AI Chat / Story Event
   ============================================== */
.ai-event-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  margin-bottom: 12px;
}

.ai-event-banner .event-type {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.ai-event-banner .event-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ai-event-banner .event-desc {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.95;
}

/* ==============================================
   Toast & Day Transition Animations
   ============================================== */
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.day-transition-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-transition-content {
  text-align: center;
  color: #fff;
  padding: 40px 24px;
  animation: slideDown 0.5s ease-out;
}

.day-transition-day {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.day-transition-label {
  font-size: 16px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.day-transition-summary {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
  opacity: 0.9;
}

.day-transition-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 24px;
}

.day-transition-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: #007aff;
  color: #fff;
  font-family: inherit;
  transition: all 0.15s;
}

.day-transition-btn:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* ==============================================
   Home Screen Edit Mode (Long-press to jiggle)
   ============================================== */
@keyframes jiggle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-1.2deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(1.2deg); }
  100% { transform: rotate(0deg); }
}

.jiggle-mode .app-icon-wrapper,
.jiggle-mode .dock-icon-wrapper {
  animation: jiggle 0.35s ease-in-out infinite;
  cursor: grab;
}

.edit-mode-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}

.edit-mode-bar span {
  font-size: 17px;
  font-weight: 600;
  color: #000;
}

.edit-mode-bar button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  font-size: 17px;
  color: #007aff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
