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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 头部 */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-tabs a {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-tabs a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-tabs a.active {
    background: white;
    color: #667eea;
}

/* 主要内容 */
.main-content {
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.card h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    background: white;
    cursor: pointer;
}

.domain-select option {
    padding: 10px;
}

.hint {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.85rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-copy {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #c82333;
}

/* 结果卡片 */
.result-card {
    animation: slideIn 0.5s ease-out;
}

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

.url-display {
    display: flex;
    gap: 10px;
}

.generated-url {
    flex: 1;
    background: #f8f9fa;
    border: 2px solid #e0e0e0 !important;
    font-family: monospace;
}

.target-url {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #667eea;
    word-break: break-all;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-buttons .btn {
    flex: 1;
}

.info-box {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 5px;
}

.info-box p {
    margin-bottom: 10px;
    color: #555;
}

.info-box ul {
    margin-left: 20px;
    color: #666;
}

.info-box li {
    margin-bottom: 5px;
}

/* 统计样式 */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

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

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.links-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.links-table th,
.links-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.links-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

.links-table .url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667eea;
}

.links-table .link-title {
    font-weight: 500;
    color: #333;
}

.links-table .views-count {
    font-weight: bold;
    color: #28a745;
}

.links-table .date-text {
    font-size: 0.9rem;
    color: #666;
}

.links-table .actions {
    display: flex;
    gap: 10px;
}

/* 加载和空状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.empty-message {
    text-align: center;
    padding: 40px;
}

.empty-message p {
    font-size: 1.2rem;
    color: #999;
    margin-bottom: 20px;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .links-table {
        font-size: 0.9rem;
    }

    .links-table th,
    .links-table td {
        padding: 8px;
    }
}

