/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #eff6ff;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(240, 147, 251, 0.03) 100%);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 500px;
    height: 500px;
    top: -250px;
    right: -250px;
    animation-delay: 0s;
}

.circle-2 {
    width: 350px;
    height: 350px;
    bottom: -175px;
    left: -175px;
    animation-delay: 7s;
}

.circle-3 {
    width: 400px;
    height: 400px;
    top: 40%;
    left: 50%;
    animation-delay: 14s;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) translateX(30px) rotate(90deg);
    }
    50% {
        transform: translateY(-20px) translateX(-20px) rotate(180deg);
    }
    75% {
        transform: translateY(-40px) translateX(10px) rotate(270deg);
    }
}

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding: 1rem 0;
    box-shadow: var(--shadow-xs);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    color: var(--primary-color);
    font-size: 1.75rem;
}

.nav-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-item i {
    color: var(--primary-color);
}

/* 语言切换器 */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.lang-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* 标题区域 */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    animation: fadeInDown 0.8s ease-out;
}

.main-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-normal {
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.subtitle i {
    color: var(--primary-color);
}

/* 主功能卡片 */
.main-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    transition: var(--transition);
}

.main-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h2 i {
    color: var(--primary-color);
}

.link-count {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--primary-color);
}

.link-count span {
    font-size: 1.1rem;
    font-weight: 700;
}

/* 表单样式 */
.url-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.url-form input {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.url-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--bg-primary);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
}

.clear-btn.show {
    opacity: 1;
    pointer-events: all;
}

.clear-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.submit-btn {
    padding: 1.25rem 2.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    min-width: 150px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.submit-btn.loading {
    pointer-events: none;
}

.btn-text,
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-loader {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loader {
    display: flex;
}

/* 结果区域 */
.result-section {
    animation: fadeInUp 0.5s ease-out;
}

.result-section.hidden {
    display: none;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-light);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 2rem;
    color: #10b981;
}

.result-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.url-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.url-item {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.url-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.url-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.url-item.short label {
    color: white;
}

.url-content {
    word-break: break-all;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

.url-item.short {
    position: relative;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.url-item.short label {
    color: rgba(255, 255, 255, 0.9);
}

.url-item.short .url-content {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding-right: 100px;
}

.url-divider {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.copy-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

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

/* 二维码区域 */
.qrcode-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--border-color);
    display: flex;
    gap: 2rem;
    align-items: center;
}

.qrcode-wrapper {
    text-align: center;
}

#qrcode {
    display: inline-block;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

#qrcode img {
    display: block;
    border-radius: 8px;
}

.qrcode-tip {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.action-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    padding: 1rem 2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

/* 历史记录区域 */
.history-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    transition: var(--transition);
}

.history-section:hover {
    box-shadow: var(--shadow-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--secondary-color);
}

.clear-history-btn {
    background: var(--bg-primary);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-history-btn:hover {
    background: var(--error-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state span {
    font-size: 0.9rem;
}

.history-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    animation: slideInLeft 0.3s ease-out;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

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

.history-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.history-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.history-urls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-url {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-url i {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-url span {
    flex: 1;
    word-break: break-all;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.history-url.short-link span {
    color: var(--primary-color);
    font-weight: 600;
}

/* 功能特性展示 */
.features-section {
    animation: fadeInUp 0.8s ease-out 0.6s both;
    margin-bottom: 2rem;
}

.features-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    margin-top: 4rem;
    padding: 3rem 0 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-brand {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.footer-brand i {
    color: var(--error-color);
    animation: heartbeat 1.5s infinite;
    margin-right: 0.5rem;
}

.disclaimer {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.disclaimer h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer h4::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.disclaimer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    text-align: justify;
}

.copyright {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.2);
    }
    20%, 40% {
        transform: scale(1);
    }
}

/* 通知提示 */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    max-width: 400px;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.toast.error {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.toast.info {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 动画 */
@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);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .url-form {
        flex-direction: column;
    }

    .submit-btn {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .qrcode-section {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-stats {
        gap: 1rem;
    }
    
    .stat-item {
        display: none;
    }
    
    .language-switcher {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }
    
    .lang-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .url-item.short .url-content {
        padding-right: 0;
        margin-bottom: 1rem;
    }

    .copy-btn {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }

    .copy-btn:hover {
        transform: scale(1.05);
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
    
    .disclaimer {
        padding: 1rem 1.25rem;
    }
    
    .disclaimer p {
        font-size: 0.85rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .main-card,
    .history-section {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .main-title {
        font-size: 1.75rem;
    }

    .card-header h2,
    .section-header h2 {
        font-size: 1.35rem;
    }
    
    .disclaimer {
        padding: 1rem;
        border-left-width: 3px;
    }
    
    .disclaimer h4 {
        font-size: 0.9rem;
    }
    
    .disclaimer p {
        font-size: 0.8rem;
        line-height: 1.7;
    }
}

