/* 主体内容区域样式 - body.css */

/* 主要内容区域 */
.main-content {
    padding: 0 15px 15px;
    position: relative;
    padding-left: 15px; /* 正常的左侧内边距 */
}

/* 项目卡片样式 */
.items-container {
    margin-bottom: 20px;
}

.item-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    padding: 8px 8px;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

.item-name-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.item-number {
    font-weight: bold;
    color: #666;
    font-size: 16px;
    min-width: 20px;
}

.item-controls {
    display: flex;
}

/* 按钮样式 */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    margin-left: 8px;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-icon.btn-confirm {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

.action-btn {
    min-width: 48px;
    width: 60px;
    height: 36px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.btn-start {
    background: var(--primary);
    color: white;
}

.btn-start:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.btn-start.disabled,
.btn-start:disabled {
    background: var(--gray);
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-start.disabled:hover,
.btn-start:disabled:hover {
    background: var(--gray);
    transform: none;
}

.btn-end {
    background: var(--warning);
    color: white;
}

.btn-end:hover {
    background: #f5b942;
    transform: scale(1.1);
}

.btn-confirm {
    background: var(--danger);
    color: white;
    animation: pulse 1.5s infinite;
}

.btn-confirm:hover {
    transform: scale(1.1);
}

.btn-completed {
    background: var(--success);
    color: white;
    opacity: 0.8;
}

/* 添加项目按钮 */
.btn-add-item {
    width: 100%;
    padding: 15px;
    background: white;
    border: 2px dashed var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-item:hover {
    border-color: var(--primary);
    background: var(--light);
}

.btn-add-item i {
    margin-right: 8px;
}

/* 底部操作区样式 */
.bottom-actions {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 0px 15px 15px 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-add-item-small {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-add-item-small:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-add-item-small i {
    transition: transform 0.2s ease;
}

.btn-add-item-small:hover i {
    transform: rotate(90deg);
}

.btn-complete-workout {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    background: var(--primary);
    color: white;
}

.btn-complete-workout:disabled {
    background: var(--border);
    color: var(--gray);
    cursor: not-allowed;
}

.btn-complete-workout:disabled:hover {
    transform: none;
}

.btn-complete-workout:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 180, 124, 0.3);
}

.complete-btn-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    font-weight: 600;
}

.complete-btn-text {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.complete-btn-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--secondary);
    z-index: 1;
    transition: width 0.1s linear;
}

.btn-complete-workout:disabled .complete-btn-progress {
    background: transparent;
}

/* 组数表格样式 */
.sets-table {
    width: 100%;
    border-collapse: collapse;
}

.sets-table th {
    text-align: left;
    padding: 15px 20px;
    font-size: 13px;
    color: var(--dark);
    font-weight: 400;
    border-bottom: 1px solid var(--border);
}

.sets-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.sets-table tr:last-child td {
    border-bottom: none;
}

.set-start-time {
    font-weight: 500;
    color: var(--dark);
    min-width: 75px;
}

.set-duration {
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

.sets-table th:nth-child(4),
.sets-table td:nth-child(4) {
    width: 60px;
    text-align: center;
}

.sets-table th:nth-child(3) {
    text-align: center;
}

/* 组管理操作样式 */
.set-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-small {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--gray);
    transition: all 0.3s;
    font-size: 12px;
    background: white;
}

.btn-small:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-small.btn-confirm {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--border);
}

.empty-state p {
    font-size: 16px;
}

/* 节标题样式 */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border);
}

/* 计划菜单样式 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
    font-size: 16px;
}

.btn-header:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.plan-menu {
    position: relative;
}

.btn-menu {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
    font-size: 16px;
}

.btn-menu:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    min-width: 220px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    transition: background 0.2s ease;
}

.menu-item:hover {
    background: var(--light);
}

.menu-item.save-new {
    color: var(--primary);
    font-weight: 500;
}

.menu-item.save-new:hover {
    background: var(--primary);
    color: white;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.menu-section-title {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    background: var(--light);
}

.plan-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
    border-left: 5px solid transparent;
}

.plan-item:hover {
    background: var(--light);
    border-left-color: var(--primary);
}

.plan-item.current {
    background: var(--primary);
    color: white;
    border-left-color: var(--secondary);
}

.plan-info {
    flex: 1;
}

.plan-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.plan-meta {
    font-size: 12px;
    color: var(--gray);
}

.plan-item.current .plan-meta {
    color: rgba(255, 255, 255, 0.8);
}

.plan-actions {
    display: flex;
    gap: 4px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.btn-plan-action {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.2s ease;
}

.btn-plan-action:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--danger);
}

.btn-plan-action.btn-confirm {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

.empty-plans {
    padding: 20px 16px;
    text-align: center;
    color: var(--gray);
    font-style: italic;
}

/* 分享菜单样式 */
.share-menu {
    position: relative;
    display: inline-block;
}

