/* ===== 品牌色板 ===== */
:root {
    --primary: #f472b6;
    --primary-dark: #db2777;
    --secondary: #fce7f3;
    --accent: #fbbf24;
    --bg: #fff5f9;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --border: #f3e8f0;
    --shadow: 0 4px 20px rgba(244, 114, 182, 0.12);
    --shadow-hover: 0 8px 32px rgba(244, 114, 182, 0.22);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 450px;
    --nav-height: 60px;
    --bottom-nav-height: 64px;
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: #f0e6ed;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, textarea, button, select { font-family: inherit; font-size: inherit; outline: none; border: none; }
button { cursor: pointer; background: none; }

/* ===== APP容器 ===== */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* ===== 导航栏 ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 245, 249, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    transition: box-shadow 0.3s;
}
.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(244, 114, 182, 0.12);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}
.nav-left { display: flex; align-items: center; }
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon {
    width: 32px;
    height: 32px;
}
.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}
.nav-right {
    display: flex;
    gap: 4px;
}
.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-light);
    transition: all 0.2s;
}
.nav-link i { font-size: 16px; }
.nav-link span { font-size: 11px; }
.nav-link.active,
.nav-link:hover { color: var(--primary-dark); background: var(--secondary); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(255, 245, 249, 0.97);
    backdrop-filter: blur(12px);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    max-width: var(--max-width);
    margin: 0 auto;
}
.mobile-menu.open { display: block; }
.mobile-link {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    transition: 0.2s;
}
.mobile-link i { width: 24px; color: var(--primary); }
.mobile-link.active { background: var(--secondary); color: var(--primary-dark); }
.mobile-link:hover { background: var(--secondary); }

/* ===== 主内容 ===== */
.main-content {
    padding-bottom: calc(var(--bottom-nav-height) + 24px);
    min-height: calc(100vh - var(--nav-height));
}
.page-content {
    padding: 20px 16px;
}
.page-header {
    text-align: center;
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}
.page-desc {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== Hero区域 ===== */
.hero {
    position: relative;
    padding: 60px 20px 50px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 50%, #fff1f2 100%);
}
.hero-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(244, 114, 182, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(251, 191, 36, 0.06) 0%, transparent 50%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-logo {
    width: 200px;
    margin: 0 auto 16px;
}
.hero-slogan {
    font-size: 26px;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.hero-desc {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 28px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.25s;
    min-height: 44px;
    border: 2px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(244, 114, 182, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.45);
}
.btn-primary:active { transform: scale(0.96); }
.btn-secondary {
    background: rgba(255,255,255,0.8);
    color: var(--primary-dark);
    border-color: var(--primary);
    backdrop-filter: blur(4px);
}
.btn-secondary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--secondary);
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 18px; font-size: 13px; min-height: 36px; }
.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover { background: #dc2626; }

/* ===== 章节 ===== */
.section {
    padding: 40px 16px;
}
.section-header {
    text-align: center;
    margin-bottom: 28px;
}
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.section-subtitle {
    color: var(--text-light);
    font-size: 14px;
}
.section-footer {
    text-align: center;
    margin-top: 24px;
}

/* ===== 卡片网格 ===== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: default;
}
.feature-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}
.feature-card .card-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}
.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.feature-card p {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== 笔记列表 ===== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.note-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}
.note-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}
.note-card .note-tag {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
    font-weight: 500;
}
.note-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.note-card p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-card .note-date {
    display: block;
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 10px;
}

/* ===== 相册网格 ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    background: var(--card-bg);
    cursor: pointer;
}
.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}
.gallery-item .gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
}
.gallery-item .gallery-info {
    padding: 10px 12px;
}
.gallery-item .gallery-info h4 {
    font-size: 14px;
    font-weight: 600;
}
.gallery-item .gallery-info p {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== 统计数据 ===== */
.stats {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    margin: 0 16px;
    border-radius: var(--radius);
    padding: 32px 16px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}
.stat-item {
    color: #fff;
}
.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
}

/* ===== 底部导航 (移动APP风格) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    height: var(--bottom-nav-height);
    background: rgba(255, 245, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 11px;
    transition: all 0.2s;
    min-width: 60px;
}
.bottom-nav-item i {
    font-size: 20px;
    transition: 0.2s;
}
.bottom-nav-item.active {
    color: var(--primary-dark);
}
.bottom-nav-item.active i {
    transform: scale(1.1);
}
.bottom-nav-item:hover {
    color: var(--primary-dark);
}

/* ===== 页脚 ===== */
.footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 40px 16px 24px;
    margin-top: 20px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}
