:root {
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.2);
    --text-color: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-image) no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    min-height: 100vh;
}

/* 添加背景图片过渡效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 添加暗色遮罩 */
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    background: var(--card-bg);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.site-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.site-card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

.card-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.site-card:hover .card-header {
    opacity: 1;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.site-content {
    display: flex;
    padding: 20px;
    text-decoration: none;
    color: var(--text-color);
}

.site-icon {
    width: 48px;
    height: 48px;
    margin-right: 15px;
}

.site-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.site-info {
    flex: 1;
    min-width: 0; /* 防止文本溢出 */
}

.site-info h3 {
    margin-bottom: 8px;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.description {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    opacity: 0.6;
}

.urls small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-menu {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    overflow: hidden;
}

.site-card:hover .context-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 修改模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal-content {
    background: rgba(30, 30, 30, 0.9);
    color: var(--text-color);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

/* 表单样式 */
input, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.form-error {
    color: #ff4444;
    font-size: 14px;
    margin-top: 4px;
}

input[name="path"] {
    font-family: monospace;
}

.ios-button {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ios-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icon-input-group {
    display: flex;
    gap: 10px;
    margin: 8px 0;
}

.icon-input-group input {
    flex: 1;
    margin: 0;
}

.icon-preview {
    width: 64px;
    height: 64px;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fetch-icon {
    white-space: nowrap;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 20px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.success-message {
    background: rgba(0, 255, 0, 0.1);
    color: #4caf50;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.success-message a {
    color: #4caf50;
    text-decoration: underline;
} 

/* 首页新样式 */
.main-content {
    display: grid;
    gap: 30px;
}

.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 22px;
}

.info-card h2 .bx {
    font-size: 26px;
}

.info-card p {
    line-height: 1.6;
    opacity: 0.9;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.feature-item {
    text-align: center;
    background: rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(0,0,0,0.2);
}

.feature-item .bx {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    color: #00aaff;
}

.feature-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

/* 卡片动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animated {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 为每个卡片设置不同的延迟 */
.main-content > .info-card:nth-child(1) {
    animation-delay: 0.1s;
}

.main-content > .info-card:nth-child(2) {
    animation-delay: 0.2s;
}

/* Toast 通知样式 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(72, 187, 120, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.hide {
    opacity: 0;
    transform: translateX(400px);
}

/* Toast 滑入动画 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Toast 滑出动画 */
@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}