/*!
 * Start Bootstrap - Simple Sidebar (https://startbootstrap.com/)
 * Copyright 2013-2016 Start Bootstrap
 * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
 */

/* ArtStation 风格侧边栏 - 统一悬浮卡片 */
/* 移动端默认：静态卡片，随文档流置顶显示 */
#sidebar-wrapper {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    padding: 16px 16px 0;
}

/* 主悬浮卡片容器 - 包含所有侧边栏内容 */
#sidebar-wrapper > ul.sidebar-nav {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #d0d7de;
    margin: 0;
    height: auto;
}

#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: #8c959f;
}

#page-content-wrapper {
    width: 100%;
    position: relative;
    padding: 15px;
}

/* Sidebar Styles */

ul.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #374151;
    top: 0;
}

/* 统一悬浮卡片容器 - 包含所有元素 */
ul.sidebar-nav li {
    margin-bottom: 0;
}

ul.sidebar-nav li > a {
    display: block;
    background: transparent;
    color: #111827;
    padding: 0;
    border-radius: 0;
    margin: 0;
    text-align: left;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    border-left: none;
    transition: none;
    box-shadow: none;
    margin-bottom: 16px;
}

ul.sidebar-nav li > a:hover {
    background: transparent;
    border-left: none;
    transform: none;
    box-shadow: none;
}

/* 表单区域卡片化 - 统一在悬浮卡片内 */
ul.sidebar-nav li > div {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 16px;
    box-shadow: none;
    border: none;
}

/* 表单标签 */
.form-group {
    margin: 0 0 16px 0;
    color: #6b7280;
}

.form-group label {
    display: block;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 表单输入框 */
.form-control {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: #111827;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 200ms ease;
    width: 100%;
}

.form-control:focus {
    background: #ffffff;
    border-color: #0969da;
    color: #111827;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
    outline: none;
}

.form-control:hover {
    border-color: #9ca3af;
}

/* 下拉选择框特殊处理 */
select.form-control {
    padding: 10px 30px 10px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    min-height: 42px;
}

/* 按钮样式 - 统一在悬浮卡片内 */
ul.sidebar-nav li .btn {
    margin: 0 0 12px 0;
    width: 100%;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: all 200ms ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

ul.sidebar-nav li .btn-secondary {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    color: #24292f;
}

ul.sidebar-nav li .btn-secondary:hover {
    background: #eaeef2;
    border-color: #afb8c1;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

ul.sidebar-nav li .btn-primary {
    background: #24292f;
    border-color: #24292f;
    color: #ffffff;
}

ul.sidebar-nav li .btn-primary:hover {
    background: #1c2128;
    border-color: #1c2128;
    transform: none;
    box-shadow: 0 2px 6px rgba(36, 41, 47, 0.3);
}

ul.sidebar-nav li .btn-danger {
    background: #ffffff;
    border: 1px solid #d0d7de;
    color: #cf222e;
    text-align: center;
}

ul.sidebar-nav li .btn-danger:hover {
    background: #cf222e;
    border-color: #cf222e;
    color: #ffffff;
    transform: none;
    box-shadow: 0 2px 6px rgba(207, 34, 46, 0.3);
}

/* 所有按钮文字居中 */
ul.sidebar-nav li .btn {
    text-align: center;
    display: block;
}

/* Header 标题 - 统一在悬浮卡片顶部 */
.header {
    background: transparent;
    padding: 0;
    text-align: left;
    color: #111827;
    margin-bottom: 20px;
}

.header h4 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
    box-shadow: none;
}

/* 未登录/访客状态卡片 */
.sidebar-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #d0d7de;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-card-header .sidebar-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.sidebar-card-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    word-break: break-word;
}

.sidebar-card-body {
    padding: 0;
}

.sidebar-card-desc {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 8px 0;
}

/* 作品摘要区（移动端只读展示 title + joined activity，右侧小编辑按钮） */
.work-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.work-summary-info {
    min-width: 0;
}

.work-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    word-break: break-word;
}

.work-summary-meta {
    font-size: 13px;
    color: #6e7781;
    margin: 0;
}

/* 小编辑按钮：展开/收起管理面板 */
.work-edit-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #57606a;
    font-size: 14px;
    cursor: pointer;
    transition: all 150ms ease;
}

.work-edit-btn:hover {
    background: #eaeef2;
    color: #24292f;
}

.work-edit-btn.open {
    background: #24292f;
    border-color: #24292f;
    color: #ffffff;
}

/* 管理面板：移动端默认折叠 */
.work-manage-panel {
    display: none;
}

.work-manage-panel.open {
    display: block;
}

/* 移动端：访客/非作者卡片只显示作品标题 */
@media(max-width:767px) {
    .sidebar-card-desc {
        display: none;
    }

    .sidebar-card-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
}

@media(min-width:768px) {
    #wrapper {
        padding-right: 430px;
    }

    /* 桌面端：右侧固定悬浮卡片 */
    #sidebar-wrapper {
        z-index: 1000;
        position: fixed;
        right: 400px;
        width: 300px;
        top: 80px;
        transform: none;
        margin-right: -300px;
        overflow-y: visible;
        padding: 20px 16px;
    }

    #page-content-wrapper {
        position: relative;
        margin-right: 0;
    }

    /* 桌面端：隐藏摘要区（含编辑按钮），管理面板始终展开（保持原状） */
    .work-summary {
        display: none;
    }

    .work-manage-panel {
        display: block;
    }
}
