/* ===================================================
   2023级共同的回忆 - 主样式表
   毕业季主题 - 清新/温暖/青春
   =================================================== */

/* ---------- 全局重置与基础 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 30%, #fce4ec 70%, #fff8e1 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #37474f;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---------- 背景动态粒子 ---------- */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---------- 浮动装饰元素 ---------- */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    opacity: 0.08;
    font-size: 40px;
    animation: floatUp linear infinite;
    color: #81c784;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.08;
    }
    90% {
        opacity: 0.08;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ---------- 主容器 ---------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ---------- 头部 ---------- */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #81c784, #64b5f6, transparent);
    border-radius: 2px;
}

.header h1 {
    font-size: 2.4em;
    font-weight: 800;
    background: linear-gradient(135deg, #43a047, #1e88e5, #7b1fa2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    margin-bottom: 10px;
    animation: fadeInDown 0.8s ease;
}

.header .subtitle {
    font-size: 1em;
    color: #78909c;
    letter-spacing: 6px;
    animation: fadeInDown 1s ease 0.2s both;
}

.header .subtitle span {
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 4px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* ---------- 添加按钮 ---------- */
.add-section {
    text-align: center;
    padding: 30px 0 50px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 48px;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #66bb6a, #42a5f5);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 187, 106, 0.3);
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-add::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #66bb6a, #42a5f5, #ab47bc, #66bb6a);
    background-size: 400% 400%;
    border-radius: 52px;
    z-index: -1;
    animation: gradientMove 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-add:hover::before {
    opacity: 1;
}

.btn-add:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(102, 187, 106, 0.4);
}

.btn-add:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-icon {
    display: inline-block;
    font-size: 1.3em;
    line-height: 1;
    font-weight: 300;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- 语句列表 ---------- */
.statements-section {
    animation: fadeInUp 0.8s ease 0.5s both;
}

.section-title {
    text-align: center;
    font-size: 1.2em;
    color: #546e7a;
    margin-bottom: 24px;
    letter-spacing: 3px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #81c784, #64b5f6);
    margin: 10px auto 0;
    border-radius: 2px;
}

.statements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 语句卡片 ---------- */
.statement-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease both;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.statement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 187, 106, 0.2);
}

.statement-card:nth-child(1) { animation-delay: 0.1s; }
.statement-card:nth-child(2) { animation-delay: 0.15s; }
.statement-card:nth-child(3) { animation-delay: 0.2s; }
.statement-card:nth-child(4) { animation-delay: 0.25s; }
.statement-card:nth-child(5) { animation-delay: 0.3s; }
.statement-card:nth-child(6) { animation-delay: 0.35s; }
.statement-card:nth-child(7) { animation-delay: 0.4s; }

.statement-rank {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85em;
    font-weight: 700;
    color: #78909c;
    background: rgba(236, 239, 241, 0.8);
    transition: all 0.3s;
}

.statement-card:nth-child(1) .statement-rank {
    background: linear-gradient(135deg, #fff8e1, #ffe082);
    color: #f57f17;
}

.statement-card:nth-child(2) .statement-rank {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #616161;
}

.statement-card:nth-child(3) .statement-rank {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    color: #e65100;
}

.statement-content {
    flex: 1;
    min-width: 0;
}

.statement-text {
    font-size: 1em;
    color: #37474f;
    line-height: 1.8;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.statement-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82em;
    color: #90a4ae;
}

.statement-meta .name {
    color: #66bb6a;
    font-weight: 600;
}

.statement-meta .dot {
    width: 3px;
    height: 3px;
    background: #cfd8dc;
    border-radius: 50%;
}

.statement-meta .time {
    color: #b0bec5;
}

/* ---------- 点赞按钮 ---------- */
.btn-like {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: rgba(239, 248, 255, 0.6);
    border: 1px solid rgba(100, 181, 246, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-like:hover {
    background: rgba(239, 248, 255, 0.9);
    border-color: rgba(100, 181, 246, 0.4);
    transform: scale(1.05);
}

.btn-like .like-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1em;
    transition: all 0.3s;
    color: #90a4ae;
    line-height: 1;
}

.btn-like.liked .like-icon {
    color: #ef5350;
    animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.btn-like .like-count {
    font-size: 0.78em;
    font-weight: 600;
    color: #78909c;
    transition: all 0.3s;
}

.btn-like.liked .like-count {
    color: #ef5350;
}

.btn-like.liked {
    background: rgba(255, 235, 238, 0.6);
    border-color: rgba(239, 83, 80, 0.2);
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #90a4ae;
}

.empty-state .empty-icon {
    display: block;
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ---------- 结尾语 ---------- */
.closing-section {
    text-align: center;
    padding: 60px 20px 40px;
    animation: fadeInUp 0.8s ease 0.8s both;
}

.closing-text {
    font-size: 1.15em;
    color: #546e7a;
    line-height: 1.8;
    letter-spacing: 2px;
    position: relative;
    padding: 30px 20px;
}

.closing-text::before,
.closing-text::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
}

.closing-text::before {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, #81c784, transparent);
}

.closing-text::after {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, #64b5f6, transparent);
}

.closing-text .quote-mark {
    display: block;
    font-size: 2.5em;
    font-weight: 200;
    color: #a5d6a7;
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: 0;
}

/* ---------- 页脚 ---------- */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #b0bec5;
    font-size: 0.85em;
    letter-spacing: 1px;
}

/* ---------- 弹窗 (Modal) ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #b0bec5;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #546e7a;
    background: rgba(0, 0, 0, 0.04);
}

.modal-title {
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    color: #37474f;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.modal-desc {
    text-align: center;
    font-size: 0.9em;
    color: #90a4ae;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    color: #546e7a;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8edf0;
    border-radius: 12px;
    font-size: 0.95em;
    font-family: inherit;
    color: #37474f;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #81c784;
    box-shadow: 0 0 0 4px rgba(129, 199, 132, 0.15);
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 160px;
}

/* ---------- 验证码 ---------- */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-row input {
    flex: 1;
}

.captcha-image {
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
    border: 2px solid #e8edf0;
}

.captcha-image:hover {
    opacity: 0.8;
}

.btn-refresh-captcha {
    padding: 8px 12px;
    background: #f5f7fa;
    border: 2px solid #e8edf0;
    border-radius: 10px;
    cursor: pointer;
    color: #78909c;
    font-size: 0.9em;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-refresh-captcha:hover {
    background: #e8edf0;
    color: #546e7a;
}

/* ---------- 提交按钮 ---------- */
.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #66bb6a, #42a5f5);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 3px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 187, 106, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-submit.loading .spinner {
    display: block;
}

.btn-submit.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Toast 通知 ---------- */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 0.92em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: toastSlideIn 0.4s ease;
    pointer-events: auto;
    border: 1px solid rgba(255,255,255,0.6);
}

.toast.success {
    border-left: 4px solid #66bb6a;
    color: #2e7d32;
}

.toast.error {
    border-left: 4px solid #ef5350;
    color: #c62828;
}

.toast.info {
    border-left: 4px solid #42a5f5;
    color: #1565c0;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* ---------- 动画关键帧 ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- 加载动画 ---------- */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: #90a4ae;
    border-radius: 50%;
    animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.6em;
        letter-spacing: 2px;
    }

    .header {
        padding: 40px 16px 30px;
    }

    .btn-add {
        padding: 14px 32px;
        font-size: 1em;
    }

    .statement-card {
        padding: 16px;
        flex-wrap: wrap;
    }

    .statement-content {
        width: calc(100% - 60px);
    }

    .btn-like {
        min-width: 44px;
        padding: 6px 10px;
    }

    .modal-box {
        padding: 24px 20px;
    }

    .closing-text {
        font-size: 1em;
    }

    .captcha-row {
        flex-wrap: wrap;
    }

    .container {
        padding: 12px;
    }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c8d6e5;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8b8c8;
}