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

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    position: relative;
    min-height: 100vh;
}

/* 背景层 - 使用CSS渐变，无需图片 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background 0.5s ease;
    z-index: -1;
}

/* 默认渐变背景 - 日落渐变 */
.background.default {
    background: linear-gradient(-45deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* 山脉风格背景 - 紫色山脉 */
.background.mountain {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6b8cff 100%);
    background-size: 200% 200%;
    animation: gradient 10s ease infinite;
}

/* 海洋风格背景 - 深海渐变 */
.background.ocean {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 50%, #2c3e9b 100%);
    position: relative;
    overflow: hidden;
}

/* 海洋波浪效果 */
.background.ocean::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.2) 0%, transparent 50%);
    animation: wave 8s ease-in-out infinite;
}

/* 森林风格背景 - 森林渐变 */
.background.forest {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 50%, #1a9c5c 100%);
    background-size: 200% 200%;
    animation: gradient 12s ease infinite;
}

/* 星空风格背景 */
.background.star {
    background: radial-gradient(circle at 30% 40%, #2d3748, #0b0f17);
    position: relative;
    overflow: hidden;
}

/* 星星效果 */
.background.star::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 10px 10px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(4px 4px at 120px 50px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 180px, #fff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 200px 90px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 200px, #fff, rgba(0,0,0,0)),
        radial-gradient(3px 3px at 300px 150px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 350px 50px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 400px 400px;
    opacity: 0.6;
    animation: twinkle 4s ease-in-out infinite;
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes wave {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.3; }
    50% { transform: scale(1.1) translateY(-10px); opacity: 0.5; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* 主要内容层 */
.content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    color: #fff;
}

/* 半透明遮罩，提高文字可读性 */
.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease;
}

header h1 i {
    margin-right: 0.5rem;
    color: #4CAF50;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease 0.2s both;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 转换卡片 */
.converter-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    backdrop-filter: blur(10px);
    margin: 2rem auto;
    animation: fadeIn 1s ease 0.4s both;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(224, 224, 224, 0.5);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
    background: #fff;
}

.input-group input::placeholder {
    color: #999;
    font-style: italic;
}

.input-group button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.input-group button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.input-group button i {
    font-size: 1.1rem;
}

/* 结果容器 */
.result-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(240, 240, 240, 0.5);
    animation: slideIn 0.5s ease;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-header h3 {
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header h3 i {
    color: #4CAF50;
}

.new-btn {
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    color: #666;
    font-weight: 500;
}

.new-btn:hover {
    background: linear-gradient(135deg, #e8e8e8, #d8d8d8);
    transform: translateX(-2px);
}

.new-btn i {
    color: #4CAF50;
}

.short-url-container {
    background: linear-gradient(135deg, #f9f9f9, #f0f0f0);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.short-url-container label {
    display: block;
    margin-bottom: 0.8rem;
    color: #333;
    font-weight: 500;
    font-size: 1.1rem;
}

.url-box {
    display: flex;
    gap: 0.5rem;
}

.url-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #fff;
    border-radius: 10px;
    font-size: 1rem;
    color: #333;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.url-box input:focus {
    outline: none;
    border-color: #4CAF50;
}

.copy-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.2);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.stats-container {
    display: flex;
    gap: 2rem;
    color: #666;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item i {
    color: #4CAF50;
    font-size: 1.1rem;
}

/* 历史记录 */
.history-section {
    margin-top: 2rem;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.history-section h3 {
    color: #333;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
}

.history-section h3 i {
    color: #4CAF50;
}

.history-list {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f0f0f0;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.history-item:hover {
    background: linear-gradient(135deg, #f5f5f5, #e8f5e9);
    transform: translateX(5px);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.history-short {
    color: #4CAF50;
    font-weight: 500;
    font-size: 0.95rem;
}

.history-long {
    color: #999;
    font-size: 0.85rem;
}

.history-clicks {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #f5f5f5;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
}

.history-clicks i {
    color: #4CAF50;
    font-size: 0.8rem;
}

.no-history {
    color: #999;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* 背景切换器 */
.background-switcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.8rem;
    border-radius: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
    animation: slideInRight 1s ease 0.6s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bg-btn {
    width: 45px;
    height: 45px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
}

.bg-btn:hover {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.bg-btn.active {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* 提示框 */
.toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease, pulse 2s infinite;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

@keyframes slideDown {
    from {
        top: 0;
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        top: 2rem;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 2rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    padding: 1rem;
    animation: fadeIn 1s ease 0.8s both;
}

footer p {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 2rem;
    border-radius: 30px;
    display: inline-block;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 小猫装饰元素 */
.cat-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    font-size: 48px;
    opacity: 0.3;
}

.cat-1 {
    top: 30px;
    left: 30px;
    animation: float 8s ease-in-out infinite;
}

.cat-2 {
    bottom: 30px;
    right: 30px;
    animation: float 10s ease-in-out infinite reverse;
}

.cat-3 {
    top: 40%;
    left: 20px;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* 页眉小猫 */
.header-cats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.header-cats span {
    font-size: 40px;
    animation: wave 2s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.header-cats span:nth-child(1) { animation-delay: 0s; }
.header-cats span:nth-child(2) { animation-delay: 0.2s; }
.header-cats span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

/* 卡片上的小猫元素 */
.card-cat {
    position: absolute;
    font-size: 30px;
    opacity: 0.2;
    transition: all 0.3s ease;
}

.card-cat-1 {
    top: 10px;
    left: 10px;
    transform: rotate(-10deg);
}

.card-cat-2 {
    bottom: 10px;
    right: 10px;
    transform: rotate(10deg);
}

.converter-card:hover .card-cat-1 {
    transform: rotate(-5deg) translateY(-5px);
    opacity: 0.4;
}

.converter-card:hover .card-cat-2 {
    transform: rotate(15deg) translateY(-5px);
    opacity: 0.4;
}

.cat-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.cat-avatar span {
    font-size: 70px;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.2));
    animation: avatarBounce 3s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cat-avatar span:hover {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.3));
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group button {
        width: 100%;
        justify-content: center;
    }
    
    .converter-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .url-box {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .background-switcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem;
    }
    
    .bg-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cat-decoration {
        display: none;
    }
}

/* 加载动画 */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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