/* 小马糕口令分享网站 - 样式表 */

:root {
    --primary: #2196F3;
    --primary-light: #42A5F5;
    --primary-dark: #1976D2;
    --background: #F5F9FF;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border: #E0E0E0;
    --high-tag: #FF4D4F;
    --success: #52C41A;
    --warning: #FAAD14;
    --error: #FF4D4F;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 30px rgba(33, 150, 243, 0.12);
}

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

body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(245, 249, 255, 0.8);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.header-btn:hover {
    box-shadow: var(--shadow-hover);
}

.header-btn .icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-placeholder {
    width: 40px;
}

/* Main */
.main {
    padding: 8px 0 100px;
}

/* Announcement Card */
.announcement-card {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.15) 0%, rgba(33, 150, 243, 0.08) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: var(--radius);
    padding: 24px;
    margin: 0 16px 24px;
    animation: slideUp 0.5s ease-out;
}

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

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.megaphone-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.megaphone-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.announcement-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.announcement-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.announcement-content {
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.8;
    margin-bottom: 24px;
    font-size: 14px;
}

.announcement-actions {
    display: flex;
    justify-content: center;
}

.share-btn {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.share-btn:active {
    transform: scale(0.98);
}

.share-btn .icon {
    width: 16px;
    height: 16px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-tab {
    background: white;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* Code List */
.code-list {
    padding: 0 16px;
}

.code-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: slideUp 0.5s ease-out;
}

.code-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.value-box {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.value-label {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 2px;
}

.value-number {
    font-family: "DIN Alternate", "Roboto", "SF Pro Display", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.code-content {
    flex: 1;
    min-width: 0;
}

.code-text {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.code-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.high-tag {
    background: linear-gradient(135deg, #FF6B6B 0%, var(--high-tag) 100%);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 500;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.time-text {
    font-size: 12px;
    color: #999;
}

.copy-btn {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
}

.copy-btn:hover {
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: var(--success);
}

/* Loading & Empty */
.loading, .empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-secondary);
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 0 16px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-hover);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.page-btn svg {
    width: 20px;
    height: 20px;
}

.page-info {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    z-index: 1;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title .icon {
    width: 20px;
    height: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: white;
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
}

.info-box {
    background: #E3F2FD;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.info-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content {
    font-size: 14px;
    color: var(--primary-dark);
}

.info-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.info-content ul {
    margin-top: 4px;
    padding-left: 16px;
}

.info-content li {
    margin-bottom: 2px;
}

.modal-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s;
    font-family: inherit;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #F5F9FF;
}

.example-text {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.result-box {
    margin: 16px 0;
    display: none;
}

.result-box.active {
    display: block;
}

.result-success, .result-error {
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.result-success {
    background: #F6FFED;
    border: 1px solid #B7EB8F;
    color: #389E0D;
}

.result-error {
    background: #FFF2F0;
    border: 1px solid #FFCCC7;
    color: #CF1322;
}

.result-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

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

.submit-btn .icon {
    width: 20px;
    height: 20px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s;
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #f5f5f5;
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(33, 150, 243, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    .filter-tabs {
        gap: 8px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .code-card {
        padding: 12px;
        gap: 12px;
    }
    
    .value-box {
        padding: 8px 12px;
        min-width: 60px;
    }
    
    .value-number {
        font-size: 20px;
    }
}
