/* ============================================
   线条小狗风格 - Maltese Theme
   可爱 | 圆润 | 明亮 | 治愈
============================================ */

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

body {
    font-family: 'Comic Neue', 'Chalkboard SE', 'Comic Neue', 'Segoe UI Emoji', 'Apple Color Emoji', 
                 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #FFF9F0;  /* 温暖的奶油色背景 */
    min-height: 100vh;
    padding-top: 70px;
    color: #5A4A3A;
}

/* 自定义滚动条 - 可爱版 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #FFE8D6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #FFB347;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF9F1C;
}

/* 导航栏 */
.navbar {
    background: white;
    box-shadow: 0 4px 15px rgba(255, 180, 70, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 3px solid #FFD89B;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: #FF9F1C;
    transition: transform 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #8B7355;
    font-weight: 600;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 15px;
}

.nav-links a:hover {
    color: #FF9F1C;
    background: #FFF5E8;
    transform: translateY(-2px);
}

.login-link, .chat-link {
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white !important;
}

.login-link:hover, .chat-link:hover {
    background: linear-gradient(135deg, #FF9F1C 0%, #FF8C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.4);
}

.logout-link {
    color: #D49A6A !important;
}

.logout-link:hover {
    background: #FFF0E0 !important;
}

/* ========== 公共卡片样式 ========== */
.hero, .profile-card, .about-container, .projects-container, 
.contact-container, .feature-card, .project-card {
    border-radius: 35px;
    box-shadow: 0 10px 30px rgba(255, 180, 70, 0.12);
    transition: transform 0.3s, box-shadow 0.3s;
}

.hero:hover, .profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 180, 70, 0.18);
}

/* 主要内容区 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========== 首页 ========== */
/* ========== 首页 ========== */
.hero {
    /* 将原来的 dog.svg 改成您的新文件名 */
    background-image: url('/static/images/happy-dancing-maltese.gif');
    background-repeat: no-repeat;
    background-position: bottom right;
    background-size: 160px;  /* 您可以调整这个数值来改变动图大小 */
    background-color: white;
    padding: 50px 40px;
    text-align: center;
    margin-bottom: 50px;
    border: 2px solid #FFE4B5;
    position: relative;
    overflow: hidden;
}

/* 小狗爪印装饰 */
/*.hero::before {*/
/*    content: "🐾🐾🐾";*/
/*    position: absolute;*/
/*    bottom: 10px;*/
/*    right: 20px;*/
/*    font-size: 24px;*/
/*    opacity: 0.15;*/
/*    pointer-events: none;*/
/*}*/

/*.hero::after {*/
/*    content: "🐕";*/
/*    position: absolute;*/
/*    top: 10px;*/
/*    left: 20px;*/
/*    font-size: 40px;*/
/*    opacity: 0.1;*/
/*    pointer-events: none;*/
/*}*/

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #FFB347 0%, #FF8C00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 18px;
    color: #A0845C;
    line-height: 1.6;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 30px 25px;
    text-align: center;
    border: 2px solid #FFE4B5;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: #FFD89B;
    box-shadow: 0 12px 28px rgba(255, 180, 70, 0.2);
}

.feature-card h3 {
    font-size: 24px;
    margin: 15px 0 12px;
    color: #D48C3C;
}

.feature-card p {
    color: #A0845C;
    line-height: 1.6;
}

/* ========== 关于页面 ========== */
.about-container {
    background: white;
    padding: 45px;
    border: 2px solid #FFE4B5;
}

.about-container h1 {
    font-size: 36px;
    color: #D48C3C;
    margin-bottom: 25px;
    display: inline-block;
    border-bottom: 4px dotted #FFD89B;
    padding-bottom: 8px;
}

.about-content {
    font-size: 18px;
    line-height: 1.9;
    color: #6B5B4A;
}

.about-content p {
    margin: 18px 0;
}

/* ========== 项目页面 ========== */
.projects-container {
    background: white;
    padding: 45px;
    border: 2px solid #FFE4B5;
}

