/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: rgba(247, 250, 252, 0.95);
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(226, 232, 240, 0.6);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --font-size-base: 16px;
    --grid-columns: 3; /* 默认每排显示3个链接 */
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    font-size: var(--font-size-base);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 4rem 0 2rem;
    color: white;
    position: relative;
}

.title {
    font-size: clamp(2.2rem, 8vw, 3.8rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cursor {
    animation: blink 1s infinite;
    color: #ffd700;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.subtitle {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 2rem;
}

/* 搜索框 */
.search-container {
    max-width: 500px;
    margin: 0 auto 3rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 主内容区 */
.main {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    margin-bottom: 3rem;
}

/* 链接网格 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1200px;
}

/* 链接卡片 */
.link-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-height: 100px;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.link-card:hover::before {
    transform: translateX(0);
}

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

/* 圆形图标样式 */
.link-icon {
    width: 3.75rem; /* 60px */
    height: 3.75rem; /* 60px */
    border-radius: 50%; /* 圆形图标 */
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.05);
    flex-shrink: 0;
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.link-icon:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.link-content {
    flex: 1;
    transition: transform 0.3s ease;
}

.link-name {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.link-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

.link-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.link-card:hover .link-arrow {
    transform: translateX(5px);
}

.link-card:hover .link-content {
    transform: translateX(5px);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: white;
    opacity: 0.8;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    :root {
        --grid-columns: 3; /* 1200px以下显示3列 */
    }
}

@media (max-width: 992px) {
    :root {
        --grid-columns: 2; /* 992px以下显示2列 */
    }
    
    .links-grid {
        gap: 1.25rem;
    }
    
    .link-card {
        padding: 1.25rem;
    }
    
    .link-icon {
        width: 3.5rem; /* 56px */
        height: 3.5rem; /* 56px */
    }
}

@media (max-width: 768px) {
    :root {
        --grid-columns: 2; /* 768px以下显示2列 */
    }
    
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 3rem 0 1.5rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .main {
        padding: 2rem;
        border-radius: 15px;
    }
    
    .link-card {
        padding: 1.25rem;
        min-height: auto;
    }
}

@media (max-width: 576px) {
    :root {
        --grid-columns: 1; /* 576px以下显示1列 */
    }
    
    .header {
        padding: 2rem 0 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .main {
        padding: 1.5rem;
    }
    
    .links-grid {
        gap: 1rem;
    }
    
    .link-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .link-name {
        font-size: 1.1rem;
    }
    
    .link-description {
        font-size: 0.9rem;
    }
    
    .link-icon {
        width: 3.125rem; /* 50px */
        height: 3.125rem; /* 50px */
    }
    
    .link-arrow {
        display: none;
    }
    
    .search-container {
        margin-bottom: 2rem;
    }
    
    .search-input, .search-btn {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
}

/* 友链申请表单样式 */
.application-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.application-header {
    text-align: center;
    margin-bottom: 3rem;
}

.application-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.application-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.application-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

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

/* 消息样式 */
.message {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

/* 条件显示字段 */
.conditional-field {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 友链申请链接 */
.friendlink-link .btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 20px;
    text-decoration: none;
}

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