:root {
  color-scheme: light;
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --primary: #4c6ef5;
  --primary-dark: #364fc7;
  --accent: #ff922b;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 20%, #f8fbff 0%, #eef3ff 45%, #e4edff 100%);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.app-title {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn.active,
.ghost-btn.active {
  box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.25);
}

.primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

.ghost-btn {
  background: rgba(76, 110, 245, 0.12);
  color: var(--primary-dark);
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: rgba(76, 110, 245, 0.18);
}

.stories {
  background: var(--surface);
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.story-count {
  font-weight: 600;
  color: var(--text-muted);
}

.story-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.story-card {
  background: linear-gradient(145deg, rgba(76, 110, 245, 0.12), rgba(143, 155, 246, 0.12));
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  border: 1px solid rgba(76, 110, 245, 0.15);
}

.story-image {
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.story-info {
  padding: 12px 14px 16px;
}

.story-author {
  margin: 0 0 6px;
  font-size: 1rem;
}

.story-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.story-time {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--primary-dark);
}

.composer {
  background: var(--surface);
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.composer.hidden {
  display: none;
}

.composer h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.5rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

label span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 110, 245, 0.15);
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title {
  margin: 0 0 -4px;
  font-size: 1.6rem;
}

.feed-list {
  display: grid;
  gap: 18px;
}

.post-card {
  background: var(--surface);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4c6ef5, #7950f2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.post-author {
  margin: 0;
  font-size: 1.1rem;
}

.post-time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.save-btn {
  margin-left: auto;
  border: none;
  background: rgba(76, 110, 245, 0.1);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.save-btn.saved {
  background: var(--primary);
  color: white;
}

.save-btn:hover {
  transform: translateY(-1px);
}

.post-content {
  margin: 0;
  line-height: 1.6;
  font-size: 1.05rem;
}

.post-image {
  width: 100%;
  max-height: 380px;
  border-radius: 22px;
  object-fit: cover;
}

.post-image.hidden {
  display: none;
}

.post-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.like-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  background: rgba(255, 146, 43, 0.18);
  color: #d9480f;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.like-btn.liked {
  background: #ff922b;
  color: white;
}

.like-btn:hover {
  transform: translateY(-1px);
}

.like-count {
  font-weight: 600;
  color: var(--text-muted);
}

.comments {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 18px;
  padding: 16px;
}

.comment-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.comment-list li {
  background: white;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.95rem;
}

.comment-form {
  display: flex;
  gap: 10px;
}

.comment-form input {
  flex: 1;
  border-radius: 12px;
}

.comment-form button {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.comment-form button:hover {
  background: var(--primary-dark);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 20px 14px 60px;
  }

  .app-title {
    font-size: 2rem;
  }

  .app-header {
    align-items: flex-start;
  }

  .story-list {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .post-card {
    border-radius: 22px;
  }

  .post-content {
    font-size: 1rem;
  }
}
