/* Mars的web项目 - 鲜艳活泼风格 */

:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5a5a;
    --secondary: #4ecdc4;
    --accent: #ffe66d;
    --purple: #a78bfa;
    --pink: #f472b6;
    --orange: #fb923c;
    --bg: #fef7f0;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-muted: #636e72;
    --border: #ffe0e0;
    --shadow: 0 4px 20px rgba(255, 107, 107, 0.15);
    --shadow-hover: 0 8px 30px rgba(255, 107, 107, 0.25);
    --radius: 16px;
    --radius-sm: 10px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -80px;
    right: -60px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary);
    bottom: 10%;
    left: -50px;
    animation-delay: -3s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--purple);
    top: 40%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary);
}

.nav-link-accent {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff !important;
}

.nav-link-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-link-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
}

/* Main */
.main-content {
    padding: 32px 0 60px;
    min-height: calc(100vh - 140px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--orange), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 32px;
}

.tab-btn {
    padding: 10px 22px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--card-bg);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow);
}

/* Link Sections */
.link-section {
    margin-bottom: 36px;
}

.section-title {
    margin-bottom: 16px;
}

.section-badge {
    display: inline-block;
    padding: 6px 18px;
    background: linear-gradient(135deg, var(--secondary), #45b7aa);
    color: #fff;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.link-card {
    display: block;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.25s;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.link-card:hover::before {
    transform: scaleX(1);
}

.link-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.link-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.link-favicon-fallback {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.link-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.link-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-url {
    font-size: 0.78rem;
    color: var(--secondary);
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: #45b7aa;
}

.btn-danger {
    background: #ff4757;
    color: #fff;
}

.btn-danger:hover {
    background: #ee3344;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Auth Page */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.auth-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.input-sm { width: auto; min-width: 120px; padding: 8px 12px; font-size: 0.85rem; }
.input-md { width: auto; min-width: 200px; padding: 8px 12px; font-size: 0.85rem; }
.input-xs { width: 70px; padding: 8px; font-size: 0.85rem; }

/* Admin */
.admin-header {
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.admin-header p {
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-radius: var(--radius);
    color: #fff;
}

.stat-card-1 {
    background: linear-gradient(135deg, var(--primary), var(--orange));
}

.stat-card-2 {
    background: linear-gradient(135deg, var(--secondary), var(--purple));
}

.stat-icon {
    font-size: 2.2rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.quick-actions h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.action-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.action-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

.admin-panel {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.admin-panel-wide {
    overflow: hidden;
}

.admin-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.text-muted {
    color: var(--text-muted);
}

.text-muted a {
    color: var(--primary);
}

/* Table */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255, 107, 107, 0.08);
    font-weight: 700;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.edit-row {
    padding: 12px !important;
}

.link-edit-form .edit-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .link-edit-form .edit-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .link-edit-form .edit-fields input,
    .link-edit-form .edit-fields select {
        width: 100%;
    }
}
