/**
 * Douyin Base Styles - 基础样式
 * Reset and common styles
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    font-family: var(--font-family);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Hashtag links (shared mobile/desktop) */
.hashtag {
    color: var(--douyin-cyan);
    font-weight: 600;
}

.hashtag:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, textarea {
    font-family: inherit;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Selection */
::selection {
    background: var(--douyin-pink);
    color: var(--text-primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

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

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

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

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

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

@keyframes likeFloat {
    0% {
        transform: scale(0) rotate(-15deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg) translateY(-50px);
        opacity: 0;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-toast);
    animation: fadeIn 0.3s ease;
}

.loading-screen.hidden {
    animation: fadeOut 0.3s ease forwards;
    pointer-events: none;
}

.loading-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    animation: bounce 1.5s ease infinite;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--douyin-pink);
    border-right-color: var(--douyin-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    padding: var(--spacing-xl);
    text-align: center;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    fill: rgba(255, 255, 255, 0.15);
    margin-bottom: var(--spacing-lg);
    animation: pulse 3s ease infinite;
}

.empty-state p {
    font-size: var(--font-md);
    font-weight: 500;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: var(--z-overlay);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    z-index: var(--z-toast);
    animation: scaleIn 0.2s ease;
}
