:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --panel: #ffffff;
  --panel-border: rgba(60, 60, 67, 0.10);
  --separator: rgba(60, 60, 67, 0.16);
  --text: #1c1c1e;
  --text-secondary: #6d6d72;
  --text-tertiary: #8e8e93;
  --tint: #007aff;
  --icon-surface: #f4f4f8;
  --icon-stroke: #8e8e93;
  --danger: #ff3b30;
  --radius: 14px;
  --content-width: 720px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 32px);
}

.content {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding-top: calc(env(safe-area-inset-top) + 18px);
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -16px;
  padding-top: env(safe-area-inset-top);
  background: rgba(242, 242, 247, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.08);
}

.nav-inner {
  position: relative;
  width: min(100%, var(--content-width));
  height: 44px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-title {
  max-width: calc(100% - 128px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-back {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--tint);
  cursor: pointer;
}

.nav-chevron {
  font-size: 22px;
  line-height: 1;
  margin-top: -1px;
}

.group-block + .group-block {
  margin-top: 22px;
}

.group-label {
  margin: 0 0 8px;
  padding: 0 16px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.3;
}

.group-card {
  overflow: hidden;
  border: 0.5px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.list-row + .list-row {
  border-top: 0.5px solid var(--separator);
}

.list-row:active {
  background: rgba(60, 60, 67, 0.06);
}

.row-icon {
  position: relative;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: var(--icon-surface);
}

.row-icon.folder::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 17px;
  height: 10px;
  border-radius: 3px;
  background: var(--icon-stroke);
}

.row-icon.folder::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 8px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--icon-stroke);
}

.row-icon.bookmark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 9px;
  height: 9px;
  border: 1.8px solid var(--icon-stroke);
  border-left: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.row-icon.bookmark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  width: 11px;
  height: 1.8px;
  border-radius: 999px;
  background: var(--icon-stroke);
  transform: rotate(-45deg);
  transform-origin: left center;
}

.row-title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.row-chevron {
  flex: 0 0 auto;
  color: #c7c7cc;
  font-size: 19px;
  line-height: 1;
}

.message-card {
  padding: 16px;
}

.message-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.message-body {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.message-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.action-link,
.action-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tint);
  cursor: pointer;
  font-size: 16px;
}

.error-text {
  color: var(--danger);
  word-break: break-word;
}

.skeleton-row {
  min-height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-row + .skeleton-row {
  border-top: 0.5px solid var(--separator);
}

.list-row.bookmark-row {
  gap: 11px;
}

.list-row.bookmark-row .row-title {
  padding-right: 2px;
}

.skeleton-icon,
.skeleton-line {
  background: linear-gradient(90deg, rgba(60, 60, 67, 0.08) 0%, rgba(60, 60, 67, 0.15) 50%, rgba(60, 60, 67, 0.08) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
}

.skeleton-line {
  width: 56%;
  height: 15px;
  border-radius: 999px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-bar {
    margin-left: -12px;
    margin-right: -12px;
  }

  .nav-inner {
    padding: 0 12px;
  }

  .nav-back {
    left: 12px;
  }
}