.projects-container h1 {
    font-size: 36px;
    color: #D48C3C;
    margin-bottom: 30px;
    display: inline-block;
    border-bottom: 4px dotted #FFD89B;
    padding-bottom: 8px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

.project-card {
    background: #FFFBF5;
    padding: 28px;
    border-radius: 28px;
    border: 2px solid #FFEFD0;
    transition: all 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: #FFD89B;
    background: white;
}

.project-card h3 {
    font-size: 22px;
    color: #D48C3C;
    margin-bottom: 15px;
}

.project-card p {
    color: #8B7355;
    line-height: 1.7;
    margin-bottom: 15px;
}

.project-tag {
    display: inline-block;
    background: #FFF0E0;
    color: #FF9F1C;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-top: 8px;
}

/* ========== 联系页面 ========== */
.contact-container {
    background: white;
    padding: 45px;
    border: 2px solid #FFE4B5;
}

.contact-container h1 {
    font-size: 36px;
    color: #D48C3C;
    margin-bottom: 30px;
    display: inline-block;
    border-bottom: 4px dotted #FFD89B;
    padding-bottom: 8px;
}

.contact-info {
    margin-top: 20px;
}

.contact-item {
    padding: 18px 22px;
    background: #FFFBF5;
    margin: 18px 0;
    border-radius: 60px;
    font-size: 18px;
    color: #6B5B4A;
    border: 1px solid #FFEFD0;
    transition: all 0.3s;
}

.contact-item:hover {
    background: #FFF5E8;
    border-color: #FFD89B;
    transform: translateX(8px);
}

/* ========== 登录页面 ========== */
.login-container {
    max-width: 480px;
    margin: 60px auto;
}

.login-card {
    background: white;
    border-radius: 45px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(255, 180, 70, 0.15);
    border: 2px solid #FFE4B5;
    position: relative;
}

.login-card::before {
    content: "";
    background-image: url('/static/images/magic-white.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
}

.login-icon {
    font-size: 50px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.login-card h2 {
    color: #D48C3C;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #A0845C;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    padding: 14px 20px;
    margin: 12px 0;
    border: 2px solid #FFEFD0;
    border-radius: 60px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    background: #FFFBF5;
}

.login-card input:focus {
    border-color: #FFB347;
    background: white;
}

.login-card button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.login-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
}

.error-message {
    background: #FFF0E8;
    color: #E8A35E;
    padding: 10px;
    border-radius: 30px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ========== 聊天页面 ========== */
.chat-container {
    background: white;
    border-radius: 35px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 180, 70, 0.12);
    border: 2px solid #FFE4B5;
}

.chat-header {
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    padding: 22px 30px;
    color: white;
}

.chat-header h2 {
    margin-bottom: 6px;
    font-size: 26px;
}

.chat-header p {
    opacity: 0.95;
    font-size: 14px;
}

.chat-box {
    height: 450px;
    overflow-y: auto;
    padding: 25px;
    background: #FFFBF5;
}

.message {
    margin-bottom: 20px;
    display: flex;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 20px;
    border-radius: 28px;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
}

.user-message .message-content {
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white;
    border-bottom-right-radius: 8px;
}

.bot-message .message-content {
    background: white;
    color: #5A4A3A;
    border: 2px solid #FFEFD0;
    border-bottom-left-radius: 8px;
}

.chat-input-area {
    padding: 20px;
    border-top: 2px solid #FFEFD0;
    display: flex;
    gap: 12px;
    background: white;
}

.chat-input-area input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #FFEFD0;
    border-radius: 60px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    background: #FFFBF5;
}

.chat-input-area input:focus {
    border-color: #FFB347;
    background: white;
}

.chat-input-area button {
    padding: 12px 32px;
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.chat-input-area button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.4);
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 35px;
    color: #C4A27A;
    font-size: 14px;
}

