@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
/* 新增：引入另外两款毛笔字体供选择 */
@import url('https://fonts.googleapis.com/css2?family=Long+Cang&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Zhi+Mang+Xing&display=swap');
/*
  全站通用样式 (common.css)
*/

/* --- 页面背景 --- */
.page-body {
    position: relative;
    background-color: #f3f4f6; /* 备用背景色 */
    overflow-x: hidden;
}

.page-body::before, .page-body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
}

.page-body::before {
    /* background-image: url('https://images.unsplash.com/photo-1549921297-3c501a3503a4?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&w=1600'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.page-body::after {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    z-index: -1;
}

/* --- 页面过渡与加载器 --- */
#page-content {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}
#page-content.is-loaded {
    opacity: 1;
}
.page-fade-out {
    opacity: 0 !important;
}
.page-loader {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
.page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.page-loader .spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #fee2e2;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- 统一导航栏 --- */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background-color: rgba(254, 242, 242, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.nav-container {
    max-width: 80rem;
    margin: auto;
    padding: 0 1rem;
}
@media (min-width: 640px) { .nav-container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .nav-container { padding: 0 2rem; } }

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}
.nav-logo-section {
    display: flex;
    align-items: center;
}
/* 更新：Logo链接样式 */
.nav-logo-link {
    font-size: 2.25rem; /* 适当增大字体以更好地展示书法效果 */
    font-weight: normal; /* 书法字体通常不需要额外加粗 */
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    /* 新增：应用毛笔字体 */
    font-family: 'Ma Shan Zheng', cursive;
}
/* 新增：Logo图标样式 */
.nav-logo-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: #ef4444; /* red-500 */
}

.nav-links-section {
    display: none;
}
@media (min-width: 768px) {
  .nav-links-section {
    display: flex;
    align-items: baseline;
    gap: 1rem;
  }
}
.nav-link {
    position: relative;
    color: #4b5563;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.nav-link:hover {
    color: #dc2626;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #dc2626;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}
.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}
.nav-link-active {
    background-color: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.nav-action-section {
    display: flex;
    align-items: center;
}
.nav-favorite-link {
    color: #9ca3af;
    margin-left: 1rem;
    transition: color 0.2s, transform 0.2s;
}
.nav-favorite-link:hover {
    color: #f87171;
    transform: scale(1.1);
}

/* --- 页面主内容区 --- */

.main-container {
  max-width: 80rem;
  margin: auto;
  padding: 1.5rem 1rem;
}
@media (min-width: 640px) { .main-container { padding: 1.5rem; } }
@media (min-width: 1024px) { .main-container { padding: 1.5rem 2rem; } }
.content-card {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}
@media (min-width: 768px) { .content-card { padding: 2rem; } }
.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

/* 导航栏中的登录/用户信息 */
.auth-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-login-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280; /* text-gray-500 */
    transition: color 0.2s, transform 0.2s;
    padding: 0.25rem;
}
.nav-login-button:hover {
    color: #ef4444; /* text-red-500 */
    transform: scale(1.1);
}
.nav-login-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.nav-user-info {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}
.nav-logout-button {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-logout-button:hover {
    color: #dc2626;
}

/* 登录/注册弹窗 */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}
.auth-modal-content {
    position: relative;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 24rem; /* 384px */
}
.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.auth-modal-close:hover {
    color: #1f2937;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}
.auth-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
}

.auth-button {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: none;
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.auth-button:hover {
    background-color: #b91c1c;
}

.auth-toggle {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #4b5563;
    text-align: center;
}
.auth-toggle a {
    color: #dc2626;
    font-weight: 500;
    text-decoration: none;
}
.auth-toggle a:hover {
    text-decoration: underline;
}

.auth-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: center;
}

.hidden {
    display: none;
}