/**
 * 短链接生成器样式文件
 * 现代化、响应式设计
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 用户导航栏 */
.user-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-left .nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-left .nav-logo:hover {
    color: #764ba2;
    transform: translateY(-1px);
}

.nav-left .nav-logo i {
    margin-right: 8px;
    font-size: 1.3rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 认证按钮 */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-login, .btn-register {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-login {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-login:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 用户信息 */
.user-info {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(102, 126, 234, 0.2);
}

.user-info.active .user-menu {
    display: block;
}

.username {
    font-weight: 600;
    color: #667eea;
    margin-right: 5px;
}

.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    margin-top: 5px;
    z-index: 1000;
}

.user-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.user-menu-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.user-menu-item i {
    margin-right: 8px;
    width: 16px;
}

/* 认证提示 */
.auth-notice {
    text-align: center;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.auth-notice a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
}

.auth-notice a:hover {
    text-decoration: underline;
}

.auth-required-notice {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    margin-top: 15px;
    color: #856404;
}

.auth-required-notice a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-required-notice a:hover {
    text-decoration: underline;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.title i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* URL输入表单 */
.url-form-container {
    margin-bottom: 30px;
}

.url-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.url-form:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 结果显示卡片 */
.result-container {
    animation: fadeInUp 0.5s ease;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title i {
    color: #ffd700;
}

.result-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-item {
    margin-bottom: 15px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.original-url {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 5px;
    word-break: break-all;
    font-size: 0.9rem;
}

.short-link-group {
    display: flex;
    gap: 10px;
}

.short-url-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: white;
    color: #333;
    font-family: monospace;
    font-size: 1rem;
}

.copy-btn {
    padding: 10px 15px;
    background: #ffd700;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #ffed4e;
    transform: translateY(-1px);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #ffd700;
    color: #333;
}

.primary-btn:hover {
    background: #ffed4e;
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 加载状态 */
.loading-container {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
}

.loading-spinner i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 错误状态 */
.error-container {
    animation: fadeInUp 0.5s ease;
}

.error-card {
    background: #fff;
    border: 2px solid #dc3545;
    border-radius: 15px;
    padding: 30px;
    position: relative;
    text-align: center;
}

.error-title {
    color: #dc3545;
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-message {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.error-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-close:hover {
    color: #c82333;
    transform: scale(1.1);
}

/* 功能介绍 */
.features {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.features-title {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 600;
}

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

.feature-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 15px;
}

.feature-title {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* 统计页面样式 */
.nav {
    margin-bottom: 30px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.summary-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-label {
    font-size: 1rem;
    opacity: 0.9;
}

.stats-table-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    overflow: hidden;
}

.table-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stats-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.stats-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.stats-table tr:hover {
    background: #f8f9fa;
}

.short-code code {
    background: #f1f3f4;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    color: #d63384;
    font-weight: 600;
}

.url-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.count-badge {
    background: #e9ecef;
    color: #666;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.count-badge.has-clicks {
    background: #28a745;
    color: white;
}

.actions {
    display: flex;
    gap: 8px;
}

.action-btn.copy-btn,
.action-btn.visit-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 5px;
}

.action-btn.copy-btn {
    background: #17a2b8;
    color: white;
}

.action-btn.copy-btn:hover {
    background: #138496;
}

.action-btn.visit-btn {
    background: #28a745;
    color: white;
}

.action-btn.visit-btn:hover {
    background: #218838;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 10px;
}

.empty-description {
    color: #999;
    margin-bottom: 30px;
}

/* 错误页面 */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 5rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-title {
    font-size: 2rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.error-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 复制提示 */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.copy-toast i {
    margin-right: 8px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 25px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .url-input,
    .submit-btn {
        width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .stats-table {
        font-size: 0.9rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 10px;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .short-link-group {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
}