/* 样式：偏莫兰迪、小红书风格，柔和配色 + 卡片布局 */

:root {
  --bg-main: #f7f5f4;
  --bg-card: #ffffff;
  --bg-card-soft: #f4efec;
  --accent: #f3a6a0;
  --accent-soft: #fbe3df;
  --accent-strong: #f07c6a;
  --text-main: #353238;
  --text-soft: #7c7278;
  --border-soft: #e0d4cf;
  --shadow-soft: 0 18px 40px rgba(27, 20, 15, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui,
    -system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(circle at top, #fdf3f1 0, #f7f5f4 40%, #f2f3f6 100%);
  color: var(--text-main);
}

body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    180deg,
    rgba(247, 245, 244, 0.95),
    rgba(247, 245, 244, 0.88),
    rgba(247, 245, 244, 0.7)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: conic-gradient(from 210deg, #f3a6a0, #f2c3a5, #e9d4c2, #f3a6a0);
  box-shadow: 0 10px 24px rgba(243, 166, 160, 0.5);
}

.brand-badge.admin {
  background: conic-gradient(from 210deg, #a7b1f3, #f2c3a5, #e9d4c2, #a7b1f3);
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  color: var(--text-soft);
}

.ghost-btn {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
}

.ghost-btn:hover {
  background: #fff;
}

.app-main {
  flex: 1;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin-top: 28px;
  padding: 24px 22px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.94),
      rgba(249, 245, 243, 0.98)
    ),
    radial-gradient(circle at top right, rgba(243, 166, 160, 0.07), transparent 55%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.auth-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.auth-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  background: #f2ece8;
  border-radius: var(--radius-pill);
  padding: 3px;
}

.tab-btn {
  flex: 1;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-soft);
}

.tab-active {
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.field.row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.field input[type='text'],
.field input[type='tel'],
.field input[type='password'],
.field input[type='file'],
.field textarea {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(221, 210, 204, 0.95);
  background: rgba(255, 255, 255, 0.96);
  outline: none;
  font-size: 14px;
}

.field textarea {
  resize: vertical;
  min-height: 92px;
}

.field input:focus,
.field textarea:focus {
  border-color: #f3a6a0;
  box-shadow: 0 0 0 1px rgba(243, 166, 160, 0.4);
}

.primary-btn {
  border-radius: var(--radius-pill);
  border: none;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f3a6a0, #f07c6a);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(243, 166, 160, 0.55);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #f4948b, #f06852);
}

.full-width {
  width: 100%;
}

.hint-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Feed 布局 */
.feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 620px);
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  margin-top: 22px;
}

.compose-card,
.feed-card {
  background: var(--bg-card-soft);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.compose-card h2,
.feed-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  background: #efe7e2;
  border-radius: var(--radius-pill);
  padding: 2px;
}

.seg-btn {
  border-radius: var(--radius-pill);
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--text-soft);
}

.seg-active {
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding-right: 6px;
}

.post-card {
  background: #fff;
  border-radius: 18px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3a6a0, #f2c3a5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

.post-name {
  font-size: 13px;
  color: var(--text-main);
}

.post-time {
  font-size: 11px;
  color: var(--text-soft);
}

.post-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.post-content {
  margin: 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
}

.post-image {
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(240, 231, 225, 0.9);
}

.post-image img {
  display: block;
  width: 100%;
  height: auto;
}

.post-meta-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-soft);
}

.privacy-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(243, 166, 160, 0.12);
  color: #e36b5b;
}

.privacy-tag.private {
  background: rgba(144, 148, 171, 0.12);
  color: #666a88;
}

/* pill radio */
.pill-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(221, 210, 204, 0.9);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.pill-radio input {
  accent-color: #f3a6a0;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(33, 27, 24, 0.94);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

/* Admin */
.admin-body {
  background: radial-gradient(circle at top, #f1f2fd 0, #f7f5f4 40%, #f4f1ff 100%);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 640px);
  gap: 20px;
  width: 100%;
  max-width: 1140px;
  margin-top: 22px;
}

.textarea-mono {
  width: 100%;
  border-radius: 14px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;
  border: 1px solid rgba(221, 210, 204, 0.95);
  background: rgba(255, 255, 255, 0.98);
  font-size: 12px;
}

.admin-table-section {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.admin-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-post-item {
  background: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 237, 252, 0.9);
}

.admin-post-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.admin-post-row strong {
  color: var(--text-main);
}

.admin-inline-input {
  border-radius: 999px;
  border: 1px solid #e0d4cf;
  padding: 2px 8px;
  font-size: 11px;
}

.admin-inline-textarea {
  width: 100%;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid #e0d4cf;
  padding: 4px 6px;
  font-size: 12px;
  resize: vertical;
}

.admin-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.admin-save-btn {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  background: #a7b1f3;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.admin-save-btn:hover {
  background: #8f9af0;
}

/* 响应式 */
@media (max-width: 900px) {
  .feed-layout,
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .compose-card,
  .feed-card {
    max-width: 680px;
    margin: 0 auto;
  }

  .post-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 12px;
  }

  .auth-card {
    margin-top: 18px;
    padding: 18px 14px 20px;
  }

  .feed-layout,
  .admin-layout {
    margin-top: 14px;
  }
}


