/* ============================================
   CozeS Community — Global Styles
   cozes.top 付费社区独立站
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #222222;
  --accent: #d4a853;
  --accent-dim: rgba(212, 168, 83, 0.15);
  --text: #e8e4dd;
  --text-muted: #7a756e;
  --text-dim: #4a4740;
  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;
  --radius: 8px;
  --radius-lg: 16px;
  --font-serif: 'Noto Serif SC', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Global Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Body --- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Grain Texture Overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

p {
  margin-bottom: 1em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav__brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__brand .diamond {
  font-size: 0.8em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text);
  opacity: 1;
}

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

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #0a0a0a;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 168, 83, 0.3);
  opacity: 1;
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}

.btn--ghost:hover {
  color: var(--text);
  opacity: 1;
}

.btn--sm {
  padding: 8px 18px;
  font-size: 13px;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 168, 83, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero__badge {
  display: inline-block;
  padding: 6px 20px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 32px;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text);
}

.hero__subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 168, 83, 0.2);
}

.card__tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.card__tag--free {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
}

.card__tag--member {
  background: var(--accent-dim);
  color: var(--accent);
}

.card__tag--premium {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
}

.card__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card__meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.card__excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Card with lock overlay */
.card--locked {
  position: relative;
}

.card--locked .card__body {
  position: relative;
}

.card--locked .card__body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

.lock-icon {
  color: var(--accent);
  font-size: 14px;
}

/* ============================================
   Grid Layout
   ============================================ */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 {
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ============================================
   Section
   ============================================ */
.section {
  padding: 80px 0;
}

.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section__desc {
  font-size: 15px;
  color: var(--text-muted);
}

/* ============================================
   Pricing
   ============================================ */
.pricing__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.pricing__card:hover {
  transform: translateY(-4px);
}

.pricing__card--featured {
  border-color: var(--accent);
  position: relative;
}

.pricing__card--featured::before {
  content: '推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 20px;
  border-radius: 100px;
}

.pricing__plan {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pricing__amount {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.pricing__amount small {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}

.pricing__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.pricing__features {
  list-style: none;
  text-align: left;
  margin-bottom: 32px;
}

.pricing__features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing__features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.pricing__features li:last-child {
  border-bottom: none;
}

/* ============================================
   Forms
   ============================================ */
.form__group {
  margin-bottom: 20px;
}

.form__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  outline: none;
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  border-color: var(--accent);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--text-dim);
}

.form__textarea {
  min-height: 120px;
  resize: vertical;
}

.form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a756e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form__hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.form__error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.35s ease;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast--show {
  transform: translateX(0);
}

.toast--success {
  background: var(--success);
  color: #0a0a0a;
}

.toast--error {
  background: var(--error);
  color: #0a0a0a;
}

.toast--warning {
  background: var(--warning);
  color: #0a0a0a;
}

/* ============================================
   Article
   ============================================ */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 0;
}

.article h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: 18px;
  margin: 32px 0 12px;
}

.article p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.8;
}

.article blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

.article code {
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--accent);
}

.article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.article pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.article img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.article__header {
  margin-bottom: 40px;
}

.article__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article__meta {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Locked content overlay */
.locked-overlay {
  position: relative;
  margin-top: 32px;
  padding-top: 48px;
  text-align: center;
}

.locked-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100vw;
  right: -100vw;
  height: 120px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.locked-overlay__icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.locked-overlay__text {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============================================
   Comments
   ============================================ */
.comments {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.comments__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.comments__form {
  margin-bottom: 40px;
}

.comments__list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.comment__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.comment__author {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}

.comment__date {
  font-size: 12px;
  color: var(--text-dim);
}

.comment__body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard {
  padding: 40px 0;
}

.dashboard__header {
  margin-bottom: 40px;
}

.dashboard__welcome {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dashboard__status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.dashboard__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn--active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   Admin Stats
   ============================================ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-card__value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-card__label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   Table
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: var(--surface-hover);
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge--success {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
}

.badge--warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.badge--error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer__text {
  font-size: 13px;
  color: var(--text-dim);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

.footer__links a {
  font-size: 13px;
  color: var(--text-dim);
}

.footer__links a:hover {
  color: var(--text-muted);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.auth-box__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.auth-box__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.auth-box__footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-box__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 12px;
}

.auth-box__divider::before,
.auth-box__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay--show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.25s;
}

.modal-overlay--show .modal {
  transform: scale(1);
}

.modal__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal__body {
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: hidden;
  position: relative;
}

.skeleton__line {
  height: 14px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton__line--title {
  height: 20px;
  width: 70%;
}

.skeleton__line--short {
  width: 40%;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  animation: shimmer 1.5s infinite;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination__btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination__btn--active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-fade-up {
  animation: fadeUp 0.5s ease forwards;
}

/* ============================================
   Responsive — 768px
   ============================================ */
@media (max-width: 768px) {
  .hero {
    padding: 80px 0 60px;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .nav__links {
    display: none;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .pricing__card {
    padding: 32px 24px;
  }

  .auth-box {
    padding: 32px 24px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 48px 0;
  }
}