.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.share-dropdown.show {
    opacity: 1;
    visibility: visible;
}

.share-section-title {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.share-plans {
    padding: 8px 0;
}

.share-plan-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border);
    border-left: 5px solid transparent;
}

.share-plan-item:last-child {
    border-bottom: none;
}

.share-plan-item:hover {
    /* background-color: var(--primary); */
    border-left-color: var(--primary);
}

.share-plan-info {
    flex: 1;
}

.share-plan-name {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 2px;
}

.share-plan-meta {
    font-size: 12px;
    color: var(--gray);
}

.share-plan-current {
    background-color: #e3f2fd;
    border-left: 3px solid var(--primary);
}

.share-plan-current .share-plan-name {
    color: var(--primary);
    font-weight: 600;
}

.share-empty {
    padding: 20px;
    text-align: center;
    color: var(--gray);
    font-size: 14px;
}

/* 导入菜单项样式 */
.menu-item.import-from-clipboard {
    color: var(--secondary);
}

.menu-item.import-from-clipboard:hover {
    background: var(--primary);
    color: white;
}

/* Markdown内容样式 */
.markdown-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.markdown-content h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.markdown-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
    margin: 20px 0 12px 0;
}

.markdown-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin: 16px 0 8px 0;
}

.markdown-content p {
    margin-bottom: 12px;
    color: #555;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.markdown-content li {
    margin-bottom: 6px;
    color: #555;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--dark);
}

.markdown-content em {
    font-style: italic;
    color: var(--primary);
}

.markdown-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--danger);
}

.markdown-content pre {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content a[target="_blank"]::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 3px;
    opacity: 0.7;
    vertical-align: super;
}

.markdown-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--secondary);
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
    font-style: italic;
    background-color: #f9f9f9;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
}

.markdown-content .emoji {
    font-size: 1.2em;
}

/* 时长统计样式 */
.time-summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.time-item {
    text-align: center;
    flex: 1;
}

.time-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .main-content {
        padding: 0 10px 15px;
    }
    
    .bottom-actions {
        padding: 0px 15px 15px 15px;
        gap: 10px;
        margin-top: 0px;
    }
    
    .btn-add-item-small {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .btn-complete-workout {
        height: 45px;
    }
    
    .complete-btn-content {
        font-size: 15px;
    }
    
    .section-header {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
    }
    
    .section-title {
        font-size: 18px;
        text-align: left;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
    }
    
    .plan-menu {
        align-self: auto;
        flex-shrink: 0;
    }
    
    .menu-dropdown {
        right: 0;
        left: auto;
        transform: none;
        min-width: 280px;
        max-width: 90vw;
    }
    
    .time-summary {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .time-label {
        font-size: 11px;
    }
    
    .time-value {
        font-size: 14px;
    }
    
    .sets-table {
        font-size: 13px;
        table-layout: fixed;
        width: 100%;
    }
    
    .sets-table th:nth-child(3),
    .sets-table td:nth-child(3) {
        width: 60px;
        white-space: nowrap;
    }
    
    .sets-table th,
    .sets-table td {
        padding: 10px 8px;
    }
    
    .sets-table th:first-child,
    .sets-table td:first-child {
        width: 40px;
    }
    
    .sets-table th:nth-child(2),
    .sets-table td:nth-child(2) {
        width: 80px;
    }
    
    .sets-table th:nth-child(4),
    .sets-table td:nth-child(4) {
        width: 55px;
    }
    
    .sets-table th:last-child,
    .sets-table td:last-child {
        width: 60px;
    }
    
    .item-card {
        overflow-x: auto;
    }
    
    .markdown-content {
        font-size: 13px;
    }
    
    .markdown-content h1 {
        font-size: 20px;
    }
    
    .markdown-content h2 {
        font-size: 18px;
    }
    
    .markdown-content h3 {
        font-size: 16px;
    }
}
