/* 后台管理样式 */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --hover-color: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* 登录页面 */
.login-page {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.login-header p {
    color: var(--text-secondary);
    margin: 0;
}

.login-form {
    margin-top: 30px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

/* 后台管理布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-logo i {
    font-size: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #334155;
    color: #e2e8f0;
}

.nav-link.active {
    background: #334155;
    color: white;
    border-left: 3px solid var(--primary-color);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-link.text-danger:hover {
    color: #f87171;
}

.sidebar-footer {
    border-top: 1px solid #334155;
    padding: 15px 0;
}

.main-content {
    flex: 1;
    overflow-y: auto;
}

.content-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    margin: 0 0 5px;
    font-size: 24px;
}

.header-left p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin: 20px 30px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--primary-color);
}

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

.card-body {
    padding: 25px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分类统计 */
.category-stats {
    display: grid;
    gap: 15px;
}

.category-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--hover-color);
    border-radius: 8px;
}

.cat-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-info i {
    font-size: 18px;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--hover-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

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

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-muted {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 表单样式 */
.form {
    max-width: 700px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input.disabled {
    background: var(--hover-color);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-divider {
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-input-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-input-wrapper input {
    flex: 1;
}

.icon-preview {
    width: 60px;
    height: 60px;
    background: var(--hover-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.icon-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.icon-selector {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-selector input {
    flex: 1;
}

.icon-preview-large {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--hover-color);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--hover-color);
}

.table-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.tool-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-cell img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.url-cell a {
    color: var(--primary-color);
    font-size: 13px;
    text-decoration: none;
}

.url-cell a:hover {
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--hover-color);
    color: var(--text-secondary);
}

.badge-large {
    padding: 6px 14px;
    font-size: 13px;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* 警告提示 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 30px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 50px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 信息网格 */
.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--hover-color);
    border-radius: 8px;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    font-weight: 500;
}

/* 文本颜色 */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-xl { font-size: 1.5rem; }

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s;
}

.back-to-top:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

/* 响应式设计 */
@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .nav-link {
        white-space: nowrap;
        padding: 10px 15px;
    }
    
    .sidebar-footer {
        display: flex;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .card {
        margin: 15px;
    }
    
    .stats-grid {
        padding: 15px;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