.footer-logo {
    width: 180px;
    margin: 0 auto 12px;
    filter: brightness(0.9);
}
.footer-desc {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: 13px;
    color: #9ca3af;
    transition: 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #d1d5db;
    font-size: 18px;
    transition: 0.3s;
}
.footer-social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}
.footer-copy {
    font-size: 12px;
    color: #6b7280;
}

/* ===== 联系页 ===== */
.contact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.contact-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow);
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: #f9fafb;
    border: 2px solid var(--border);
    font-size: 15px;
    transition: 0.2s;
    color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.contact-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.info-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}
.info-card i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}
.info-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.info-card p {
    font-size: 12px;
    color: var(--text-light);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}
.social-links a {
    font-size: 20px;
    color: var(--text-light);
    transition: 0.2s;
}
.social-links a:hover { color: var(--primary); }

/* ===== 后台管理 ===== */
.admin-page .login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}
.admin-page .login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { width: 180px; margin: 0 auto 16px; }
.login-card h2 { font-size: 20px; margin-bottom: 20px; color: var(--text); }
.login-form .form-group { text-align: left; }
.login-error { color: #ef4444; font-size: 13px; margin-top: 10px; min-height: 20px; }

.admin-panel {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 0 80px;
}
.admin-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-header h2 { font-size: 18px; color: var(--text); }
.admin-header h2 i { color: var(--primary); margin-right: 8px; }

.admin-tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: 0.2s;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}
.tab-btn i { margin-right: 4px; }
.tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.admin-content {
    padding: 20px 16px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel h3 { font-size: 18px; margin-bottom: 16px; }

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.admin-item .item-info { flex: 1; min-width: 0; }
.admin-item .item-info h4 { font-size: 14px; font-weight: 600; }
.admin-item .item-info p { font-size: 12px; color: var(--text-light); }
.admin-item .item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-item .item-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    transition: 0.2s;
}
.btn-edit { background: var(--secondary); color: var(--primary-dark); }
.btn-delete { background: #fee2e2; color: #dc2626; }
.btn-toggle { background: #f3f4f6; color: var(--text-light); }
.btn-edit:hover { background: #fbcfe8; }
.btn-delete:hover { background: #fecaca; }
.btn-toggle:hover { background: #e5e7eb; }

.success-msg { color: #10b981; font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-card {
    background: #fff;
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
    font-size: 28px;
    color: var(--text-light);
    line-height: 1;
    padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.form-actions .btn { flex: 1; }

/* ===== Toast消息 ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    max-width: 90%;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .hero { padding: 40px 16px 36px; }
    .hero-slogan { font-size: 22px; }
    .cards-grid { gap: 10px; }
    .feature-card { padding: 16px 12px; }
    .feature-card .card-icon { font-size: 28px; }
    .gallery-grid { gap: 10px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .stat-number { font-size: 22px; }
    .contact-info { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .nav-right { display: none; }
    .hamburger { display: flex; }
    .admin-tabs { gap: 0; }
    .tab-btn { font-size: 12px; padding: 10px 4px; }
    .admin-item { flex-direction: column; align-items: flex-start; }
    .admin-item .item-actions { width: 100%; justify-content: flex-end; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-info { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 769px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .hero { padding: 80px 40px 60px; }
    .hero-slogan { font-size: 32px; }
}