/* ========================================
   杂鱼.xyz - 可爱二次元风格样式
   ======================================== */

/* CSS Variables */
:root {
    --primary-pink: #FFB6C1;
    --hot-pink: #FF69B4;
    --deep-pink: #FF1493;
    --light-pink: #FFF0F5;
    --lavender: #E6E6FA;
    --light-purple: #DDA0DD;
    --text-dark: #8B4562;
    --text-light: #D87093;
    --white: #FFFFFF;
    --shadow-pink: rgba(255, 105, 180, 0.3);
    --gradient-main: linear-gradient(135deg, #FFB6C1 0%, #E6E6FA 50%, #DDA0DD 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 245, 0.95));
    --gradient-button: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
    --font-main: 'Noto Sans SC', sans-serif;
    --font-cute: 'ZCOOL KuaiLe', cursive;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--gradient-main);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
}

/* 飘落装饰 */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: float-down linear forwards;
    color: var(--hot-pink);
}

@keyframes float-down {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ========================================
   欢迎区样式
   ======================================== */
.welcome-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeInUp 1s ease-out;
    position: relative;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-content {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem 2.5rem;
    box-shadow: 
        0 20px 60px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 600px;
    width: 100%;
}

.main-title {
    font-family: var(--font-cute);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: var(--hot-pink);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.title-deco {
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.welcome-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.start-btn {
    font-family: var(--font-cute);
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
    background: var(--gradient-button);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px var(--shadow-pink),
        0 0 0 3px rgba(255, 255, 255, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 35px var(--shadow-pink),
        0 0 0 3px rgba(255, 255, 255, 0.6);
}

.start-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.welcome-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.deco-item {
    position: absolute;
    font-size: 2rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

.deco-star {
    top: 10%;
    left: 10%;
    color: #FFD700;
    animation-delay: 0s;
}

.deco-heart {
    top: 20%;
    right: 15%;
    color: var(--hot-pink);
    animation-delay: 0.5s;
}

.deco-sparkle {
    bottom: 25%;
    left: 15%;
    color: var(--light-purple);
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

/* ========================================
   杂鱼检测器样式
   ======================================== */
.detector-section {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.detector-container {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 60px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    max-width: 550px;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

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

.detector-header {
    text-align: center;
    margin-bottom: 2rem;
}

.detector-title {
    font-family: var(--font-cute);
    font-size: 1.8rem;
    color: var(--hot-pink);
    margin-bottom: 0.5rem;
}

.detector-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 182, 193, 0.4);
    border-radius: 10px;
    margin: 1.5rem 0 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-button);
    border-radius: 10px;
    width: 20%;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
}

.question-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--primary-pink);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 105, 180, 0.2), transparent);
    transition: left 0.5s ease;
}

.option-btn:hover {
    border-color: var(--hot-pink);
    background: var(--light-pink);
    transform: translateX(5px);
    box-shadow: 0 5px 20px var(--shadow-pink);
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:active {
    transform: translateX(2px) scale(0.98);
}

/* ========================================
   结果页面样式
   ======================================== */
.result-section {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.result-container {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem 2.5rem;
    box-shadow: 
        0 20px 60px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: resultReveal 0.8s ease-out;
}

@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.result-badge {
    display: inline-block;
    background: var(--gradient-button);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.result-title {
    font-family: var(--font-cute);
    font-size: 2.5rem;
    color: var(--deep-pink);
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px var(--shadow-pink);
}

.result-emoji {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.result-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.result-decoration {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    color: var(--hot-pink);
    margin-bottom: 2rem;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.retry-btn,
.quotes-btn {
    font-family: var(--font-cute);
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn {
    background: var(--gradient-button);
    color: var(--white);
    border: none;
    box-shadow: 0 5px 20px var(--shadow-pink);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-pink);
}

.quotes-btn {
    background: transparent;
    color: var(--hot-pink);
    border: 2px solid var(--hot-pink);
}

.quotes-btn:hover {
    background: var(--light-pink);
    transform: translateY(-2px);
}

/* ========================================
   杂鱼语录墙样式
   ======================================== */
.quotes-section {
    padding: 4rem 0;
    margin-top: 2rem;
}

.quotes-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.quotes-title {
    font-family: var(--font-cute);
    font-size: 2rem;
    color: var(--hot-pink);
    margin-bottom: 0.5rem;
}

.quotes-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.quotes-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.quote-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 
        0 10px 30px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.quote-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 5rem;
    color: var(--primary-pink);
    opacity: 0.3;
    font-family: serif;
}

.quote-card:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 
        0 15px 40px var(--shadow-pink),
        0 0 0 2px var(--hot-pink);
}

.quote-card:nth-child(even):hover {
    transform: translateY(-8px) rotate(-1deg);
}

.quote-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* ========================================
   留言板样式
   ======================================== */
.guestbook-section {
    padding: 4rem 0;
    margin-top: 2rem;
}

.guestbook-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.guestbook-title {
    font-family: var(--font-cute);
    font-size: 2rem;
    color: var(--hot-pink);
    margin-bottom: 0.5rem;
}

.guestbook-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

/* 表单容器 */
.guestbook-form-container {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 
        0 15px 40px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    margin-bottom: 3rem;
}

.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.label-icon {
    color: var(--hot-pink);
}

.label-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.guestbook-input,
.guestbook-textarea {
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--primary-pink);
    border-radius: 15px;
    background: var(--white);
    color: var(--text-dark);
    transition: all 0.3s ease;
    outline: none;
}

.guestbook-input:focus,
.guestbook-textarea:focus {
    border-color: var(--hot-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.2);
}

.guestbook-input::placeholder,
.guestbook-textarea::placeholder {
    color: var(--primary-pink);
    opacity: 0.7;
}

.guestbook-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Turnstile 容器 */
.turnstile-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

/* 提交按钮 */
.guestbook-submit-btn {
    font-family: var(--font-cute);
    font-size: 1.2rem;
    padding: 1rem 2rem;
    background: var(--gradient-button);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--shadow-pink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    align-self: center;
}

.guestbook-submit-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px var(--shadow-pink);
}

.guestbook-submit-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.guestbook-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.guestbook-submit-btn.loading {
    pointer-events: none;
}

.guestbook-submit-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 表单状态提示 */
.form-status {
    text-align: center;
    font-size: 0.95rem;
    min-height: 1.5rem;
    transition: all 0.3s ease;
}

.form-status.success {
    color: #4CAF50;
}

.form-status.error {
    color: #f44336;
}

/* 留言列表 */
.guestbook-messages-container {
    margin-top: 2rem;
}

.messages-title {
    font-family: var(--font-cute);
    font-size: 1.5rem;
    color: var(--hot-pink);
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.messages-title span {
    color: var(--light-purple);
}

.guestbook-messages {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* 加载和空状态 */
.messages-loading,
.messages-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1rem;
}

.messages-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-icon {
    animation: pulse 1s ease-in-out infinite;
    color: var(--hot-pink);
}

/* 单条留言卡片 */
.message-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 
        0 8px 25px var(--shadow-pink),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '♡';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--primary-pink);
    opacity: 0.3;
}

.message-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px var(--shadow-pink),
        0 0 0 2px var(--hot-pink);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.message-username {
    font-family: var(--font-cute);
    font-size: 1.1rem;
    color: var(--hot-pink);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.message-username::before {
    content: '✿';
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.message-content {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
    word-break: break-word;
}

/* 留言入场动画 */
.message-card.new {
    animation: messageSlideIn 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   页脚样式
   ======================================== */
.footer {
    margin-top: 4rem;
    padding: 3rem 1.5rem;
    text-align: center;
    background: linear-gradient(to top, rgba(255, 182, 193, 0.3), transparent);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-text {
    font-family: var(--font-cute);
    font-size: 1.5rem;
    color: var(--hot-pink);
    margin-bottom: 0.5rem;
}

.footer-subtext {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.footer-decoration {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.2rem;
    color: var(--hot-pink);
    opacity: 0.7;
}

/* ========================================
   工具类
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .welcome-content {
        padding: 2rem 1.5rem;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .start-btn {
        font-size: 1.1rem;
        padding: 0.9rem 2rem;
    }

    .detector-container {
        padding: 2rem 1.5rem;
    }

    .detector-title {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .result-container {
        padding: 2.5rem 1.5rem;
    }

    .result-title {
        font-size: 2rem;
    }

    .quotes-wall {
        grid-template-columns: 1fr;
    }

    .quote-card {
        padding: 1.2rem;
    }

    /* 留言板响应式 */
    .form-row {
        grid-template-columns: 1fr;
    }

    .guestbook-form-container {
        padding: 1.5rem;
    }

    .guestbook-title {
        font-size: 1.6rem;
    }

    .guestbook-submit-btn {
        font-size: 1.1rem;
        padding: 0.9rem 1.5rem;
    }

    .message-card {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.4rem;
    }

    .title-deco {
        display: none;
    }

    .deco-item {
        display: none;
    }

    .result-decoration span:nth-child(even) {
        display: none;
    }
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-pink);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hot-pink);
}

/* ========================================
   选择文本颜色
   ======================================== */
::selection {
    background: var(--hot-pink);
    color: var(--white);
}
