/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.modal-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    animation: scale-in 0.3s ease-out;
    position: relative;
    left: 0;
    right: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.modal-content {
    padding: 2rem;
    text-align: center;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: #666;
}

.qr-container {
    margin-bottom: 1.5rem;
}

.qr-code {
    width: 12rem;
    height: 12rem;
    margin: 0 auto;
    background-color: #f5f5f5;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scan-status {
    text-align: center;
}

.wechat-icon {
    width: 8rem;
    height: 8rem;
    background: linear-gradient(to bottom right, #07C160, #06AD56);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    animation: bounce-gentle 2s infinite;
}

.wechat-check-circle {
    width: 4rem;
    height: 4rem;
    background-color: #07C160;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    animation: fade-in 0.3s ease-out;
}

.wechat-success-circle {
    width: 5rem;
    height: 5rem;
    background-color: #07C160;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    animation: bounce-gentle 1s infinite;
}

.scan-status p {
    font-size: 0.875rem;
    color: #666;
}

.scan-status p.success {
    color: #07C160;
    font-weight: 600;
}

.wechat-button {
    width: 100%;
    background-color: #07C160;
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wechat-button:hover {
    background-color: #06AD56;
}

.scan-loading {
    text-align: center;
    margin-top: 1rem;
}

.auth-form {
    text-align: center;
    margin-bottom: 1.5rem;
}

#auth-code {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #07C160;
    border-radius: 0.75rem;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    background-color: #f8f8f8;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(7, 193, 96, 0.1);
}

#auth-code:focus {
    border-color: #07C160;
    outline: none;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
}

.loading-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background-color: #07C160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner::after {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
}

.scan-loading p {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.modal-footer p {
    font-size: 0.75rem;
    color: #999;
}

/* 文件夹视图样式 */
#folder-view {
    min-height: 100vh;
}

.header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 229, 229, 0.5);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 28rem;
    margin: 0 auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.back-button {
    display: flex;
    align-items: center;
    color: #07C160;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.back-button:hover {
    color: #06AD56;
}

.arrow-left {
    margin-right: 0.25rem;
}

.header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.spacer {
    width: 4rem;
}

.folder-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    max-width: 28rem;
    margin: 0 auto;
}

.folder-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.folder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.95);
}

.folder-item .folder-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    color: #07C160;
    background-color: rgba(7, 193, 96, 0.1);
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.folder-item .folder-content {
    flex: 1;
}

.folder-item .folder-title {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.folder-item .folder-description {
    font-size: 0.8rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-item .folder-arrow {
    color: #ccc;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.empty-folder {
    text-align: center;
    padding: 3rem 0;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-folder-icon {
    color: #ccc;
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-folder p {
    color: #666;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-top: 1px solid #e5e5e5;
    padding: 1rem;
    text-align: center;
}

.footer p {
    font-size: 0.75rem;
    color: #666;
    max-width: 28rem;
    margin: 0 auto;
}

/* 通知样式 */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.toast {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    margin-bottom: 0.75rem;
    max-width: 20rem;
    animation: slide-in 0.3s ease-out;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.toast-description {
    font-size: 0.875rem;
    color: #666;
}

/* 辅助类 */
.hidden {
    display: none !important;
}

/* 内部页面样式 */
#internal-page-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: 40;
    display: flex;
    flex-direction: column;
    animation: fade-in 0.3s ease-out;
}

.internal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    padding: 0.75rem 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
}

.internal-back-link {
    position: absolute;
    left: 1rem;
    color: #07C160;
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.internal-back-link .arrow-left {
    margin-right: 0.25rem;
}

.internal-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.internal-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
}

/* 动画 */
@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slide-in {
    from {
        transform: translateX(1rem);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 移动设备提示框样式 */
.mobile-alert {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: scale-in 0.3s ease-out;
    overflow: hidden;
}

.mobile-alert-content {
    padding: 2rem;
    text-align: center;
}

.mobile-alert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce-gentle 2s infinite;
}

.mobile-alert-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.mobile-alert-content p {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.mobile-alert-content .countdown {
    color: #ff3b30;
    font-weight: bold;
    margin-top: 1rem;
    font-size: 1.1rem;
    animation: pulse 1.5s infinite;
}

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

.tutorial-step {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #07C160;
}

.tutorial-step h3 {
    margin-top: 0;
    color: #07C160;
}
