/* ========================================
   尘缘未了 - 主题样式
   ======================================== */

/* 基础重置与变量 */
:root {
    --primary-color: #ff6b9d;
    --primary-dark: #c44569;
    --primary-light: #ffb8d0;
    --secondary-color: #ff8a80;
    --accent-color: #ffd1dc;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fff5f8;
    --card-bg: #ffffff;
    --shadow: 0 10px 40px rgba(255, 107, 157, 0.15);
    --shadow-hover: 0 15px 50px rgba(255, 107, 157, 0.25);
    --border-radius: 20px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #fff5f8 0%, #ffe4ec 50%, #ffd1dc 100%);
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
}

/* ========================================
   背景粒子效果
   ======================================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 15s infinite;
}

@keyframes float-particle {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   入口页面
   ======================================== */
.entry-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.entry-container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 450px;
    width: 100%;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-container.fade-out {
    animation: fadeOutUp 0.5s ease forwards;
}

@keyframes fadeOutUp {
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.logo-heart {
    margin-bottom: 30px;
}

.heart-svg {
    width: 80px;
    height: 80px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.site-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.2);
}

.site-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    letter-spacing: 8px;
}

.password-form {
    margin-top: 30px;
}

.hint-text {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 15px;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    outline: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.input-group input.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.enter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 1.1rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.enter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.5);
}

.enter-btn .arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.enter-btn:hover .arrow-icon {
    transform: translateX(5px);
}

.error-msg {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* 浮动爱心 */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-heart {
    position: absolute;
    color: var(--primary-light);
    font-size: 1.5rem;
    opacity: 0.5;
    animation: float-heart 6s ease-in-out infinite;
}

.float-heart:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.float-heart:nth-child(2) { left: 85%; top: 30%; animation-delay: 1s; }
.float-heart:nth-child(3) { left: 15%; top: 70%; animation-delay: 2s; }
.float-heart:nth-child(4) { left: 80%; top: 75%; animation-delay: 3s; }
.float-heart:nth-child(5) { left: 50%; top: 10%; animation-delay: 4s; }

@keyframes float-heart {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* ========================================
   导航栏
   ======================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(255, 107, 157, 0.1);
    backdrop-filter: blur(10px);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-back svg {
    width: 20px;
    height: 20px;
}

.nav-back:hover {
    color: var(--primary-dark);
}

.nav-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-names {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========================================
   好感度页面
   ======================================== */
.view-page {
    padding-top: 80px;
    min-height: 100vh;
}

.feelings-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px 20px;
}

.feelings-card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 50px 40px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

.feelings-header {
    text-align: center;
    margin-bottom: 40px;
}

.feelings-header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.days-together {
    color: var(--text-light);
    font-size: 1rem;
}

.days-together .highlight {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 5px;
}

.feelings-gauge {
    text-align: center;
    margin-bottom: 40px;
}

.gauge-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.gauge-percent {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.gauge-label {
    margin-top: 20px;
}

.level-title {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50px;
    font-size: 1.2rem;
}

.feelings-description {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 209, 220, 0.3));
    border-radius: 15px;
    margin-bottom: 40px;
}

.feelings-description p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
}

.love-messages {
    text-align: center;
}

.love-messages h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.messages-carousel {
    position: relative;
    min-height: 120px;
}

.message-card {
    position: absolute;
    width: 100%;
    padding: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.message-card.active {
    opacity: 1;
    transform: translateY(0);
}

.message-card .quote-mark {
    color: var(--primary-light);
    font-size: 2rem;
    font-family: Georgia, serif;
}

.message-card p {
    color: var(--text-color);
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.8;
    margin: 10px 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dots .dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* 浮动元素 */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-element {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: float-element 8s ease-in-out infinite;
}

.float-element:nth-child(1) { left: 5%; top: 10%; animation-delay: 0s; }
.float-element:nth-child(2) { left: 90%; top: 20%; animation-delay: 1.5s; }
.float-element:nth-child(3) { left: 10%; top: 80%; animation-delay: 3s; }
.float-element:nth-child(4) { left: 85%; top: 70%; animation-delay: 4.5s; }
.float-element:nth-child(5) { left: 50%; top: 5%; animation-delay: 6s; }

@keyframes float-element {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

/* ========================================
   日志页面
   ======================================== */
.logs-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.logs-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease;
}

.logs-header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logs-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.empty-logs {
    text-align: center;
    padding: 80px 40px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-logs p {
    color: var(--text-light);
    font-size: 1.2rem;
}

.empty-hint {
    margin-top: 10px;
    font-size: 0.95rem !important;
    color: var(--primary-light) !important;
}

/* 时间轴 */
.logs-timeline {
    position: relative;
    padding: 20px 0;
}

.logs-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
    border-radius: 3px;
}

.log-item {
    position: relative;
    width: 50%;
    padding: 20px;
    animation: fadeInUp 0.6s ease;
}

.log-item.left {
    left: 0;
    padding-right: 50px;
}

.log-item.right {
    left: 50%;
    padding-left: 50px;
}

.log-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    top: 30px;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.3);
}

