@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Sacramento&display=swap');

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

:root {
    --bg: #fef6f0;
    --bg-warm: #fff8f2;
    --card: #ffffff;
    --accent: #e8a07c;
    --accent-soft: #f5d0b5;
    --accent-dark: #d4886b;
    --pink: #f2b5c8;
    --pink-soft: #fce4ec;
    --pink-bg: #fff0f3;
    --text: #5d4037;
    --text-light: #a1887f;
    --text-muted: #c8b7a6;
    --border: #f0e6d8;
    --shadow: rgba(180,140,110,0.08);
    --shadow-md: rgba(180,140,110,0.14);
    --shadow-lg: rgba(180,140,110,0.20);
    --radius: 18px;
    --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(252,228,236,0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(245,208,181,0.5) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===== Navbar ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(240,230,216,0.45);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Sacramento', cursive;
    font-size: 1.25rem;
    color: var(--accent-dark);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.25s;
}
.logo:hover { opacity: 1; }

.nav-links { display:flex; align-items:center; gap:0.6rem; }
.nav-user {
    font-size: 0.85rem;
    color: var(--accent-dark);
    background: var(--pink-soft);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-weight: 500;
}
.nav-btn {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    transition: all 0.25s ease;
}
.nav-btn:hover {
    color: var(--accent-dark);
    background: var(--bg-warm);
}
.write-btn {
    background: linear-gradient(135deg, var(--accent), var(--pink)) !important;
    color: white !important;
    font-weight: 500;
    box-shadow: 0 3px 14px rgba(232,160,124,0.3);
    border: none;
}
.write-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(232,160,124,0.4);
}
.reg-btn {
    background: var(--pink-soft);
    color: var(--accent-dark) !important;
    font-weight: 500;
}

/* ===== Main ===== */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
    flex: 1;
    width: 100%;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
}
.hero-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}
.hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}
.subtitle {
    color: var(--text-light);
    font-size: 0.92rem;
}

/* ===== Posts ===== */
.posts-list { display:flex; flex-direction:column; gap:1rem; }

.post-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid rgba(240,230,216,0.35);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.post-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--pink), var(--accent-soft));
    opacity: 0;
    transition: opacity 0.3s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--shadow-md);
}
.post-card:hover::after { opacity: 1; }
.post-card a { text-decoration:none; color:inherit; display:block; }
.post-card .post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.5;
}
.post-preview {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-bottom: 0.9rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex;
    gap: 0.9rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===== Single Post ===== */
.post-full {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem 1.6rem;
    box-shadow: 0 2px 16px var(--shadow);
    border: 1px solid rgba(240,230,216,0.35);
    margin-bottom: 1.5rem;
}
.post-full .post-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}
.post-full .post-meta {
    margin-bottom: 1.3rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--border);
}
.post-content {
    font-size: 0.98rem;
    line-height: 2;
    color: var(--text);
    white-space: pre-wrap;
}

/* ===== Comments ===== */
.comments-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-dark);
    font-size: 1rem;
    font-weight: 600;
}
.comment-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
    background: var(--bg-warm);
    transition: all 0.25s;
    color: var(--text);
}
.comment-form textarea:focus {
    outline:none;
    border-color: var(--accent-soft);
    background: white;
    box-shadow: 0 0 0 4px rgba(232,160,124,0.08);
}

.comment {
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.6rem;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}
.comment-header strong { color: var(--accent-dark); font-size: 0.85rem; }
.comment-time { color: var(--text-muted); font-size:0.75rem; }
.comment p { font-size:0.9rem; color: var(--text); line-height: 1.6; }

.login-hint { color:var(--text-light); font-size:0.88rem; margin-bottom:1rem; }
.login-hint a { color:var(--accent-dark); text-decoration:none; font-weight:500; }

/* ===== Forms ===== */
.form-page {
    max-width: 380px;
    margin: 2.5rem auto;
    background: var(--card);
    padding: 2.5rem 2rem;
    border-radius: 22px;
    box-shadow: 0 8px 36px var(--shadow-md);
    border: 1px solid rgba(240,230,216,0.3);
}
.form-page h2 {
    text-align: center;
    font-weight: 700;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--accent-dark), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.8rem;
}

.auth-form, .write-form { display:flex; flex-direction:column; gap:0.9rem; }
.auth-form input, .write-form input, .write-form textarea {
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    background: var(--bg-warm);
    color: var(--text);
    transition: all 0.25s;
}
.auth-form input:focus, .write-form input:focus, .write-form textarea:focus {
    outline: none;
    border-color: var(--accent-soft);
    background: white;
    box-shadow: 0 0 0 4px rgba(232,160,124,0.08);
}
.auth-form input::placeholder, .write-form input::placeholder, .write-form textarea::placeholder {
    color: var(--text-muted);
}
.write-form textarea { resize:vertical; min-height:200px; line-height:1.8; }

/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    border: none;
    padding: 0.82rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.25s;
    box-shadow: 0 3px 14px rgba(232,160,124,0.25);
    margin-top: 0.3rem;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 22px rgba(232,160,124,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger {
    background: none;
    border: none;
    color: #e07a5f;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 1; }
.btn-sm { padding: 0.2rem 0.5rem; }
.btn-xs { padding: 0.1rem 0.4rem; font-size: 0.72rem; }
.inline-form { display:inline; }

.form-hint {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-light);
}
.form-hint a { color: var(--accent-dark); text-decoration:none; font-weight:500; }

/* ===== Flash ===== */
.flash-messages { margin-bottom:1.2rem; }
.flash {
    background: var(--pink-soft);
    color: var(--accent-dark);
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    border: 1px solid rgba(242,181,200,0.3);
}

/* ===== Empty ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
    font-size: 1rem;
}
.empty-state::before {
    content: '\1F338';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}
.footer-heart {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.footer p { font-size: 0.85rem; }
.footer-sub { font-size: 0.75rem; margin-top: 0.2rem; opacity: 0.6; }


/* ===== Reply ===== */
.comment-reply {
    margin-left: 1.5rem;
    border-left: 3px solid var(--accent-soft);
    background: var(--pink-bg);
}
.reply-tag {
    font-size: 0.78rem;
    color: var(--pink);
    font-weight: 500;
}
.reply-btn {
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-muted);
    margin-left: auto;
    transition: color 0.2s;
}
.reply-btn:hover { color: var(--accent-dark); }
.reply-hint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    background: var(--pink-soft);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--accent-dark);
}
.reply-hint a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.reply-hint a:hover { color: var(--danger); }
/* ===== Mobile ===== */
@media (max-width: 600px) {
    .navbar { padding: 0.75rem 1rem; }
    .logo { font-size: 1.3rem; }
    .container { padding: 1rem 0.9rem; }
    .hero { padding: 2rem 0.5rem 1.5rem; }
    .hero h1 { font-size: 1.35rem; }
    .hero-emoji { font-size: 2rem; }
    .form-page { margin: 1.5rem 0.8rem; padding: 2rem 1.5rem; }
    .post-full { padding: 1.4rem 1.2rem; }
    .post-card { padding: 1.2rem; }
    .nav-links { gap: 0.4rem; }
    .nav-btn { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
}
