/**
 * 拟态风格主样式文件
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hard: 8px 8px 16px rgba(0, 0, 0, 0.2),
                   -8px -8px 16px rgba(102, 126, 234, 0.1);
    --shadow-inset: inset 4px 4px 8px rgba(0, 0, 0, 0.1),
                    inset -4px -4px 8px rgba(102, 126, 234, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 80px;
    color: var(--text-primary);
}

/* 拟态卡片 */
.neomorphic-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin: 15px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面切换动画 */
.page-transition {
    animation: pageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 内容淡入动画 */
.content-fade-in {
    animation: contentFadeIn 0.5s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.neomorphic-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-inset);
}

/* 拟态按钮 */
.neomorphic-btn {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.neomorphic-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.neomorphic-btn:active::before {
    width: 300px;
    height: 300px;
}

.neomorphic-btn:active {
    box-shadow: var(--shadow-inset);
}

.neomorphic-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.neomorphic-btn-primary:active {
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 输入框 */
.neomorphic-input {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 16px;
    width: 100%;
    box-shadow: var(--shadow-inset);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.neomorphic-input:focus {
    outline: none;
    box-shadow: var(--shadow-hard);
    background: rgba(255, 255, 255, 0.9);
}

.neomorphic-input::placeholder {
    color: var(--text-secondary);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    min-width: 60px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.nav-item.active::before {
    width: 60%;
}

.nav-item-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-item.active .nav-item-icon {
    transform: scale(1.2) translateY(-2px);
}

.nav-item:hover .nav-item-icon {
    transform: scale(1.1);
}

.nav-item.active:hover .nav-item-icon {
    transform: scale(1.3) translateY(-2px);
}

.nav-item-text {
    font-size: 12px;
}

/* 顶部标题栏 */
.top-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* 标签页切换 */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 5px;
    margin: 15px;
    box-shadow: var(--shadow-inset);
}

.tab-item {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tab-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tab-item:hover::before {
    width: 200px;
    height: 200px;
}

.tab-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.tab-item.active::before {
    width: 300px;
    height: 300px;
}

/* 功能卡片网格 */
.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.function-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.function-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.function-card:hover::before {
    width: 300px;
    height: 300px;
}

.function-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.function-card:active {
    transform: scale(0.95);
}

.function-card-icon {
    font-size: 40px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.function-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.function-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.modal-close:active {
    transform: rotate(90deg);
}

/* 加载动画 - 美化版 */
.loading {
    position: relative;
    width: 60px;
    height: 60px;
    display: inline-block;
}

.loading::before,
.loading::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loading::before {
    background: conic-gradient(
        from 0deg,
        #8B7AFF 0deg,
        #FF96C8 90deg,
        #8B7AFF 180deg,
        #FF96C8 270deg,
        #8B7AFF 360deg
    );
    animation: spin 1.5s linear infinite;
    opacity: 0.4;
    filter: blur(8px);
}

.loading::after {
    border: 5px solid transparent;
    border-top-color: #8B7AFF;
    border-right-color: #FF96C8;
    border-bottom-color: #8B7AFF;
    border-left-color: #FF96C8;
    animation: spin 1s linear infinite;
    box-shadow: 
        0 0 25px rgba(139, 122, 255, 0.4),
        inset 0 0 15px rgba(255, 150, 200, 0.2);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
        transform: rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        transform: rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        transform: rotate(360deg);
    }
}

/* 全局加载遮罩 */
#global-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 35px 45px;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(139, 122, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: loaderFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(139, 122, 255, 0.15);
}

#global-loader > div::before {
    content: '';
    position: absolute;
    top: -0.2px;
    left: -0.2px;
    right: -0.2px;
    bottom: -0.2px;
    background: conic-gradient(
        from 0deg,
        #8B7AFF 0deg,
        #FF96C8 90deg,
        #8B7AFF 180deg,
        #FF96C8 270deg,
        #8B7AFF 360deg
    );
    border-radius: 2vw;
    z-index: -1;
    opacity: 0.2;
    animation: spin 3s linear infinite;
    filter: blur(0.3px);
}

#global-loader .loading-text {
    font-size: 15px;
    color: #555;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #8B7AFF 0%, #FF96C8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes loaderFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 提示消息 - 美化版 */
.toast {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: linear-gradient(135deg, rgba(139, 122, 255, 0.95) 0%, rgba(255, 150, 200, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white !important;
    padding: 16px 28px;
    border-radius: 16px;
    z-index: 10000 !important;
    animation: toastSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    box-shadow: 
        0 10px 40px rgba(139, 122, 255, 0.3),
        0 4px 16px rgba(255, 150, 200, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: toastShine 2s ease-in-out infinite;
}

.toast.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(16, 185, 129, 0.95) 100%);
    box-shadow: 
        0 10px 40px rgba(34, 197, 94, 0.3),
        0 4px 16px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    box-shadow: 
        0 10px 40px rgba(239, 68, 68, 0.3),
        0 4px 16px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    box-shadow: 
        0 10px 40px rgba(251, 191, 36, 0.3),
        0 4px 16px rgba(245, 158, 11, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

@keyframes toastSlideDown {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
    60% {
        transform: translateX(-50%) translateY(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes toastShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .function-grid {
        grid-template-columns: 1fr;
    }
    
    .neomorphic-card {
        margin: 10px;
        padding: 15px;
    }
}

