/* style.css */

/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007aff;
    --primary-hover-color: #005bb0;
    --secondary-color: #f0f7ff;
    --secondary-hover-color: #dbeafe;
    --text-dark: #1c1c1e;
    --text-light: #8a8a8e;
    --bg-light: #f9f9fb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden {
    display: none;
}

/* --- Header --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5rem; /* 80px */
}

/* --- Header Coin Balance (新增的样式) --- */
.header-coin-balance {
    display: flex;
    align-items: center;
    color: var(--text-light); /* 默认文字颜色使用浅色 */
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
}

.header-coin-balance .coin-value {
    color: var(--text-dark); /* 猫币数值颜色使用深色 */
    font-weight: 700; /* 加粗显示 */
    margin-right: 0.25rem; /* 与后面的文字稍微隔开 */
    font-size: 0.875rem; /* 新增：将字号设置为 14px */
}

.header-coin-balance .login-prompt {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.header-coin-balance .login-prompt:hover {
    text-decoration: underline;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 2.5rem; /* 40px */
    width: 2.5rem;
    border-radius: 25%;
}

.logo h1 {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    margin: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-id {
    font-weight: 600;
}

.logout-button {
    font-size: 0.875rem;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.logout-button:hover {
    color: var(--text-dark);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}
.btn-primary:hover {
    background-color: var(--primary-hover-color);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover-color);
}
.btn.btn-sm {
    padding: 0.25rem 1rem;
}

/* --- Main Content --- */
main.container {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.coin-balance-card {
    background: var(--bg-white);
    border-radius: 1.5rem; /* 24px */
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}
.coin-balance-card h2 {
    font-size: 1.125rem; /* 18px */
    font-weight: 500;
    color: var(--text-light);
    margin: 0 0 0.5rem 0;
}
.login-prompt a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.login-prompt a:hover {
    text-decoration: underline;
}

.gift-section .section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 2.25rem; /* 36px */
    font-weight: 800;
    margin: 0;
}
.section-title p {
    margin-top: 1rem;
    font-size: 1.125rem; /* 18px */
    color: var(--text-light);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gift-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.gift-card {
    background: var(--bg-white);
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.gift-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
.gift-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-grow: 1; /* 让此元素占据所有剩余空间 */
}
.gift-icon {
    height: 4rem; /* 64px */
    width: 4rem;
    border-radius: 1rem;
    background-color: var(--bg-light);
}
.gift-details h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    margin: 0 0 0.25rem 0; /* 调整底部外边距，使其更紧凑 */
    /* --- 新增/修改代码 --- */
    line-height: 1.3; /* 减小行高，默认是 1.6 左右 */
    /* --- 新增/修改代码结束 --- */
}
.gift-details p {
    color: var(--text-light);
    font-weight: 600;
    margin: 0;
}
.progress-bar {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 9999px;
    height: 0.625rem; /* 10px */
    margin-bottom: 0.5rem;
}
.progress-bar-inner {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.progress-text {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}
.gift-card button {
    width: 100%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.gift-card button:disabled {
    background-color: #d1d5db; /* gray-300 */
    cursor: not-allowed;
}

/* --- Footer --- */
.site-footer-bottom {
    background: var(--bg-white);
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
}
.footer-content {
    text-align: center;
    color: var(--text-light);
}
.footer-content h2 {
    font-size: 1.125rem;
    color: var(--text-dark);
}
.footer-content p {
    font-size: 0.875rem;
    max-width: 800px;
    margin: 0.5rem auto;
}
.copyright {
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* --- Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
}
#modal-dialog-wrap{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-dialog {
    background: var(--bg-white);
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 90%;
    max-width: 380px;
    text-align: center;
    position: relative;
}
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af; /* gray-400 */
    cursor: pointer;
}
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}
.modal-description {
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
}
.qr-code-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    background-color: var(--bg-light);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-code-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
}
.qr-code-overlay p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.modal-countdown {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}
.countdown-timer {
    font-weight: 700;
    color: var(--primary-color);
}


/* --- Responsive Design --- */
@media (min-width: 640px) { /* sm */
    .gift-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) { /* lg */
    .gift-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1280px) { /* xl */
     .gift-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}