/*
 * Zibll网盘下载小工具样式
 * @package Zibll Pan Download Widget
 * @version 2.0.0
 * 
 */

/* 小工具容器 */
.zib-widget.zibll_pan_download_widget,
.widget.zibll_pan_download_widget {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 兼容旧的zpdw-container样式 */
.zpdw-container {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 输入组样式 */
.zpdw-input-group {
    display: block;
    margin-bottom: 16px;
}

.zpdw-input-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.zpdw-input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s ease;
}

.zpdw-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.zpdw-input-group input::placeholder {
    color: #9ca3af;
}

/* 兼容旧的form-group样式 */
.zpdw-form-group {
    margin-bottom: 16px;
}

/* 输入框和选择框 */
.zpdw-input,
.zpdw-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.zpdw-input:focus,
.zpdw-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.zpdw-input::placeholder,
.zpdw-select::placeholder {
    color: #9ca3af;
}

/* 按钮样式 */
.zpdw-button {
    width: 100%;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.zpdw-button:hover {
    background: #2563eb;
}

.zpdw-button:active {
    background: #1d4ed8;
}

.zpdw-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* 次要按钮样式 */
.zpdw-button-secondary {
    width: 100%;
    padding: 10px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.zpdw-button-secondary:hover {
    background: #059669;
}

.zpdw-button-secondary:active {
    background: #047857;
}

.zpdw-button-secondary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* 按钮组样式 */
.zpdw-actions-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.zpdw-actions-group .zpdw-button,
.zpdw-actions-group .zpdw-button-secondary {
    flex: 1;
    width: auto;
}

/* 消息提示 */
.zpdw-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.zpdw-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.zpdw-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.zpdw-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 通知样式 */
.zpdw-notice {
    padding: 12px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

/* 网盘项目折叠样式 */
.zpdw-pan-item {
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.zpdw-pan-item:last-child {
    margin-bottom: 0;
}

.zpdw-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.zpdw-item-header:hover {
    background: #f1f5f9;
}

.zpdw-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.zpdw-item-title i {
    color: #3b82f6;
}

.zpdw-collapse-icon {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.3s ease;
    order: 3;
}

.zpdw-item-header.collapsed .zpdw-collapse-icon {
    transform: rotate(0deg);
}

.zpdw-item-header:not(.collapsed) .zpdw-collapse-icon {
    transform: rotate(0deg);
}

.zpdw-item-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 500px;
    opacity: 1;
    padding: 16px;
}

.zpdw-item-content.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 16px !important;
    overflow: hidden !important;
}

/* 第一个项目默认展开 */
.zpdw-pan-item:first-child .zpdw-item-content {
    max-height: 500px;
}

.zpdw-pan-item:first-child .zpdw-item-header .zpdw-collapse-icon {
    transform: none;
}

/* 深色模式下的网盘项目样式 */
@media (prefers-color-scheme: dark) {
    .zpdw-pan-item {
        border-color: #4b5563;
        background: #1f2937;
    }
    
    .zpdw-item-header {
        background: #374151;
        border-color: #4b5563;
    }
    
    .zpdw-item-header:hover {
        background: #4b5563;
    }
    
    .zpdw-item-title {
        color: #f9fafb;
    }
    
    .zpdw-item-title i {
        color: #60a5fa;
    }
    
    .zpdw-collapse-icon {
        color: #9ca3af;
    }
    
    .zpdw-item-content {
        background: #1f2937;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .zib-widget.zibll_pan_download_widget,
    .widget.zibll_pan_download_widget {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .zpdw-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .zpdw-input-group input,
    .zpdw-input,
    .zpdw-select {
        background: #374151;
        border-color: #4b5563;
        color: #e2e8f0;
    }
    
    .zpdw-input-group input:focus,
    .zpdw-input:focus,
    .zpdw-select:focus {
        border-color: #60a5fa;
    }
    
    .zpdw-input-label {
        color: #e2e8f0;
    }
    
    .zpdw-notice {
        background: #451a03;
        color: #fbbf24;
        border-color: #92400e;
    }
    

    
    .zpdw-item-number {
        background: #60a5fa;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .zib-widget.zibll_pan_download_widget,
    .widget.zibll_pan_download_widget {
        padding: 16px;
    }
    
    .zpdw-input,
    .zpdw-select,
    .zpdw-button {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media (max-width: 480px) {
    .zib-widget.zibll_pan_download_widget,
    .widget.zibll_pan_download_widget {
        padding: 12px;
    }
    
    .zpdw-input-group input,
    .zpdw-input,
    .zpdw-select {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .zpdw-button {
        padding: 8px 12px;
        font-size: 14px;
    }
}



.zpdw-remove-item {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    order: 2;
    margin-right: 8px;
}

.zpdw-remove-item:hover {
    background: #dc2626;
}

/* 项目编号样式 */
.zpdw-item-number {
    background: #3b82f6;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 6px;
    display: inline-block;
    min-width: 16px;
    text-align: center;
}

/* 展开时隐藏删除按钮 */
.zpdw-item-header:not(.collapsed) .zpdw-remove-item {
    display: none !important;
}

/* 折叠时显示删除按钮 */
.zpdw-item-header.collapsed .zpdw-remove-item {
    display: block !important;
}

#zpdw-add-more {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 6px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#zpdw-add-more:hover {
    background: #059669;
}

#zpdw-add-more:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.zpdw-item-actions {
    text-align: right;
}

/* 内容区域删除按钮样式 */
.zpdw-content-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.zpdw-remove-item-content {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.zpdw-remove-item-content:hover {
    background: #dc2626;
}

/* 折叠时隐藏内容区域的删除按钮 */
.zpdw-item-content.collapsed .zpdw-content-actions {
    display: none;
}

/* 展开时显示内容区域的删除按钮 */
.zpdw-item-content:not(.collapsed) .zpdw-content-actions {
    display: block;
}