/* admin-style.css - 管理面板样式 */

/* 登录/管理面板容器 */
.centered-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.centered-wrapper {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

/* 玻璃卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px 25px;
    box-shadow: var(--glass-shadow);
    animation: cardAppear 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 登录卡片 */
.login-card {
    position: relative;
}

/* 卡片头部 */
.card-header {
    text-align: center;
    margin-bottom: 25px;
}

.header-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

.card-header h2 {
    font-size: 1.6rem;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.card-header p {
    margin: 0;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 表单输入组 */
.input-group {
    position: relative;
    margin-bottom: 18px;
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(102, 126, 234, 0.4);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-group input:focus ~ .input-icon {
    opacity: 1;
    color: var(--link-color);
    transform: translateY(-50%) scale(1.1);
}

/* 玻璃按钮 */
.glass-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px -5px rgba(102, 126, 234, 0.4);
}

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

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.glass-btn:hover .btn-glow {
    opacity: 1;
    animation: rotateGlow 2s linear infinite;
}

/* 按钮加载状态 */
.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

/* 卡片底部 */
.card-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

.hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.hint-icon {
    font-size: 1rem;
}

.hint strong {
    color: var(--link-color);
    font-weight: 700;
}

.back-link {
    display: block;
    text-align: center;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-3px);
}

/* 管理面板样式 */
.admin-wrapper {
    max-width: 950px;
    margin: 0 auto;
    padding: 15px;
}

.admin-card {
    padding: 25px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.welcome-text {
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.9;
    font-size: 0.95rem;
}

/* 管理表单 */
.glass-form {
    margin-bottom: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
}

.form-group input, .form-group select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--link-color);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px -5px rgba(102, 126, 234, 0.3);
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 5px 15px -5px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    display: inline-block;
}

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

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 5px 15px -5px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 8px 20px -5px rgba(231, 76, 60, 0.5);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 列表部分 */
.list-section {
    margin-top: 15px;
}

.list-section h4 {
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    background: var(--card-bg);
    padding: 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    flex-wrap: wrap;
    gap: 8px;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 180px;
    flex-wrap: wrap;
}

.item-category {
    font-weight: 700;
    color: var(--link-color);
    font-size: 0.8rem;
}

.item-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.item-meta {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 管理部分 */
.admin-section {
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--glass-border);
}

.admin-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 14px;
    color: var(--link-color);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.section-title::before {
    content: "◆";
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 警告框 */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: slideDown 0.4s ease-out;
    font-size: 0.9rem;
}

.alert-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 5px 15px -5px rgba(231, 76, 60, 0.4);
}

.alert-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 5px 15px -5px rgba(39, 174, 96, 0.4);
}

/* 动画 */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

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

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* 装饰性背景 */
.centered-container::before,
.centered-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: 1;
    animation: float 8s ease-in-out infinite;
}

.centered-container::before {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3), transparent);
    top: 5%;
    left: 3%;
    animation-delay: 0s;
}

.centered-container::after {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.3), transparent);
    bottom: 5%;
    right: 3%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* 暗色模式适配 */
[data-theme="dark"] .glass-card {
    background: rgba(30, 30, 30, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input-group input,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hint {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .list-group-item {
    background: rgba(50, 50, 50, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .centered-container {
        min-height: 55vh;
        padding: 20px 15px;
    }

    .glass-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .card-header h2 {
        font-size: 1.4rem;
    }

    .header-icon {
        font-size: 1.8rem;
    }

    .input-group input {
        padding: 12px 12px 12px 40px;
        font-size: 0.9rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-info {
        width: 100%;
    }

    .item-actions {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .glass-card {
        border-radius: 14px;
    }

    .card-header h2 {
        font-size: 1.2rem;
    }

    .hint {
        font-size: 0.75rem;
    }

    .header-content {
        gap: 8px;
    }

    .logo-text {
        font-size: 0.95rem;
    }
}