.log-item.left .log-dot {
    right: -8px;
}

.log-item.right .log-dot {
    left: -8px;
}

.log-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.log-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.log-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}

.date-day {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.date-month {
    font-size: 0.9rem;
    color: var(--text-light);
}

.log-title {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 12px;
}

.log-text {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

.log-image {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
}

.log-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.log-image img:hover {
    transform: scale(1.02);
}

.log-mood {
    display: inline-block;
    margin-top: 15px;
    padding: 5px 15px;
    background: rgba(255, 107, 157, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 响应式时间轴 */
@media (max-width: 768px) {
    .logs-timeline::before {
        left: 20px;
    }
    
    .log-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 20px;
    }
    
    .log-item.left,
    .log-item.right {
        left: 0;
        padding-left: 50px;
    }
    
    .log-item.left .log-dot,
    .log-item.right .log-dot {
        left: 12px;
        right: auto;
    }
}

/* ========================================
   后台管理页面
   ======================================== */
.admin-page {
    background: #f5f7fa;
}

/* 登录界面 */
.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.admin-login-card {
    background: white;
    padding: 50px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.admin-login-card h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.admin-login-card > p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.admin-login-form input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: var(--transition);
}

.admin-login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.admin-login-form button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.admin-login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary-color);
}

/* 管理界面 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-nav {
    width: 250px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.admin-logo {
    color: white;
    margin-bottom: 40px;
    text-align: center;
}

.admin-logo span {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
}

.admin-logo small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.admin-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-btn {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.menu-btn:hover,
.menu-btn.active {
    background: rgba(255, 255, 255, 0.25);
}

.logout-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

.admin-section {
    display: none;
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.admin-section.active {
    display: block;
}

.admin-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.admin-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.range-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.feelings-range {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    outline: none;
}

.feelings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 50px;
}

.submit-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.form-actions {
    display: flex;
    gap: 15px;
}

.cancel-btn {
    padding: 15px 30px;
    background: #f0f0f0;
    color: var(--text-color);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* 日志列表 */
.add-log-section {
    margin-bottom: 40px;
}

.add-log-section h3,
.logs-list-section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.logs-list {
    max-height: 500px;
    overflow-y: auto;
}

.log-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.log-list-item:hover {
    background: #f0f0f0;
}

.log-list-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.log-list-date {
    color: var(--primary-color);
    font-weight: 500;
}

.log-list-mood {
    font-size: 1.2rem;
}

.log-list-title {
    color: var(--text-color);
}

.log-list-actions {
    display: flex;
    gap: 10px;
}

.edit-log-btn,
.delete-log-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.edit-log-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.delete-log-btn {
    background: #ffebee;
    color: #e74c3c;
}

.edit-log-btn:hover {
    background: var(--primary-color);
    color: white;
}

.delete-log-btn:hover {
    background: #e74c3c;
    color: white;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 30px;
    background: #333;
    color: white;
    border-radius: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* 响应式管理界面 */
@media (max-width: 900px) {
    .admin-nav {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .admin-logo {
        margin-bottom: 0;
        margin-right: auto;
    }
    
    .admin-menu {
        flex-direction: row;
        width: 100%;
        margin-top: 15px;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 20px;
    }
    
    .admin-section {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   通用响应式
   ======================================== */
@media (max-width: 600px) {
    .entry-container {
        padding: 40px 25px;
    }
    
    .site-title {
        font-size: 2.2rem;
    }
    
    .feelings-card {
        padding: 30px 20px;
    }
    
    .gauge-container {
        width: 160px;
        height: 160px;
    }
    
    .gauge-value {
        font-size: 2.5rem;
    }
}