/* ========== 响应式：手机端 ========== */
@media (max-width: 768px) {
    body {
        padding-top: 100px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero {
        padding: 35px 25px;
    }
    
    .features, .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-card, .about-container, .projects-container, .contact-container {
        padding: 30px 25px;
    }
    
    .hero::before, .hero::after {
        font-size: 20px;
    }
    
    .chat-box {
        height: 350px;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 14px;
    }
    
    .login-card {
        padding: 40px 25px;
    }
}

/* ========== 可爱动画 ========== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.nav-links a:hover .logo:hover {
    animation: bounce 0.4s ease;
}

/* ========== 登录态导航控制 ========== */
.nav-needs-auth { display: none; }
body.logged-in .nav-needs-auth { display: inline-block; }
body.logged-in .nav-login { display: none; }

/* ========== Modal 弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.modal-open {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 35px;
    padding: 40px 35px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 2px solid #FFE4B5;
    position: relative;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #C4A27A;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #FFF0E0;
}

.modal-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.modal-card h2 {
    color: #D48C3C;
    margin-bottom: 4px;
    font-size: 24px;
}

.modal-subtitle {
    color: #A0845C;
    font-size: 13px;
    margin-bottom: 20px;
}

.modal-card input {
    width: 100%;
    padding: 12px 18px;
    margin: 8px 0;
    border: 2px solid #FFEFD0;
    border-radius: 60px;
    font-size: 15px;
    outline: none;
    transition: border 0.3s;
    background: #FFFBF5;
    box-sizing: border-box;
}

.modal-card input:focus {
    border-color: #FFB347;
    background: white;
}

.modal-card button[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-top: 14px;
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-card button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
}

.modal-error {
    color: #E07050;
    font-size: 13px;
    margin-bottom: 6px;
    min-height: 18px;
}

.modal-footer {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    color: #A0845C;
}

.modal-footer a {
    color: #FF9F1C;
    text-decoration: underline;
}

/* ========== Toast 通知 ========== */
#toastContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(-12px);
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.toast-error {
    background: #FFF0E8;
    color: #D4503A;
    border: 1px solid #FFCCBC;
}

/* ========== 待办板 ========== */
.todo-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 35px;
    padding: 35px 30px;
    box-shadow: 0 10px 30px rgba(255, 180, 70, 0.12);
    border: 2px solid #FFE4B5;
}

.todo-container h1 {
    text-align: center;
    color: #D48C3C;
    margin-bottom: 24px;
    font-size: 32px;
}

.todo-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.todo-input-area input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #FFEFD0;
    border-radius: 60px;
    font-size: 15px;
    outline: none;
    transition: border 0.3s;
    background: #FFFBF5;
}

.todo-input-area input:focus {
    border-color: #FFB347;
    background: white;
}

.todo-input-area button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFB347 0%, #FF9F1C 100%);
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.todo-input-area button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.4);
}

.todo-empty {
    text-align: center;
    color: #C4A27A;
    padding: 40px 0;
    font-size: 15px;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FFFBF5;
    border-radius: 60px;
    border: 1px solid #FFEFD0;
    transition: all 0.2s;
}

.todo-item:hover {
    border-color: #FFD89B;
    background: #FFF8F0;
}

.todo-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #FF9F1C;
    cursor: pointer;
    flex-shrink: 0;
}

.todo-text {
    flex: 1;
    font-size: 15px;
    color: #5A4A3A;
    cursor: pointer;
    word-break: break-word;
}

.todo-done .todo-text {
    text-decoration: line-through;
    color: #C4A27A;
}

.todo-time {
    font-size: 12px;
    color: #C4A27A;
    flex-shrink: 0;
}

.todo-delete {
    background: none;
    border: none;
    color: #D49A6A;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.todo-delete:hover {
    background: #FFF0E8;
    color: #D4503A;
}

@media (max-width: 768px) {
    .modal-card {
        padding: 30px 24px;
    }
    .todo-container {
        padding: 24px 18px;
    }
    .todo-input-area {
        flex-direction: column;
    }
    .todo-time {
        display: none;
    }
}