/* 全局样式文件 */

/* CSS变量 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 网格背景 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

/* 容器样式 */
.container {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 800px;
    width: 100%;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 15px auto 0;
    border-radius: 2px;
}

h1 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 400;
}

.subtitle {
    color: var(--gray-color);
    font-size: 14px;
    margin-top: 10px;
}

/* 表单样式 */
form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 10px;
}

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

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

.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 ease;
}

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

.btn-secondary {
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 1px solid var(--light-gray);
    background-image: none;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color), #c82333);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #218838);
}

/* 消息提示样式 */
.message {
    margin-bottom: 25px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.success::before {
    background-color: var(--success-color);
}

.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.error::before {
    background-color: var(--error-color);
}

.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.warning::before {
    background-color: var(--warning-color);
}

.info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #117a8b;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.info::before {
    background-color: #17a2b8;
}

/* 生成链接样式 */
.generated-url {
    margin-top: 30px;
    padding: 30px;
    background-color: var(--light-color);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    animation: slideUp 0.5s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.generated-url::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.generated-url-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.generated-url-header label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.generated-url-header label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.url-display {
    position: relative;
    margin: 15px 0;
}

.url-display input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background-color: white;
    font-size: 14px;
    transition: var(--transition);
    padding-right: 100px;
}

.url-display input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.copy-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.copy-btn i {
    margin-right: 5px;
    font-size: 12px;
}

.copy-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.url-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.info-item label {
    display: block;
    font-size: 12px;
    color: var(--gray-color);
    margin-bottom: 5px;
    font-weight: 500;
}

.info-item p {
    font-size: 14px;
    color: var(--dark-color);
    font-weight: 500;
    margin: 0;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-link {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    background-color: var(--light-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--light-gray);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-link i {
    margin-right: 8px;
}

.btn-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 用户信息样式 */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    z-index: 10;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-badge {
    padding: 2px 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vip-badge i {
    font-size: 10px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 权限信息样式 */
.permission-info {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    font-size: 14px;
    color: #856404;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.permission-info i {
    margin-top: 2px;
    color: var(--warning-color);
}

.permission-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.permission-info a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 链接列表样式 */
.link-list {
    margin-top: 30px;
}

.link-item {
    background-color: var(--light-color);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
}

.link-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.link-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.link-item-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

.link-item-actions {
    display: flex;
    gap: 10px;
}

.link-item-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.link-item-meta {
    font-size: 14px;
    color: var(--gray-color);
}

/* 图片网格样式 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.image-item {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: var(--transition);
    position: relative;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.image-info {
    padding: 15px;
    background-color: var(--light-color);
    font-size: 14px;
    color: var(--gray-color);
}

.image-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.image-action-btn {
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.image-action-btn:hover {
    background-color: var(--primary-color);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-success {
    background: linear-gradient(135deg, var(--success-color), #218838);
}

.notification-error {
    background: linear-gradient(135deg, var(--error-color), #c82333);
}

.notification-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
}

.notification-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        min-height: 100vh;
    }
    
    .container {
        padding: 30px 20px;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 26px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    .form-control {
        padding: 14px;
    }
    
    .btn {
        padding: 14px;
        font-size: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-link {
        min-width: auto;
    }
    
    .user-info {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: space-between;
    }
    
    .url-info {
        grid-template-columns: 1fr;
    }
    
    .link-item-content {
        grid-template-columns: 1fr;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .image-item img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .generated-url {
        padding: 20px;
    }
    
    .url-display input {
        padding-right: 80px;
    }
    
    .copy-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 文本对齐 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 边距工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* 辅助类 */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
    margin-top: 30px;
}

.no-data i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--light-gray);
}
